ofVideoGrabber crash after a few hours, crash report included

Process:         removed [30385]
Path:            /Users/USER/Documents/*/removed.app/Contents/MacOS/removed
Identifier:      com.yourcompany.openFrameworks
Version:         1.0
Code Type:       X86 (Native)
Parent Process:  launchd [172]
Responsible:     removed [30385]
User ID:         502

Date/Time:       2014-09-16 01:49:09.180 -0500
OS Version:      Mac OS X 10.9.4 (13E28)
Report Version:  11
Anonymous UUID:  removed


Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000004

VM Regions Near 0x4:
--> __PAGEZERO             0000000000000000-0000000000001000 [    4K] ---/--- SM=NUL  /Users/USER/Documents/*/removed.app/Contents/MacOS/removed
    __TEXT                 0000000000001000-000000000097e000 [ 9716K] r-x/rwx SM=COW  /Users/USER/Documents/*/removed.app/Contents/MacOS/removed

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.QuickTime           	0x92bafaff callBackTask_priv + 60
1   com.apple.QuickTime           	0x92bd5781 TaskMovie_priv + 344
2   com.apple.QuickTimeComponents.component	0x9abf34f6 0x9a8d9000 + 3253494
3   com.apple.QuickTimeComponents.component	0x9ac01418 0x9a8d9000 + 3310616
4   com.apple.QuickTimeComponents.component	0x9abf1a8d 0x9a8d9000 + 3246733
5   com.apple.CoreServices.CarbonCore	0x96679cd7 CallComponentFunctionCommonWithStorage(char**, ComponentParameters*, long (*)(), unsigned long) + 45
6   com.apple.CoreServices.CarbonCore	0x96679d17 CallComponentFunctionWithStorageProcInfo + 30
7   com.apple.QuickTimeComponents.component	0x9abf04e2 _MCComponentDispatch + 77
8   com.apple.CoreServices.CarbonCore	0x965ebc45 CallComponent + 166
9   com.apple.CoreServices.CarbonCore	0x965ebc9f CallComponentDispatch + 29
10  com.apple.QuickTime           	0x92bd52de MCIdle + 37
11  com.apple.QuickTime           	0x92bd4338 QTOMovieObject::SendCommand(unsigned long, void const*) + 2786
12  com.apple.QuickTime           	0x92bbbfe8 DispatchQTMsg(void const*, unsigned long, unsigned long, unsigned long, QTOGenericObject*) + 104
13  com.apple.QuickTime           	0x92bbbf2d QTObjectTokenPriv::SendMessageToObject(QTMessagePriv*, unsigned long) + 237
14  com.apple.QuickTime           	0x92bbb95b QTObjectTokenPriv::DispatchMessage(QTMessagePriv*, void const*, __CFAllocator const*, unsigned long, unsigned long, ComponentMsgParam*, unsigned long, unsigned long) + 1441
15  com.apple.QuickTime           	0x92bd384c QTSendToObject + 99
16  com.apple.QTKit               	0x978e58ec QTObjectTokenExecuteCommand + 82
17  com.apple.QTKit               	0x978a9baf -[QTMovie_QuickTime idle] + 311
18  com.apple.QTKit               	0x978a98ac +[QTMovie_QuickTime idleAllMovies:] + 340
19  com.apple.Foundation          	0x9ba6076b __NSFireTimer + 117
20  com.apple.CoreFoundation      	0x90c0bea6 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
21  com.apple.CoreFoundation      	0x90c0b863 __CFRunLoopDoTimer + 1395
22  com.apple.CoreFoundation      	0x90c8606d __CFRunLoopDoTimers + 349
23  com.apple.CoreFoundation      	0x90bc3353 __CFRunLoopRun + 1779
24  com.apple.CoreFoundation      	0x90bc29ea CFRunLoopRunSpecific + 394
25  com.apple.CoreFoundation      	0x90bc284b CFRunLoopRunInMode + 123
26  com.apple.HIToolbox           	0x9b694b5d RunCurrentEventLoopInMode + 259
27  com.apple.HIToolbox           	0x9b694777 ReceiveNextEventCommon + 163
28  com.apple.HIToolbox           	0x9b6946bd _BlockUntilNextEventMatchingListInModeWithFilter + 92
29  com.apple.AppKit              	0x947be349 _DPSNextEvent + 1602
30  com.apple.AppKit              	0x947bd870 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 119
31  com.yourcompany.openFrameworks	0x00316cff _glfwPlatformPollEvents + 143
32  com.yourcompany.openFrameworks	0x003bd7af ofAppGLFWWindow::display() + 335
33  com.yourcompany.openFrameworks	0x003bd65d ofAppGLFWWindow::runAppViaInfiniteLoop(ofBaseApp*) + 61
34  com.yourcompany.openFrameworks	0x0034cf7c ofRunApp(ofBaseApp*) + 1260
35  com.yourcompany.openFrameworks	0x00015016 main + 118
36  com.yourcompany.openFrameworks	0x00002935 start + 53

Has anyone had this? I suspect a bad camera, but my suspicions could be wrong.

I’m not doing anything fancy with the code.

video_grabber.update();
if (video_grabber.isFrameNew()){
        
    cout << "starting to set pixels";
    // convert the video_grabber image to an ofxCvColorImage
    color_image.setFromPixels(video_grabber.getPixels(), grey_image.getWidth(), grey_image.getHeight());
    cout << "...done setting pixels.  Converting to B&W";
        
    // use the "=" operator to convert to B&W
    grey_image = color_image;
        
    cout << "...done converting to b&w" << endl;
        
    // blur the image
    grey_image.blur(effects.blur_amount);
    
    // upload the information to the GPU for use in the shader
    grey_image.updateTexture();
     
...
}

It is completing the cout cycle to done converting to b&w, so it isn’t openCV crashing.

Anyone have any ideas? Thank you so much!

that looks like a crash in GLFW, which version of OF are you using?

An earlier version of 0.8. Not the freshest. Maybe even 0.8.0.

Yup, it’s 0.8.0 (been working on this project for a year and a half!). Is it worth trying to use ofAppGlutWindow?

I’m experiencing the same exact thing with 0.8.0 — except that I’m using ofAppGlutWindow.

actually looking into the trace, it’s really a problem in the video player, i was confused because the trace is optimized.

perhaps report it in github but 0.9 will use avfoundation by default instead of qtkit.

an option would be to use ofxGStreamer which is well tested and doesn’t crash

Just to throw in … I’m seeing this on the master branch when compiling with the GLFW from apothecary on a 10.10 machine and attempting to run the application on a 10.8 or 10.9 machine @brannondorsey.