Deadlock on app launch in (ObjC method cache)
| Originator: | me | ||
| Number: | rdar://11571828 | Date Originated: | 31-May-2012 06:17 PM |
| Status: | Open | Resolved: | |
| Product: | Mac OS X | Product Version: | 10.7.4 (11E53) |
| Classification: | Crash/Hang/Data Loss | Reproducible: | Rarely |
I came across this situation last night. The app had just finished launching (under LLDB), and then hung. Most threads are waiting on the method cache lock, apparently held by the main thread. The main thread is attempting to mark a class as initialized. I feel like I've seen this issue once or twice before, but it's (clearly) fairly rare. Thread 1, Queue : com.apple.main-thread #0 0x00007fff971866b6 in semaphore_wait_trap () #1 0x00007fff8bdc677d in _class_setInitialized () #2 0x00007fff8bdc664c in _finishInitializing () #3 0x00007fff8bdc56af in _class_initialize () #4 0x00007fff8bdc5517 in prepareForMethodLookup () #5 0x00007fff8bdc52bb in lookUpMethod () #6 0x00007fff8bdc2f3c in objc_msgSend () #7 0x00007fff97662ccc in -[NSURLRequest initWithURL:cachePolicy:timeoutInterval:] () #8 0x00007fff97662c4d in +[NSURLRequest requestWithURL:cachePolicy:timeoutInterval:] () #9 0x000000010030c6eb in -[LINetworkWatcher _testNetworkConnectionAndChangeStatusBasedOnResults] at /Users/jonathon/Documents/Streams/Delicious Monster/UberLibrary/Library/LINetworkWatcher.m:95 #10 0x000000010030c33d in networkReachabilityChanged at /Users/jonathon/Documents/Streams/Delicious Monster/UberLibrary/Library/LINetworkWatcher.m:138 #11 0x00007fff9794d999 in rlsPerform () #12 0x00007fff8ec3d4f1 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ () #13 0x00007fff8ec3cd5d in __CFRunLoopDoSources0 () #14 0x00007fff8ec63b49 in __CFRunLoopRun () #15 0x00007fff8ec63486 in CFRunLoopRunSpecific () #16 0x00007fff92e1f4d3 in RunCurrentEventLoopInMode () #17 0x00007fff92e26781 in ReceiveNextEventCommon () #18 0x00007fff92e2660e in BlockUntilNextEventMatchingListInMode () #19 0x00007fff94656e31 in _DPSNextEvent () #20 0x00007fff94656735 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] () #21 0x00007fff94653071 in -[NSApplication run] () #22 0x00007fff948cf244 in NSApplicationMain () #23 0x00000001000032e6 in main at /Users/jonathon/Documents/Streams/Delicious Monster/UberLibrary/Library/main.m:52 #24 0x0000000100002664 in start () Thread 2, Queue : com.apple.libdispatch-manager #0 0x00007fff971887e6 in kevent () #1 0x00007fff9014778a in _dispatch_mgr_invoke () #2 0x00007fff9014631a in _dispatch_mgr_thread () Thread 3, Queue : com.apple.root.default-priority #0 0x00007fff971866b6 in semaphore_wait_trap () #1 0x00007fff8bdc5af8 in lockForMethodLookup () #2 0x00007fff8bdc5367 in lookUpMethod () #3 0x00007fff8bdc2f3c in objc_msgSend () #4 0x00007fff9483744d in _addTextReplacement () #5 0x00007fff94833936 in NSSpellCheckerCheckString () #6 0x00007fff94832e70 in -[NSTextCheckingOperation main] () #7 0x00007fff976456b4 in -[__NSOperationInternal start] () #8 0x00007fff97658912 in ____NSOQSchedule_block_invoke_2 () #9 0x00007fff90145a86 in _dispatch_call_block_and_release () #10 0x00007fff90146965 in _dispatch_worker_thread2 () #11 0x00007fff96f463da in _pthread_wqthread () #12 0x00007fff96f47b85 in start_wqthread () Thread 4, Queue : CFPreferences Background Sync Queue #0 0x00007fff971866b6 in semaphore_wait_trap () #1 0x00007fff8bdc5af8 in lockForMethodLookup () #2 0x00007fff8bdc5367 in lookUpMethod () #3 0x00007fff8bdc2f3c in objc_msgSend () #4 0x00007fff8ecb24a8 in __AUTOSYNC_ESTABLISH_block_invoke_1 () #5 0x00007fff90145a86 in _dispatch_call_block_and_release () #6 0x00007fff90147dd3 in _dispatch_after_timer_callback () #7 0x00007fff9014a497 in _dispatch_source_invoke () #8 0x00007fff90147143 in _dispatch_queue_invoke () #9 0x00007fff901472a0 in _dispatch_queue_drain () #10 0x00007fff90147132 in _dispatch_queue_invoke () #11 0x00007fff9014692c in _dispatch_worker_thread2 () #12 0x00007fff96f463da in _pthread_wqthread () #13 0x00007fff96f47b85 in start_wqthread () Thread 5, Queue : com.apple.root.default-priority #0 0x00007fff971866b6 in semaphore_wait_trap () #1 0x00007fff8bdc5af8 in lockForMethodLookup () #2 0x00007fff8bdc5367 in lookUpMethod () #3 0x00007fff8bdc2f3c in objc_msgSend () #4 0x00007fff90d8b4a8 in __+[ABAddressBook nts_CreateSharedAddressBook]_block_invoke_1 () #5 0x00007fff90145a86 in _dispatch_call_block_and_release () #6 0x00007fff90147dd3 in _dispatch_after_timer_callback () #7 0x00007fff9014a497 in _dispatch_source_invoke () #8 0x00007fff90147143 in _dispatch_queue_invoke () #9 0x00007fff9014692c in _dispatch_worker_thread2 () #10 0x00007fff96f463da in _pthread_wqthread () #11 0x00007fff96f47b85 in start_wqthread () Thread 6, Queue : (null) #0 0x00007fff9718667a in mach_msg_trap () #1 0x00007fff97185dda in mach_msg () #2 0x00007fff8ec5b50c in __CFRunLoopServiceMachPort () #3 0x00007fff8ec63c74 in __CFRunLoopRun () #4 0x00007fff8ec63486 in CFRunLoopRunSpecific () #5 0x00007fff931e9fe9 in CMIO::DAL::RunLoop::OwnThread(void*) () #6 0x00007fff931e015a in CAPThread::Entry(CAPThread*) () #7 0x00007fff96f448bf in _pthread_start () #8 0x00007fff96f47b75 in thread_start () Thread 7 com.apple.CFSocket.private, Queue : (null) #0 0x00007fff97187df2 in select$DARWIN_EXTSN () #1 0x00007fff8ecacc8b in __CFSocketManager () #2 0x00007fff96f448bf in _pthread_start () #3 0x00007fff96f47b75 in thread_start () Thread 8 CVDisplayLink, Queue : (null) #0 0x00007fff97187bca in __psynch_cvwait () #1 0x00007fff96f48274 in _pthread_cond_wait () #2 0x00007fff97d846c8 in CVDisplayLink::runIOThread() () #3 0x00007fff97d843e9 in _ZL13startIOThreadPv () #4 0x00007fff96f448bf in _pthread_start () #5 0x00007fff96f47b75 in thread_start () Thread 9, Queue : com.apple.root.default-overcommit-priority #0 0x00007fff971866b6 in semaphore_wait_trap () #1 0x00007fff8bdc5af8 in lockForMethodLookup () #2 0x00007fff8bdc5367 in lookUpMethod () #3 0x00007fff8bdc2f3c in objc_msgSend () #4 0x00007fff8eb7451e in _Block_object_assign () #5 0x00007fff8eb74305 in _Block_copy_internal () #6 0x00007fff8ec831c5 in CFRunLoopPerformBlock () #7 0x00007fff8ecb1fc8 in __CFXNotificationPostToken () #8 0x00007fff97fd07b3 in ___notify_dispatch_handle_block_invoke_1 () #9 0x00007fff90145a86 in _dispatch_call_block_and_release () #10 0x00007fff90146965 in _dispatch_worker_thread2 () #11 0x00007fff96f463da in _pthread_wqthread () #12 0x00007fff96f47b85 in start_wqthread () Thread 11, Queue : com.apple.root.default-priority #0 0x00007fff971866b6 in semaphore_wait_trap () #1 0x00007fff8bdc5af8 in lockForMethodLookup () #2 0x00007fff8bdc5367 in lookUpMethod () #3 0x00007fff8bdc2f3c in objc_msgSend () #4 0x00007fff9468b6de in __-[NSPersistentUIManager tearDownStateRestorationApparatusAndResumeWindowOrdering]_block_invoke_1 () #5 0x00007fff90145a86 in _dispatch_call_block_and_release () #6 0x00007fff90147dd3 in _dispatch_after_timer_callback () #7 0x00007fff9014a497 in _dispatch_source_invoke () #8 0x00007fff90147143 in _dispatch_queue_invoke () #9 0x00007fff9014692c in _dispatch_worker_thread2 () #10 0x00007fff96f463da in _pthread_wqthread () #11 0x00007fff96f47b85 in start_wqthread ()
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
I've seen this myself on several occasions, in iOS. It has always been in the debugger, so I assumed it had something to do with it interfering.