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).