[MacRuby-devel] How to debug MacRuby crashes?

Marc Abramowitz msabramo at gmail.com
Wed Feb 1 13:09:58 PST 2012


I've discovered that it's not difficult to make MacRuby crash by doing
things that it doesn't like. Unfortunately, I'm a MacRuby novice and I'm
making a lot of mistakes and I don't always know what they are and it seems
difficult to figure out from the crash messages.

For instance, right now I'm running my app from Xcode and every once and a
while I get an intermittent (probably a concurrency-related bug involving
run loops, timers, and the like) crash:

*Assertion failed: ((size_t)pos < current_exceptions.size()), function
pop_current_exception, file vm.cpp, line 3596.*

>From a little big of digging around, I gather that this is probably coming
from:

RoxorVM*::*pop_current_exception

https://github.com/MacRuby/MacRuby/blob/master/vm.cpp#L3600

This happens in the app's main thread in the com.apple.main-thread (serial)
queue. My app is running in thread 3.

I still don't know what that means though :-) Perhaps my code triggered
some kind of exceptional condition?

There is very little info in Xcode. Lots of warnings about missing debug
information -- e.g.:

warning: Could not find object file
"/Users/lrz/src/macruby-master/ext/json/parser/parser.o" - no debug
information available for "parser.c".

...

I'm on OS X 10.6.8 and I believe that my app is running with the MacRuby
0.11 release from
https://github.com/downloads/MacRuby/MacRuby/MacRuby%200.11.zip (BTW, is
this a "blessed" release? I noticed that GitHub has this 0.11 version, but
macruby.org still lists 0.10 as the current version).

$ macruby -v

MacRuby 0.11 (ruby 1.9.2) [universal-darwin10.0, x86_64]

I imagine that I might be able to eliminate these by compiling MacRuby (and
LLVM) from source? Is this likely to help? Will this give me clues about
what I did wrong in my Ruby code? Or is there some other way to diagnose
what's wrong? Perhaps a .dSYM file would help?

Thanks,

Marc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20120201/194f7a76/attachment.html>


More information about the MacRuby-devel mailing list