Skip to content

Crash: os_unfair_lock crashes on macOS 15.4 (developer beta) with Intel architecture #841

Description

@adilrc

Hi 👋
I've noticed an increased number of crashes for my users related os_unfair_lock on Intel machines. I've posted a feedback to Apple (FB16901524) but thought I'd let you know as the culprit is related to Nuke.

Note that you can use Swift compliant OSAllocatedUnfairLock for macOS 13+

Crashing Thread:

Thread 9 Crashed:
0   libsystem_platform.dylib        0xfff0053516c2      _os_unfair_lock_corruption_abort
1   libsystem_pthread.dylib         0xfff0052d5d98      pthread_mutex_destroy
2   QuartzCore                      0xfff01793653a      CA::OGL::MetalContext::~MetalContext
3   QuartzCore                      0xfff01791fbad      CA::OGL::MetalContext::~MetalContext
4   QuartzCore                      0xfff0179d86e8      CA::CG::AccelRenderer::~AccelRenderer
5   QuartzCore                      0xfff0179d858f      CA::CG::AccelRenderer::~AccelRenderer
6   QuartzCore                      0xfff0179d8a57      CA::CG::AccelRenderer::will_suspend_callback
7   libdispatch.dylib               0xfff004f9d9fb      _dispatch_client_callout
8   libdispatch.dylib               0xfff004f947e5      _dispatch_lane_barrier_sync_invoke_and_complete
9   QuartzCore                      0xfff0177360a6      CA::Render::post_notification
10  libdispatch.dylib               0xfff004f9d9fb      _dispatch_client_callout
11  libdispatch.dylib               0xfff004f8b0c2      _dispatch_continuation_pop
12  libdispatch.dylib               0xfff004f9a7f9      _dispatch_source_invoke
13  libdispatch.dylib               0xfff004f97899      _dispatch_root_queue_drain_deferred_item
14  libdispatch.dylib               0xfff004f971b2      _dispatch_kevent_worker_thread
15  libsystem_pthread.dylib         0xfff0052d68ec      _pthread_wqthread
16  libsystem_pthread.dylib         0xfff0052d5842      start_wqthread

Main Thread:

0   CoreGraphics                    0xfff0113ccef3      CGBitmapFreeData
1   CoreGraphics                    0xfff0113e15a0      data_provider_finalize
2   CoreGraphics                    0xfff0113a2929      data_provider_retain_count
3   CoreFoundation                  0xfff00550112b      _CFRelease
4   CoreGraphics                    0xfff011407949      image_finalize
5   CoreFoundation                  0xfff00550104c      _CFRelease
6   AppKit                          0xfff00c8deaf8      -[NSCGImageSnapshotRep dealloc]
7   CoreFoundation                  0xfff0053da3da      __RELEASE_OBJECTS_IN_THE_ARRAY__
8   CoreFoundation                  0xfff0053da2e8      -[__NSArrayM dealloc]
9   AppKit                          0xfff00c769d39      -[NSImageRep dealloc]
10  AppKit                          0xfff00c90e1ac      -[NSCustomImageRep dealloc]
11  CoreFoundation                  0xfff0053f9e2b      -[__NSSingleObjectArrayI dealloc]
12  libobjc.A.dylib                 0xfff004b0d1d1      object_cxxDestructFromClass
13  libobjc.A.dylib                 0xfff004b296c9      objc_destructInstance_nonnull_realized
14  libobjc.A.dylib                 0xfff004b06724      _objc_rootDealloc
15  AppKit                          0xfff00c8de9bd      -[NSImage dealloc]
16  Redacted                         0x20c1949ad         ImageContainer.Container.__deallocating_deinit
17  libswiftCore.dylib              0xfff02a3e1eff      _swift_release_dealloc
18  libswiftCore.dylib              0xfff02a3e2d85      swift::RefCounts<T>::doDecrementSlow<T>
19  Redacted                        0x20c17b1cc         Cache.Entry
20  Redacted                         0x20c1a1c59         LinkedList.Node.deinit
21  Redacted                         0x20c1a1c98         LinkedList.Node.__deallocating_deinit
22  libswiftCore.dylib              0xfff02a3e1eff      _swift_release_dealloc
23  libswiftCore.dylib              0xfff02a3e2d85      swift::RefCounts<T>::doDecrementSlow<T>
24  Redacted                         0x20c186a8d         closure in Cache.init
25  Redacted                         0x20c188d9b         closure in Cache.init
26  Redacted                         0x20a439a18         thunk for closure
27  libdispatch.dylib               0xfff004f9d9fb      _dispatch_client_callout
28  libdispatch.dylib               0xfff004f8b0c2      _dispatch_continuation_pop
29  libdispatch.dylib               0xfff004f9a7f9      _dispatch_source_invoke
30  libdispatch.dylib               0xfff004fb7e1e      _dispatch_main_queue_drain.cold.5
31  libdispatch.dylib               0xfff004f93f65      _dispatch_main_queue_drain
32  libdispatch.dylib               0xfff004f93ede      _dispatch_main_queue_callback_4CF
33  CoreFoundation                  0xfff005472276      __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
34  CoreFoundation                  0xfff005434d14      __CFRunLoopRun
35  CoreFoundation                  0xfff005433d12      CFRunLoopRunSpecific
36  HIToolbox                       0xfff01cabc0d3      RunCurrentEventLoopInMode
37  HIToolbox                       0xfff01cabef96      ReceiveNextEventCommon
38  HIToolbox                       0xfff01cc48199      _BlockUntilNextEventMatchingListInModeWithFilter
39  AppKit                          0xfff00c78de38      _DPSNextEvent
40  AppKit                          0xfff00d2194c6      -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
41  AppKit                          0xfff00c77ef18      -[NSApplication run]
42  AppKit                          0xfff00c752085      NSApplicationMain
43  Redacted                         0x20ad6d1db         [inlined] NSApplicationDelegate.main
44  Redacted                         0x20ad6d1db         [inlined] AppDelegate.$main (<compiler-generated>:20)
45  Redacted                         0x20ad6d1db         main

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions