From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 76F757EC6E for ; Thu, 19 Dec 2013 10:07:39 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of jdimino@janestreet.com) identity=pra; client-ip=38.105.200.229; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jdimino@janestreet.com"; x-sender="jdimino@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of jdimino@janestreet.com designates 38.105.200.229 as permitted sender) identity=mailfrom; client-ip=38.105.200.229; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jdimino@janestreet.com"; x-sender="jdimino@janestreet.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@tot-dmz-mxout1.janestreet.com) identity=helo; client-ip=38.105.200.229; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jdimino@janestreet.com"; x-sender="postmaster@tot-dmz-mxout1.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsBABy2slImacjlnGdsb2JhbABZg0NVsEmIX4EMHg4BAQEBAQYWCTyCJQEBAQMBJxkBATcBDwsEBwM4IhIBBQEcBhOHfAgDAqRmixGEUgEFlUoRBo8SB4Q2mBqBMI53GCmEVw X-IPAS-Result: AvsBABy2slImacjlnGdsb2JhbABZg0NVsEmIX4EMHg4BAQEBAQYWCTyCJQEBAQMBJxkBATcBDwsEBwM4IhIBBQEcBhOHfAgDAqRmixGEUgEFlUoRBo8SB4Q2mBqBMI53GCmEVw X-IronPort-AV: E=Sophos;i="4.95,512,1384297200"; d="scan'208";a="49665634" Received: from mx5.janestreet.com (HELO tot-dmz-mxout1.janestreet.com) ([38.105.200.229]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 Dec 2013 10:07:38 +0100 Received: from tot-oib-smtp1.delacy.com ([172.27.22.15] helo=tot-smtp) by tot-dmz-mxout1.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1VtZZx-0004xC-HB for caml-list@inria.fr; Thu, 19 Dec 2013 04:07:37 -0500 Received: from tot-dmz-mxgoog1.delacy.com ([172.27.224.14] helo=mxgoog2.janestreet.com) by tot-smtp with esmtps (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1VtZZx-0005us-Fq for caml-list@inria.fr; Thu, 19 Dec 2013 04:07:37 -0500 Received: from mail-wi0-f176.google.com ([209.85.212.176]) by mxgoog2.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1VtZZx-0005o0-Am for caml-list@inria.fr; Thu, 19 Dec 2013 04:07:37 -0500 Received: by mail-wi0-f176.google.com with SMTP id hq4so6518245wib.9 for ; Thu, 19 Dec 2013 01:07:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=LWYW8CgE+6s8BbJO2Nwgn46PX+BJNtU+ybfcSI89tpg=; b=sf5a0Z2U/v+LdJgT/QeXtR/h3SYhDJAuhhh2T2MeQOrXKHMdGwetMZRfcEAQ6NMt3z Ct9dY04ahMiwStAvWvm5uNL79/+d8n6X5jvhHjMbM2ZLumfCNPsNCkJlq3yyGlflucIg mXAFdtNYeIkDGT8SITmjqneBIsarigwDtAgqA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=LWYW8CgE+6s8BbJO2Nwgn46PX+BJNtU+ybfcSI89tpg=; b=Y4StCzmdCVxyxE1l4H20MQXLzEoDn3P4FayoMC+gOpeXiU+5zzMTyG2v9ncDqrIwpZ sQrQ6urUBCsMWX6ZxvH6mwtgMyRXZrHYBV4aI0nNpOVcFF3eM/KtqYyb5e0NLSlXmvbG JYn08CBrYNAIYcOACEmGGJBxGNhZXbPvcjnAvQCCtBqLyy83JAZrTT1GRYBxqkOrPL2N y4K0uIe19AxN6QWZlKRl5XBN2B9rT84OBGJYH5Z11OrCB0JkW7E91YyPP0BB52Do5/j0 /k6I4HHckFSoo4uObbGGHL2f4vbfx9Fid4MkzFqWqK0lR8JwbCusKqmNzj+2HNI5EIyY 2fcw== X-Gm-Message-State: ALoCoQleIGxNf5msTK5+jRUutthbEcT377NX+rGDk+B/t09aLfs8gNcBuBXpyvT0n7N1Onbspef7vUoGJltPqkg8hxDMo7KOiCdEtBD1z3b1lC48v9Bk+HB7zshAjg3zhwU84DhJ8F4nfiv5BaD8vs22j80JOymkFw== X-Received: by 10.180.19.201 with SMTP id h9mr1704302wie.36.1387444056731; Thu, 19 Dec 2013 01:07:36 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.180.19.201 with SMTP id h9mr1704296wie.36.1387444056603; Thu, 19 Dec 2013 01:07:36 -0800 (PST) Received: by 10.194.47.141 with HTTP; Thu, 19 Dec 2013 01:07:36 -0800 (PST) In-Reply-To: <874n661y5e.fsf@golf.niidar.ru> References: <874n661y5e.fsf@golf.niidar.ru> Date: Thu, 19 Dec 2013 09:07:36 +0000 Message-ID: From: Jeremie Dimino To: Ivan Gotovchits Cc: "caml-list@inria.fr" Content-Type: multipart/alternative; boundary=bcaec53f37e323d74904eddf7e95 Subject: Re: [Caml-list] Core breaks backtraces --bcaec53f37e323d74904eddf7e95 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Dec 18, 2013 at 6:17 AM, Ivan Gotovchits 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). --bcaec53f37e323d74904eddf7e95 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Wed, Dec 18, 2013 at 6:17 AM, Ivan Gotovchits <ivg@iee= e.org> wrote:

Hi,

I've tried a fabulous core library and it broke my exceptions :)
All backtraces are now look like this

=A0 backtrace:
=A0 Raised at file "map.ml= ", line 117, characters 16-25
=A0 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:

=A0 let () =3D
=A0= =A0 Printexc.register_printer (fun exc ->
=A0 =A0 =A0 match s= exp_of_exn_opt exc with
=A0 =A0 =A0 | None -> None
= =A0 =A0 =A0 | Some sexp ->
=A0 =A0 =A0 =A0 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:

=A0 match try Some (Addrs.find addr !exn_addr_map) wit= h Not_found -> None with

Where Addrs is a Map.Make(_).

So = for any exception that is not registered with sexplib, Addrs.find will rais= e 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&q= uot;. We will work on a fix.

I don't have a precise idea for the sec= ond part of the problem (core eating all memory).

--bcaec53f37e323d74904eddf7e95--