#expect crashes w/ EXC_BAD_ACCESS on collections of length greater than 2 where children refer to parent #79182
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
crash
Bug: A crash, i.e., an abnormal termination of software
triage needed
This issue needs more specific labels
Description
I have a class
Coll
with a propertyitems
that's an array ofItem
s.These
Item
s can have a weak reference back to theirColl
. If at least three of them do, a failed expectation about theColl
or one of theItem
s will cause a crash withEXC_BAD_ACCESS
.I believe the crash is caused when generating the description of the expectation e.g.
Expectation failed: (subject → SwiftExpectReproTests.Coll) == nil
Looks like infinite recursion?
Reproduction
Stack dump
Expected behavior
I'd expect it to print the failed assertion, like it does if only two of the items have references to the parent.
Environment
swift-driver version: 1.115 Apple Swift version 6.0.2 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)
Target: arm64-apple-macosx15.0
IPS Crash Report
Additional information
Possibly related:
https://github.com/swiftlang/swift-testing/blob/57335d72b1ed5dda16db61c35dd4551976bda920/Sources/Testing/SourceAttribution/Expression.swift#L439
https://github.com/swiftlang/swift-testing/blob/57335d72b1ed5dda16db61c35dd4551976bda920/Sources/Testing/SourceAttribution/Expression.swift#L238
The text was updated successfully, but these errors were encountered: