ofxKinect crashing using IR image

I have been trying to utilize both the raw IR pixels and the depth pixels from the kinect, but have had some relentless crashes in the ofxKinect thread when I use ir image. It is crashing in the grabRgbFrame() with a EXC_BAD_ACCESS error.

The example ofxKinect code works fine with both, but the problem seems to occur when adding new classes and/or libs, but this bug has been inconsistent and hard to track down… I had a vague sense perhaps related to event callbacks since it seemed to crash when using some guis (ofxControlPanel or ofxSimpleGuiToo) but it seems to crash on some compiles and not others…

(running with both the github OF and latest ofxKinect…)

anyone else experienced this?


i haven’t experienced this yet. if you post a minimal code example i can take a look though.

ok, this seems to crash pretty regularly for me:



sorry, forgot to ask: which version of OF are you using? OF 0062 or github?

this is running fine for me, for at least 5 minutes.

are you running on a slower computer, like an older mac, a 13", or a mac mini?

something you might try, if you’re running an older computer, is to make this change:


this has caused problems for me on slower computers before. it’s been merged into the experimental branch but not into master yet.

Sorry to bring that old topic up, but this problem still persist, even in the latest version of ofxKinect.

When I include for example ofxOpenCv, when trying to use the IR image, I got the same EXC_BAD_ACCESS error in grabRgbFrame().

I tried to modify usb_libusb10.c, but that didn’t change anything for me. I am using Xcode 4.2 on MacBook Pro, which is not really slow.

Anybody got a solution? Thanks.

i’m not really sure what’s going on here. are you having the same issue where it only happens if you add more classes?

Yes, in my case it was the ofxOpenCv.

can you try the absolute latest version of ofxKinect, it was significantly modified in the last two days.

still have the same problem, even with the latest version of ofxKinect…

kamend, this is a very hard problem to solve remotely, but i’d like to help.

one thing i can imagine that there is some kind usb error that is stalling libfreenect and exposing a threading bug.

if you can do two things, i’ll try to help:

1 post your hardware specs (what mbp model you’re using)
2 post the simplest example code that very consistently crashes for you

i’ll run the example code and see if i can get the crash.

Good news, the latest version of ofxKinect does not have that bug, so all I can say… Good Work! :slight_smile: