From: Jeremie Dimino <jdimino@janestreet.com>
To: Ivan Gotovchits <ivg@ieee.org>
Cc: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] Core breaks backtraces
Date: Thu, 19 Dec 2013 09:07:36 +0000 [thread overview]
Message-ID: <CANhEzE5zHPnUq+G9RGsnH66SymWBwWnu4t9zf=O-VZhfQz=ORg@mail.gmail.com> (raw)
In-Reply-To: <874n661y5e.fsf@golf.niidar.ru>
[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]
On Wed, Dec 18, 2013 at 6:17 AM, Ivan Gotovchits <ivg@ieee.org> wrote:
>
> Hi,
>
> I've tried a fabulous core library and it broke my exceptions :)
> All backtraces are now look like this
>
> backtrace:
> Raised at file "map.ml", line 117, characters 16-25
> Called from file "lib/conv.ml", line 256, characters 19-50
>
This is from sexplib. The Exn module in Core_kernel registers an exception
printer which looks like this:
let () =
Printexc.register_printer (fun exc ->
match sexp_of_exn_opt exc with
| None -> None
| Some sexp ->
Some (Sexp.to_string_hum ~indent:2 sexp))
Now, if we look at what sexp_of_exn_opt is doing, in sexplib/lib/conv.ml,
line 256:
match try Some (Addrs.find addr !exn_addr_map) with Not_found -> None with
Where Addrs is a Map.Make(_).
So for any exception that is not registered with sexplib, Addrs.find will
raise Not_found. And since there is one global backtrace buffer, the
backtrace gets replaced by this one. I guess we never had this problem
because we don't use exception much and the few we have are defined "with
sexp". We will work on a fix.
I don't have a precise idea for the second part of the problem (core eating
all memory).
[-- Attachment #2: Type: text/html, Size: 2134 bytes --]
prev parent reply other threads:[~2013-12-19 9:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-18 6:17 Ivan Gotovchits
2013-12-18 11:44 ` Mark Shinwell
2013-12-18 12:01 ` Yaron Minsky
2013-12-19 4:00 ` Ivan Gotovchits
2013-12-19 9:07 ` Jeremie Dimino [this message]
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='CANhEzE5zHPnUq+G9RGsnH66SymWBwWnu4t9zf=O-VZhfQz=ORg@mail.gmail.com' \
--to=jdimino@janestreet.com \
--cc=caml-list@inria.fr \
--cc=ivg@ieee.org \
/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