BUG IN CLIENT OF LIBPLATFORM: Unlock of an os_unfair_lock not owned by current thread

I am getting the following crash in my child process just after fork():


Crashed Thread: 0 Dispatch queue: com.apple.root.default-qos



Exception Type: EXC_BAD_INSTRUCTION (SIGILL)

Exception Codes: 0x0000000000000001, 0x0000000000000000

Exception Note: EXC_CORPSE_NOTIFY



Termination Signal: Illegal instruction: 4

Termination Reason: Namespace SIGNAL, Code 0x4

Terminating Process: exc handler [0]



Application Specific Information:

crashed on child side of fork pre-exec

BUG IN CLIENT OF LIBPLATFORM: Unlock of an os_unfair_lock not owned by current thread



Thread 0 Crashed:: Dispatch queue: com.apple.root.default-qos

0 libsystem_platform.dylib 0x00007fffa83a4bf7 _os_unfair_lock_unowned_abort + 23

1 libsystem_platform.dylib 0x00007fffa83a4539 _os_unfair_lock_unlock_slow + 95

2 libBacktraceRecording.dylib 0x000000010017810c fork_child_process_handler + 23

3 libsystem_pthread.dylib 0x000000010020f54e _pthread_fork_child_postinit + 69

4 libSystem.B.dylib 0x00007fffa6b9eb50 libSystem_atfork_child + 64

5 libsystem_c.dylib 0x00007fffa81db477 fork + 47


This app runs fine in El Capitan. The El Capitan build runs fine in Sierra. But I get the crash when I build in Xcode8 and run in Sierra. Any ideas?

Accepted Reply

The problem is resolved by switching to posix_spawn(). I stil haven't tested that on 10.6-10.11 yet though. My GCD version didn't work on older OS versions. My NSTask version started failing in 10.11 and didn't work at all in 10.12. That's why I switched to fork() to begin with. One out of 4 APIs is functional.

Replies

The problem is resolved by switching to posix_spawn(). I stil haven't tested that on 10.6-10.11 yet though. My GCD version didn't work on older OS versions. My NSTask version started failing in 10.11 and didn't work at all in 10.12. That's why I switched to fork() to begin with. One out of 4 APIs is functional.