8000 Crash when casting function type with `sending` parameter or result to/from an existential type on iOS 17 · Issue #80493 · swiftlang/swift · GitHub
[go: up one dir, main page]

Skip to content
Crash when casting function type with sending parameter or result to/from an existential type on iOS 17 #80493
@jamieQ

Description

@jamieQ

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

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0