How to get useful backtraces?

Addendum: I’m using Unix.fork () and the exception is thrown in the child process. I think this may be the cause for the bad backtrace.