From: Ashish Agarwal <agarwal1975@gmail.com>
To: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
Cc: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] printing an exception changes printed backtrace
Date: Fri, 14 Jan 2011 17:05:44 -0500 [thread overview]
Message-ID: <AANLkTin5qTWjPv4s+EEKTaT-76xtuEyF58w=gdnae0+t@mail.gmail.com> (raw)
In-Reply-To: <AANLkTim_yMS_A51-5RV-pniBoF9DU3otTh0u3BWBwKfS@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 952 bytes --]
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
<daniel.buenzli@erratique.ch>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.
>
[-- Attachment #2: Type: text/html, Size: 1273 bytes --]
next prev parent reply other threads:[~2011-01-14 22:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-14 21:15 Ashish Agarwal
2011-01-14 21:59 ` Daniel Bünzli
2011-01-14 22:05 ` Ashish Agarwal [this message]
2011-01-17 15:37 ` xclerc
2011-01-17 16:41 ` Ashish Agarwal
2011-01-17 17:02 ` Xavier Clerc
2011-01-17 17:12 ` Ashish Agarwal
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='AANLkTin5qTWjPv4s+EEKTaT-76xtuEyF58w=gdnae0+t@mail.gmail.com' \
--to=agarwal1975@gmail.com \
--cc=caml-list@inria.fr \
--cc=daniel.buenzli@erratique.ch \
/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