-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labelsThis issue needs more specific labels
Description
Description
note: this issue seems not to occur on iOS 18, which perhaps means it is already fixed as well as it can be, but figured it should be reported anyway.
casting a function type with a sending
parameter or result to or from an existential Any
or AnyObject
results in crashes on iOS 17.
Reproduction
func sending_existential_roundtrip_crash_ios_17() {
typealias SendingParamFn = (sending Void) -> Void
do {
let _ = SendingParamFn.self is Any
}
do {
let _ = SendingParamFn.self as? Any
}
do {
let box = SendingParamFn.self as Any
let _ = box as? SendingParamFn.Type
}
}
running these cases on an iOS 17 target generally crashes with a memory access violation like:
Thread 1: EXC_BAD_ACCESS (code=1, address=0xfffffffffffffff8)
Expected behavior
should not crash
Environment
Apple Swift version 6.0.2 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)
Target: arm64-apple-macosx14.0
ran tests on iOS 17.5 simulator
Additional information
relevant forum post: https://forums.swift.org/t/exc-bad-access-during-access-to-actor-isolated-array/78571
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labelsThis issue needs more specific labels