Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: QCView with complex QTZ sporadic crashes - any hints?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: QCView with complex QTZ sporadic crashes - any hints?



Yes, except the majority of object allocations I'm seeing don't seem to show any signs of originating within my code, and I'm struggling to know how to I can investigate this further.

The following screenshot is reasonably typical of the sort of trace I'm seeing. I've singled out CFArray (store-deque) as it has a suspicious ever-increasing graph over nearly 5 minutes... CFString and CFBasicHash are similar but not as dramatic.

ps. Please do feel free to tell me how I should be using Instruments if you think I've missed something vital! Having read Apple's docs numerous times I'm still no clearer on how to isolate the problem.

PNG image




On 20 Jul 2011, at 13:59, Tamas Nagy wrote:

> Doesn't Instrument help you find what object cause the allocating issue?
>
> Az iPhone készülékemről küldve
>
> 2011.07.20. dátummal, 14:03 időpontban Adrian Ward <email@hidden> írta:
>
>>
>> Hey vade
>>
>> Thanks for the thoughts - most appreciated.
>>
>> No image ports to/from the actual QTZ, just lots of images coming from custom plugins, and going through JavaScript patches before being spat out in other structures for rendering. The biggest potential culprit is a Data Loader plugin that scans a folder hierarchically and returns a massive NSDictionary filled with strings, images and structures of strings and images (etc). I'm fairly certain there's no leaks in that plugin (having watched Object Allocations carefully) but I'm convinced there's a leak somewhere internal to QC, or OpenGL, or the NVIDIA/ATI drivers as a result of what it's doing. Maybe 30% of the time I have crashes, I've also seen lots of malloc error 12s in the log, so I know I'm pushing capacity (yes, the app is 32 bit).
>>
>> With NSZombies, the problem happens much quicker but it's still the same. Very often the last thing the app spits out before SIGBUS'ing is "Could not allocate register file: 12", which I'm finding it hard to know what this means, other than it's another malloc error 12 (out of memory).
>>
>> Another potential culprit is a different plugin (StyledTextPlugin, one that you've helped me with before) that uses WebKit to render a HTML string. It uses an NSAttributedString which is created from a chunk of HTML using WebKit, but this has to be done on a separate thread to avoid corrupting QC's rendering pipeline. Because WebKit doesn't seem to be thread-safe, on some crashes the backtrace is convoluted to say the least - and I'm not convinced this isn't causing the problem either.
>>
>> Oh, I've also seen QC crash in the same way - so it's nothing to do with my app specifically.
>>
>> Currently my not-so-ideal solution is to allow the app to crash quietly and focus on relaunching it as quickly and seamlessly as possible - not ideal.
>>
>> Is it worth me sharing an Instruments trace, or is that mostly a useless gesture?
>>
>> Thanks and all the best
>>
>>
>> Ade.
>>
>>
>>
>> On 18 Jul 2011, at 18:22, vade wrote:
>>
>>> Are you feeding images into published input image ports, or pulling images out of published image ports, or is everything handled internally a single QTZ?
>>>
>>> Try enabling NSZombies and see if you can re-create the crash or leak of objects. Does this happen consistently at the same point in your code, on app launch for example, or is it totally inconsistent? Is your app 32 bit? are you hitting a memory limit? Have you checked for leaks at all?
>>>
>>> Does yoru 3rd party plugin handle image processing?
>>>
>>> The thread overhead is afaik "well known" for quicktime, especially AIC and modern codecs that can use multiple decode threads. I often see tons of threads in apps like VDMX, because of pre-rolling, etc, and I dont think they get cleaned up quickly either.
>>>
>>>
>>>
>>> On Jul 18, 2011, at 12:05 PM, Adrian Ward wrote:
>>>
>>>>
>>>> Hi all,
>>>>
>>>> I'm starting to see an increase in sporadic crashes of an app we've written that uses a QCView that has loaded a large and complex QTZ. This set up has been running for quite a long time and the only significant change is the content that the QTZ loads. We've been through the content repeatedly to see if we can find a culprit but there is nothing immediately obvious.
>>>>
>>>> Now, I know better than to expect anyone here to give me a solution, but I thought if I posted a crash report someone might be able to suggest an area I should be looking at. The below report tells me Thread 0 has crashed whilst QCImageManager was optimising its caches, and I'm guessing it's likely that a resource somewhere got over-released. So I know I need to be careful about memory allocation. I'm fairly certain I have been in the custom plugins that are loaded. I'm also aware that the app is loading LOTS of content - object allocations during the load phase peak at about 600MB so maybe I'm just being greedy?
>>>>
>>>> The 32 QCDatagramReceiver threads are not a surprise - I have 32 Network Receiver patches somewhere deep in the QTZ.
>>>>
>>>> However, whats with the ~68 threads that are in QuickTimeH264.scalar and AppleIntermediateCodec?! I don't have that many Movie Importers running at the same time! I might have some sitting idle that sometimes get used to load video, but not all at the same the time. Generally I'd only ever have a maximum of two Movie Importers loading a video at the same time, and the rest of the time the others would have their Movie Location set to blank so they wouldn't have loaded any video. I know we use both H264 and AIC for video content so this is a point of concern.
>>>>
>>>> So, does this suggest that QC isn't freeing resources (or killing old threads...) used by Movie Importer? And is it plausible that this could be pushing my app to a EXC_BAD_ACCESS?
>>>>
>>>> Sorry I can't post a QTZ demonstrating this in action, nor reduce the project to reproduce the issue reliably.
>>>>
>>>> All suggestions welcome! Unless they involve phone hacking, please.
>>>>
>>>> Thanks,
>>>>
>>>>
>>>> Ade.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Process:         Performer [16964]
>>>> Path:            /IWM/UIMain/Performer.app/Contents/MacOS/Performer
>>>> Identifier:      uk.co.clayinteractive.performer
>>>> Version:         ??? (3.2 (20110518))
>>>> Code Type:       X86 (Native)
>>>> Parent Process:  launchd [110]
>>>>
>>>> Date/Time:       2011-07-18 14:50:03.675 +0100
>>>> OS Version:      Mac OS X 10.6.7 (10J869)
>>>> Report Version:  6
>>>>
>>>> Anonymous UUID:                      7BE221EF-6350-4AD4-A24F-9C9308A6BB3C
>>>>
>>>> Exception Type:  EXC_BAD_ACCESS (SIGBUS)
>>>> Exception Codes: KERN_PROTECTION_FAILURE at 0x000000000000002e
>>>> Crashed Thread:  0  Dispatch queue: com.apple.main-thread
>>>>
>>>> Application Specific Information:
>>>> objc_msgSend() selector name: backingReleaseCallback
>>>>
>>>>
>>>> Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
>>>> 0   libobjc.A.dylib                   0x95448ed7 objc_msgSend + 23
>>>> 1   com.apple.QuartzComposer          0x99792939 -[QCCache(Private) _applyFunctionOnAllResources:userInfo:] + 86
>>>> 2   com.apple.QuartzComposer          0x99791d90 -[QCImageManager optimizeCaches] + 1418
>>>> 3   com.apple.QuartzComposer          0x99791693 -[QCImageManager reclaimResources] + 141
>>>> 4   com.apple.QuartzComposer          0x9979f800 -[QCGraphicsContext renderPatch:time:arguments:] + 170
>>>> 5   com.apple.QuartzComposer          0x9979e764 -[QCOpenGLContext renderPatch:time:arguments:] + 614
>>>> 6   com.apple.QuartzComposer          0x9979e4f6 -[QCPatch(Runtime) render:arguments:] + 92
>>>> 7   com.apple.QuartzComposer          0x997df7de -[QCView render:arguments:] + 738
>>>> 8   com.apple.QuartzComposer          0x9980a653 -[QCView _renderTimer] + 160
>>>> 9   com.apple.QuartzComposer          0x997e4d3a _TimerCallback + 240
>>>> 10  com.apple.CoreFoundation          0x98226adb __CFRunLoopRun + 8059
>>>> 11  com.apple.CoreFoundation          0x98224464 CFRunLoopRunSpecific + 452
>>>> 12  com.apple.CoreFoundation          0x98224291 CFRunLoopRunInMode + 97
>>>> 13  com.apple.HIToolbox               0x942fbe04 RunCurrentEventLoopInMode + 392
>>>> 14  com.apple.HIToolbox               0x942fbbb9 ReceiveNextEventCommon + 354
>>>> 15  com.apple.HIToolbox               0x942fba3e BlockUntilNextEventMatchingListInMode + 81
>>>> 16  com.apple.AppKit                  0x9066c78d _DPSNextEvent + 847
>>>> 17  com.apple.AppKit                  0x9066bfce -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 156
>>>> 18  com.apple.AppKit                  0x9062e247 -[NSApplication run] + 821
>>>> 19  com.apple.AppKit                  0x906262d9 NSApplicationMain + 574
>>>> 20  ...o.clayinteractive.performer    0x00002c12 main + 2584 (main.m:128)
>>>> 21  ...o.clayinteractive.performer    0x000021ce start + 54
>>>>
>>>> Thread 1:  Dispatch queue: com.apple.libdispatch-manager
>>>> 0   libSystem.B.dylib                 0x94613922 kevent + 10
>>>> 1   libSystem.B.dylib                 0x9461403c _dispatch_mgr_invoke + 215
>>>> 2   libSystem.B.dylib                 0x946134f9 _dispatch_queue_invoke + 163
>>>> 3   libSystem.B.dylib                 0x9461329e _dispatch_worker_thread2 + 240
>>>> 4   libSystem.B.dylib                 0x94612d21 _pthread_wqthread + 390
>>>> 5   libSystem.B.dylib                 0x94612b66 start_wqthread + 30
>>>>
>>>> Thread 2:
>>>> 0   libSystem.B.dylib                 0x945ed09a mach_msg_trap + 10
>>>> 1   libSystem.B.dylib                 0x945ed807 mach_msg + 68
>>>> 2   com.apple.opengl                  0x978d71d9 glcDebugListener + 426
>>>> 3   libSystem.B.dylib                 0x9461a7fd _pthread_start + 345
>>>> 4   libSystem.B.dylib                 0x9461a682 thread_start + 34
>>>>
>>>> Thread 3:
>>>> 0   libSystem.B.dylib                 0x945ed09a mach_msg_trap + 10
>>>> 1   libSystem.B.dylib                 0x945ed807 mach_msg + 68
>>>> 2   com.apple.CoreFoundation          0x9822537f __CFRunLoopRun + 2079
>>>> 3   com.apple.CoreFoundation          0x98224464 CFRunLoopRunSpecific + 452
>>>> 4   com.apple.CoreFoundation          0x9822a3a4 CFRunLoopRun + 84
>>>> 5   com.apple.QuartzComposer          0x997f6929 -[QCRunLoopPatch _runLoopThread:] + 449
>>>> 6   com.apple.Foundation              0x9699fad0 -[NSThread main] + 45
>>>> 7   com.apple.Foundation              0x9699fa80 __NSThread__main__ + 1499
>>>> 8   libSystem.B.dylib                 0x9461a7fd _pthread_start + 345
>>>> 9   libSystem.B.dylib                 0x9461a682 thread_start + 34
>>>>
>>>> Thread 4:
>>>> 0   libSystem.B.dylib                 0x9460c066 select$DARWIN_EXTSN + 10
>>>> 1   com.apple.QuartzComposer          0x9987e7e0 -[QCDatagramReceiver receiveDataWithTimeOut:] + 246
>>>> 2   com.apple.QuartzComposer          0x9987e619 -[QCDatagramReceiver receiveStringWithTimeOut:] + 49
>>>> 3   com.apple.QuartzComposer          0x998ab95a -[QCNetworkReceiver _receiverThread:] + 97
>>>> 4   com.apple.QuartzComposer          0x9988f52e -[QCThreadPatch _thread:] + 341
>>>> 5   com.apple.Foundation              0x9699fad0 -[NSThread main] + 45
>>>> 6   com.apple.Foundation              0x9699fa80 __NSThread__main__ + 1499
>>>> 7   libSystem.B.dylib                 0x9461a7fd _pthread_start + 345
>>>> 8   libSystem.B.dylib                 0x9461a682 thread_start + 34
>>>>
>>>> Thread 5:
>>>> 0   libSystem.B.dylib                 0x9460c066 select$DARWIN_EXTSN + 10
>>>> 1   com.apple.QuartzComposer          0x9987e7e0 -[QCDatagramReceiver receiveDataWithTimeOut:] + 246
>>>> 2   com.apple.QuartzComposer          0x9987e619 -[QCDatagramReceiver receiveStringWithTimeOut:] + 49
>>>> 3   com.apple.QuartzComposer          0x998ab95a -[QCNetworkReceiver _receiverThread:] + 97
>>>> 4   com.apple.QuartzComposer          0x9988f52e -[QCThreadPatch _thread:] + 341
>>>> 5   com.apple.Foundation              0x9699fad0 -[NSThread main] + 45
>>>> 6   com.apple.Foundation              0x9699fa80 __NSThread__main__ + 1499
>>>> 7   libSystem.B.dylib                 0x9461a7fd _pthread_start + 345
>>>> 8   libSystem.B.dylib                 0x9461a682 thread_start + 34
>>>>
>>>> Thread 6:
>>>> 0   libSystem.B.dylib                 0x9460c066 select$DARWIN_EXTSN + 10
>>>> 1   com.apple.QuartzComposer          0x9987e7e0 -[QCDatagramReceiver receiveDataWithTimeOut:] + 246
>>>> 2   com.apple.QuartzComposer          0x9987e619 -[QCDatagramReceiver receiveStringWithTimeOut:] + 49
>>>> 3   com.apple.QuartzComposer          0x998ab95a -[QCNetworkReceiver _receiverThread:] + 97
>>>> 4   com.apple.QuartzComposer          0x9988f52e -[QCThreadPatch _thread:] + 341
>>>> 5   com.apple.Foundation              0x9699fad0 -[NSThread main] + 45
>>>> 6   com.apple.Foundation              0x9699fa80 __NSThread__main__ + 1499
>>>> 7   libSystem.B.dylib                 0x9461a7fd _pthread_start + 345
>>>> 8   libSystem.B.dylib                 0x9461a682 thread_start + 34
>>>>
>>>> Thread 7:
>>>> 0   libSystem.B.dylib                 0x9460c066 select$DARWIN_EXTSN + 10
>>>> 1   com.apple.QuartzComposer          0x9987e7e0 -[QCDatagramReceiver receiveDataWithTimeOut:] + 246
>>>> 2   com.apple.QuartzComposer          0x9987e619 -[QCDatagramReceiver receiveStringWithTimeOut:] + 49
>>>> 3   com.apple.QuartzComposer          0x998ab95a -[QCNetworkReceiver _receiverThread:] + 97
>>>> 4   com.apple.QuartzComposer          0x9988f52e -[QCThreadPatch _thread:] + 341
>>>> 5   com.apple.Foundation              0x9699fad0 -[NSThread main] + 45
>>>> 6   com.apple.Foundation              0x9699fa80 __NSThread__main__ + 1499
>>>> 7   libSystem.B.dylib                 0x9461a7fd _pthread_start + 345
>>>> 8   libSystem.B.dylib                 0x9461a682 thread_start + 34
>>>>
>>>> Thread 8:
>>>> 0   libSystem.B.dylib                 0x9460c066 select$DARWIN_EXTSN + 10
>>>> 1   com.apple.QuartzComposer          0x9987e7e0 -[QCDatagramReceiver receiveDataWithTimeOut:] + 246
>>>> 2   com.apple.QuartzComposer          0x9987e619 -[QCDatagramReceiver receiveStringWithTimeOut:] + 49
>>>> 3   com.apple.QuartzComposer          0x998ab95a -[QCNetworkReceiver _receiverThread:] + 97
>>>> 4   com.apple.QuartzComposer          0x9988f52e -[QCThreadPatch _thread:] + 341
>>>> 5   com.apple.Foundation              0x9699fad0 -[NSThread main] + 45
>>>> 6   com.apple.Foundation              0x9699fa80 __NSThread__main__ + 1499
>>>> 7   libSystem.B.dylib                 0x9461a7fd _pthread_start + 345
>>>> 8   libSystem.B.dylib                 0x9461a682 thread_start + 34
>>>>
>>>> Thread 9:
>>>> 0   libSystem.B.dylib                 0x9460c066 select$DARWIN_EXTSN + 10
>>>> 1   com.apple.QuartzComposer          0x9987e7e0 -[QCDatagramReceiver receiveDataWithTimeOut:] + 246
>>>> 2   com.apple.QuartzComposer          0x9987e619 -[QCDatagramReceiver receiveStringWithTimeOut:] + 49
>>>> 3   com.apple.QuartzComposer          0x998ab95a -[QCNetworkReceiver _receiverThread:] + 97
>>>> 4   com.apple.QuartzComposer          0x9988f52e -[QCThreadPatch _thread:] + 341
>>>> 5   com.apple.Foundation              0x9699fad0 -[NSThread main] + 45
>>>> 6   com.apple.Foundation              0x9699fa80 __NSThread__main__ + 1499
>>>> 7   libSystem.B.dylib                 0x9461a7fd _pthread_start + 345
>>>> 8   libSystem.B.dylib                 0x9461a682 thread_start + 34
>>>>
>>>> Thread 10:
>>>> 0   libSystem.B.dylib                 0x9460c066 select$DARWIN_EXTSN + 10
>>>> 1   com.apple.QuartzComposer          0x9987e7e0 -[QCDatagramReceiver receiveDataWithTimeOut:] + 246
>>>> 2   com.apple.QuartzComposer          0x9987e619 -[QCDatagramReceiver receiveStringWithTimeOut:] + 49
>>>> 3   com.apple.QuartzComposer          0x998ab95a -[QCNetworkReceiver _receiverThread:] + 97
>>>> 4   com.apple.QuartzComposer          0x9988f52e -[QCThreadPatch _thread:] + 341
>>>> 5   com.apple.Foundation              0x9699fad0 -[NSThread main] + 45
>>>> 6   com.apple.Foundation              0x9699fa80 __NSThread__main__ + 1499
>>>> 7   libSystem.B.dylib                 0x9461a7fd _pthread_start + 345
>>>> 8   libSystem.B.dylib                 0x9461a682 thread_start + 34
>>>>
>>>> Thread 11:
>>>> 0   libSystem.B.dylib                 0x9460c066 select$DARWIN_EXTSN + 10
>>>> 1   com.apple.QuartzComposer          0x9987e7e0 -[QCDatagramReceiver receiveDataWithTimeOut:] + 246
>>>> 2   com.apple.QuartzComposer          0x9987e619 -[QCDatagramReceiver receiveStringWithTimeOut:] + 49
>>>> 3   com.apple.QuartzComposer          0x998ab95a -[QCNetworkReceiver _receiverThread:] + 97
>>>> 4   com.apple.QuartzComposer          0x9988f52e -[QCThreadPatch _thread:] + 341
>>>> 5   com.apple.Foundation              0x9699fad0 -[NSThread main] + 45
>>>> 6   com.apple.Foundation              0x9699fa80 __NSThread__main__ + 1499
>>>> 7   libSystem.B.dylib                 0x9461a7fd _pthread_start + 345
>>>> 8   libSystem.B.dylib                 0x9461a682 thread_start + 34
>>>>
>>>> Thread 12:
>>>> 0   libSystem.B.dylib                 0x9460c066 select$DARWIN_EXTSN + 10
>>>> 1   com.apple.QuartzComposer          0x9987e7e0 -[QCDatagramReceiver receiveDataWithTimeOut:] + 246
>>>> 2   com.apple.QuartzComposer          0x9987e619 -[QCDatagramReceiver receiveStringWithTimeOut:] + 49
>>>> 3   com.apple.QuartzComposer          0x998ab95a -[QCNetworkReceiver _receiverThread:] + 97
>>>> 4   com.apple.QuartzComposer          0x9988f52e -[QCThreadPatch _thread:] + 341
>>>> 5   com.apple.Foundation              0x9699fad0 -[NSThread main] + 45
>>>> 6   com.apple.Foundation              0x9699fa80 __NSThread__main__ + 1499
>>>> 7   libSystem.B.dylib                 0x9461a7fd _pthread_start + 345
>>>> 8   libSystem.B.dylib                 0x9461a682 thread_start + 34
>>>>
>>>> Thread 13:
>>>> 0   libSystem.B.dylib                 0x9460c066 select$DARWIN_EXTSN + 10
>>>> 1   com.apple.QuartzComposer          0x9987e7e0 -[QCDatagramReceiver receiveDataWithTimeOu


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.