caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Michael Ekstrand <michael@elehack.net>
To: caml-list@inria.fr
Subject: Strangeness with atexit and exception backtraces
Date: Fri, 12 Mar 2010 09:00:31 -0600	[thread overview]
Message-ID: <hndkum$2ep$1@dough.gmane.org> (raw)

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


                 reply	other threads:[~2010-03-12 15:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='hndkum$2ep$1@dough.gmane.org' \
    --to=michael@elehack.net \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).