caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Strangeness with atexit and exception backtraces
@ 2010-03-12 15:00 Michael Ekstrand
  0 siblings, 0 replies; only message in thread
From: Michael Ekstrand @ 2010-03-12 15:00 UTC (permalink / raw)
  To: caml-list

I have been using the Bolt logging library[1] lately in my code, but
have encountered a difficulty with debugging programs.  Bolt uses an
atexit handler to close all open log files when the program shuts down.
 However, if an uncought exception is encountered with this atexit
handler in place, the program terminates with status 2 but neither the
exception value nor its backtrace (with OCAMLRUNPARAM=b) are printed.

If I disable the atexit handler, the error information is printed as I
expect.

I am currently working around this by modifying Bolt so that the atexit
handler is disabled if OCaml starts up with stack traces enabled.  I am
wondering, though, if this is a known bug (or limitation)?  Is there
another workaround, or a fix on the horizon?  Or should I go file the
appropriate report in the OCaml bugtracker?

Thanks,
- Michael


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-12 15:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-12 15:00 Strangeness with atexit and exception backtraces Michael Ekstrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).