Ffi segfaults

What’s the best way to debug a segfault with ffi? It it not caught by
java so no log file. The code instantiates a Tamarin actionscript
virtual machine. I have the exact same code I compiled into an binary
and a shared library. Running the binary works. calling main() via
the ffi will throw a segfault under certain conditions. The
actionscript code has a main loop it goes through about 50 times. If
I run that loop pretty much forever, it gets to a few hundred and
segfaults. Whether the code keeps looping is dependent on data I feed
it.

I guess I could make the code sleep for a minute or so when it first
starts, long enough to attach gdb to the process and debug it that
way. But while my shared library is compiled with debugging symbols,
I’m not sure that really helps as I’m pretty sure that’s not where the
problem is. My code is just a thin wrapper around the Tamarin VM.

Any suggestions?

Chris

Forgot to include some relevant info…

Jruby 1.6.0 RC2
ffi 1.0.6
ubuntu 10 LTS X64

Chris

backtrace, reproducible script?