Re: Concurrent tasks are getting hung up
Re: Concurrent tasks are getting hung up
- Subject: Re: Concurrent tasks are getting hung up
- From: Steve Mills <email@hidden>
- Date: Thu, 09 Oct 2014 22:58:21 -0500
On Oct 9, 2014, at 17:25:05, Greg Parker <email@hidden> wrote:
>
> This thread is stopped inside dispatch_once(), presumably waiting for some other thread to perform the once operation.
>
> Assuming dispatch_once is working normally, there should be one thread inside readMakerNoteProps() and dispatch_once_f() that is doing something else. Can you find it? What is it doing?
Found a thread that looks different:
#0 0x00007fff8d46ca56 in semaphore_wait_trap ()
#1 0x00007fff97c879f9 in _dispatch_semaphore_wait_slow ()
#2 0x00007fff95f087ef in xpc_connection_send_message_with_reply_sync ()
#3 0x00007fff925acbde in _LSCopyApplicationInformation ()
#4 0x00007fff95898450 in ProcessInformationCopyDictionary ()
#5 0x00007fff90efca3e in ___lldb_unnamed_function3$$MetadataLib.dylib ()
#6 0x00007fff97c8328d in _dispatch_client_callout ()
#7 0x00007fff97c831fc in dispatch_once_f ()
#8 0x00007fff90efc50f in readMakerNoteProps ()
#9 0x00007fff8bd982f9 in readMakerNoteProps ()
#10 0x00007fff8bd4834d in metadataFromDatablock ()
#11 0x00007fff8bd47bf8 in metadataFromDatablock ()
#12 0x00007fff8bd7afed in createMetadataFromDatabuffer ()
#13 0x00007fff8bd7194e in readExifData ()
#14 0x00007fff8bd705ff in initImageJPEG ()
#15 0x00007fff8bd6f1d6 in _CGImagePluginInitJPEG ()
#16 0x00007fff8bd4528c in makeImagePlus ()
#17 0x00007fff8bd6a469 in CGImageSourceCreateImageAtIndex ()
#18 0x00000001000052a0 in -[FFGraphicSearch doesImageMatchURL:] at /Users/tut/Dropbox/FotoFind/FotoFind/FFGraphicSearch.mm:161
#19 0x0000000100003324 in -[FFMainWindowController ifImageMatchesAddToResults:] at /Users/tut/Dropbox/FotoFind/FotoFind/FFMainWindowController.mm:228
#20 0x00007fff977059ac in __invoking___ ()
#21 0x00007fff97705814 in -[NSInvocation invoke] ()
#22 0x00007fff8d9c9484 in -[NSInvocationOperation main] ()
#23 0x00007fff8d920f31 in -[__NSOperationInternal _start:] ()
#24 0x00007fff8d920bdb in __NSOQSchedule_f ()
#25 0x00007fff97c8328d in _dispatch_client_callout ()
#26 0x00007fff97c877e3 in _dispatch_async_redirect_invoke ()
#27 0x00007fff97c8328d in _dispatch_client_callout ()
#28 0x00007fff97c85082 in _dispatch_root_queue_drain ()
#29 0x00007fff97c86177 in _dispatch_worker_thread2 ()
#30 0x00007fff8de69ef8 in _pthread_wqthread ()
ProcessInformationCopyDictionary is plenty old, deprecated in 10.9 and claims to be thread-safe since 10.3.
> One way to break dispatch_once is to throw an exception from the once operation. If you don't see any thread actually executing the once operation then you might try running with an All Exceptions breakpoint and see if anything fails there.
I added breakpoints for both throw and catch. Here's the only catch hit I get (a few different threads stopped here):
#0 0x00007fff95a0ebdf in __cxa_throw ()
#1 0x00007fff8ca9b68e in CMMThrowExceptionOnError(CMMErr) ()
#2 0x00007fff8cab2cf8 in CMMInputProfile::GetDstColorSpace(CMMConversionType, bool*) ()
#3 0x00007fff8caa75bd in DoInitializeTransform ()
#4 0x00007fff8caa93b7 in AppleCMMInitializeTransform ()
#5 0x00007fff8cae0935 in ColorSyncCMMInitializeTransform ()
#6 0x00007fff8ca96568 in ColorSyncTransformCreate ()
#7 0x00000001003893ce in create ()
#8 0x0000000100384cc0 in CMSGetProfileInfo ()
#9 0x00007fff8fe42214 in color_space_create_icc ()
#10 0x00007fff8fe4701b in CGColorSpaceCreateWithICCProfile ()
#11 0x00007fff8fe7ad2d in CGColorSpaceCreateICCBased ()
#12 0x00007fff8bd4e0f9 in ImageIO_CreateICCBasedColorSpaceWithProfile ()
#13 0x00007fff8bd4e06d in ImageIO_CreateICCBasedColorSpaceWithProfileData ()
#14 0x00007fff8bd4e037 in CGColorSpaceCreateWithCopyOfData ()
#15 0x00007fff8bd7085f in initImageJPEG ()
#16 0x00007fff8bd6f1d6 in _CGImagePluginInitJPEG ()
#17 0x00007fff8bd4528c in makeImagePlus ()
#18 0x00007fff8bd6a469 in CGImageSourceCreateImageAtIndex ()
#19 0x00000001000052a0 in -[FFGraphicSearch doesImageMatchURL:] at /Users/tut/Dropbox/FotoFind/FotoFind/FFGraphicSearch.mm:161
The catch was being handled in DoInitializeTransform as well, so it wasn't throwing past that. I saw that happen a few times. Now I can't get it to happen again - it goes back to the hanging behavior displayed by the top stack.
--
Steve Mills
Drummer, Mac geek
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden