Thanks for the workaround; that resolves the issue for me. But this seems very unstable. On Fri, Jan 14, 2011 at 4:59 PM, Daniel Bünzli wrote: > > So it appears that printing an exception changes the backtrace. Is that > > possible? > > I don't know about the details of backtrace recording but I suspect > that the call to the printing function interferes with the previously > recorded backtrace. > > What works for me is to immediately get the backtrace as a string [1] > with Printexc.get_backtrace (), then print the exception and then > print the string. > > Also bear in mind that sometimes native backtrace are not as precise > as those in bytecode (tail calls and optimizations ?). > > Daniel > > [1] > Btw. the api could really have given us a list of strings (or even of > string * string * int * (int * int)). I already had to parse that > string to properly format backtraces. >