profiling or logging to get better understanding of reasons for crash?

Hi there, I have a question concerning a crash that my app has sometimes. I’m using the Kinect and I’m suspecting the crash becomes more likely as more different users start using the system (I’m using skeleton tracking with OpenNI). However, I’m not sure and would like to have a more meaningful way of ascertaining the problem than hours of observation.

I know of - but am not well-versed in - profiling an app to gain insight into memory usage, system load etc. On OSX with XCode I’ve found Shark to do something like that. Yet I don’t know if this will really help me.
So my question is: what kind of solutions do you use to get a grip on what your system’s doing during runtime? Also: what would you recommend I do/use to get qualitative data on why my application crashes when it does?

PS (FYI): I’m running OSX 10.6.8, on a 2010 macbook pro, oF .007 and using a fairly recent ofxOpenNI with the following drivers: OpenNI unstable, NITE , SensorKinect (Avin)

on the one hand, look at ofLog, and sprinkle meaningful debug messages throughout your program to see where it fails.
on the other hand, try to reproduce the error as reliably as possible, and use your favorite debugger to trace the program flow.

I have an installation running somewhere. It’s still experimental so crashes are still acceptable. The app isn’t running from out of Xcode… that eliminates the option of debugging/tracing, right? Or does ofLog output to a file?

if you’re on OSX you can open up an app called Console which will act just like the Xcode console. alternatively, you can run the app from the command line.

cd bin/  

1 Like

Oooh, that’s great! Thanks! I just checked and if one would want the stuff outputted to the command-line to be saved for later viewing you can do:

./emptyExample >> logfile.txt  

and all will be saved into that (the double ‘>’ will make the stuff be appended instead of overwriting every time you start the application)

you can also tell ofLog to output to a file: