Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-15291] Concurrency: Crash when invoking async @objc function #57613

Open
mickeyl opened this issue Oct 7, 2021 · 8 comments
Open

[SR-15291] Concurrency: Crash when invoking async @objc function #57613

mickeyl opened this issue Oct 7, 2021 · 8 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@mickeyl
Copy link

mickeyl commented Oct 7, 2021

Previous ID SR-15291
Radar None
Original Reporter @mickeyl
Type Bug
Environment

macOS Big Sur, Xcode 13, iOS 15

Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee None
Priority Medium

md5: 6dd0e24a6fb0f8662c8211501fdd40f3

Issue Description:

Adding the `async` modifier to an `@objc` function crashes when invoking that function via a Notification observer.

The backtrace is here:

(lldb) bt
* thread #​6, queue = 'com.apple.root.default-qos', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
    frame #​0: 0x000000010c647928 libobjc.A.dylib`objc_release + 8
    frame #​1: 0x000000010d3aba95 Foundation`-[NSConcreteNotification dealloc] + 49
    frame #​2: 0x000000010c6479f7 libobjc.A.dylib`objc_object::sidetable_release(bool, bool) + 177
  * frame #​3: 0x000000010c1d6b8a SR555`closure #​1 in ViewController.viewDidLoad(self=0x00007fda09807c40) at ViewController.swift:20:40
    frame #&#8203;4: 0x000000010c1d6c48 SR555`thunk for @escaping @callee_guaranteed () -> () at <compiler-generated>:0
    frame #&#8203;5: 0x000000010d9d3c0c libdispatch.dylib`_dispatch_client_callout + 8
    frame #&#8203;6: 0x000000010d9d6595 libdispatch.dylib`_dispatch_continuation_pop + 594
    frame #&#8203;7: 0x000000010d9eaea0 libdispatch.dylib`_dispatch_source_invoke + 2166
    frame #&#8203;8: 0x000000010d9d5ecd libdispatch.dylib`_dispatch_queue_override_invoke + 584
    frame #&#8203;9: 0x000000010d9e5b44 libdispatch.dylib`_dispatch_root_queue_drain + 403
    frame #&#8203;10: 0x000000010d9e65ec libdispatch.dylib`_dispatch_worker_thread2 + 196
    frame #&#8203;11: 0x00007fff6bfeb417 libsystem_pthread.dylib`_pthread_wqthread + 244
    frame #&#8203;12: 0x00007fff6bfea42f libsystem_pthread.dylib`start_wqthread + 15
(lldb) 

An example project to clone is here: https://github.com/mickeyl/swift-bugs – directory SR15291

@mickeyl
Copy link
Author

mickeyl commented Nov 17, 2021

Same in 5.5.2-dev as per Xcode 13.2.0 beta 2.

@mickeyl
Copy link
Author

mickeyl commented Dec 8, 2021

Likewise in 5.5.2-dev as per Xcode 13.2.0 RC.

@mickeyl
Copy link
Author

mickeyl commented Mar 9, 2022

Still a problem in Xcode 13.3.0 RC.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@mickeyl
Copy link
Author

mickeyl commented May 13, 2022

Still a problem in 5.6.1 as per Xcode 13.4 RC.

@mickeyl
Copy link
Author

mickeyl commented Jun 9, 2022

Still a problem in 5.7 as per Xcode 14.0 Beta 1.

@shahla00
Copy link

shahla00 commented Jun 20, 2022

Do we know when it will be fixed? Any work arounds while it is being fixed?

@mickeyl
Copy link
Author

mickeyl commented Aug 2, 2022

None. No progress reports, not even an acknowledgment. It's sad.

@mickeyl
Copy link
Author

mickeyl commented Jun 9, 2023

Still a problem with Swift 5.9 beta as per Xcode 15 beta. I vaguely recall a discussion where someone said it's not going to be fixed, so it would probably be good to close this as WONTFIX. I'm not going to do this though, since it's not fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Projects
None yet
Development

No branches or pull requests

2 participants