Crashes in _os_semaphore_dispose.cold since Xcode 13 beta 5

Hi,

since the Xcode 13 beta 5 I am seeing crashes in _os_semaphore_dispose.cold.* when running in the iOS simulator. This happens in different apps under various conditions, so I can pin it down to something specific.

Is anybody else having similar issues?

Stack of the crashing thread looks like this:

Disassembly looks like this:

Thanks for any feedback.

Cheers, Michael

Same here, even with WWDC21 sample code. Tried the usual stupid method (delete ~/Library/Dev…, ~/Library/Cache/com.apple.dt…, reboot, redownload and reinstall)

Same here. Rollback to beta 4 solved the issue 🥲

At least it's good not to be alone ;-). Filed as FB9487340.

The simplest example I found, was just having a TextField and tapping on it after a reset of the simulator. Once the keyboard appears and shows the "swipe to type" instructions the crash occurs. The reset of the simulator is necessary so that the "swipe to type" instructions appear, which seem to be the causing the crash in that case.

Same here.

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libdispatch.dylib             	0x000000010b1844b8 _dispatch_sema4_wait.cold.3 + 36
1   libdispatch.dylib             	0x000000010b14dee4 _dispatch_sema4_wait + 52
2   libdispatch.dylib             	0x000000010b14e540 _dispatch_semaphore_wait_slow + 128

Glad to see this pop up here. Re rolling back to beta 4: sadly I already brought up all the relevant devices to beta 5, which then obviously breaks things when running on device, for reasons unrelated to this issue. Given other idiosyncrasies when running in the simulator on a pre-Monterey Mac (stemming from the concurrency evolution) I was wondering if anyone is seeing this while running the simulator on Monterey?

Seeing this too, even on WWDC sample code. Running on macOS 11.5.1 on an M1 mac.

That made me realize that I hadn't checked for it on an Intel Mac. And it turns out, I actually can't reproduce my specific instance of this on an Intel machine.

[M1] not fixed by Big Sur 11.5.2 ;(

Workaround: Run the Simulator on an Intel Mac.

Running Xcode-beta in Rosetta mode (Right-click Xcode-beta.app, tick the box that says "Open using Rosetta"). Appears to be working for me. Performance feels weird but it's not stopping me from working.

Same here while making a standalone Watch App. Will try to do the roll back to Beta 4

The b7 release notes give another workaround: In Xcode select Product > Scheme > Edit Scheme…, then deselect Run > Options > Queue Debugging > “Enable backtrace recording.”

Works for me.

-Steve

Thanks Steve! Didn't think to check today's release notes for anything regarding this bug, since there was no new Xcode. Luckily I had notifications on for this thread.

Seeing the same thing. I can't run our app in the simulator because it happens on startup. Disabling backtrace reporting got me back in action though. Thanks @sjs!

Same here. Tried all that stuff as well. It doesn't happen when not attached to the debugger... but that's not exactly helpful.

@milutz Do you have a simple use case? And have you filed a Feedback?

I'm seeing the same, triggered by either RunLoop or Firebase, but always ending in the same Semaphore issue.

** Note: I CANNOT reproduce this if I run Xcode and simulator from an Intel mac running macOS beta.

Crashes in _os_semaphore_dispose.cold since Xcode 13 beta 5
 
 
Q