From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id B0057BBAF for ; Wed, 3 Sep 2008 23:56:36 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuYBAAylvkjAXQIniGdsb2JhbACSUQEBAQ8gpUmBZw X-IronPort-AV: E=Sophos;i="4.32,320,1217800800"; d="scan'208";a="14544325" Received: from concorde.inria.fr ([192.93.2.39]) by mail2-smtp-roc.national.inria.fr with ESMTP; 03 Sep 2008 23:56:36 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m83LuaPh017332 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 3 Sep 2008 23:56:36 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhsGANCkvkiK54gDWGdsb2JhbACSRwEbIaVIgWc X-IronPort-AV: E=Sophos;i="4.32,320,1217800800"; d="scan'208";a="16554221" Received: from rouge.crans.org ([138.231.136.3]) by mail3-smtp-sop.national.inria.fr with ESMTP; 03 Sep 2008 23:56:35 +0200 Received: from localhost (localhost.crans.org [127.0.0.1]) by rouge.crans.org (Postfix) with ESMTP id 3DCF782EC; Wed, 3 Sep 2008 23:56:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at crans.org Received: from rouge.crans.org ([10.231.136.3]) by localhost (rouge.crans.org [10.231.136.3]) (amavisd-new, port 10024) with LMTP id WmOyn+l0rGZW; Wed, 3 Sep 2008 23:56:35 +0200 (CEST) Received: from [88.185.141.188] (korell.glondu.net [88.185.141.188]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by rouge.crans.org (Postfix) with ESMTP id CF4E4837E; Wed, 3 Sep 2008 23:56:34 +0200 (CEST) Message-ID: <48BF080D.7070600@glondu.net> Date: Wed, 03 Sep 2008 23:56:29 +0200 From: =?UTF-8?B?U3TDqXBoYW5lIEdsb25kdQ==?= User-Agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: Romain Beauxis Cc: caml-list@inria.fr, smimram@debian.org Subject: Re: [Caml-list] toplevel not executed: Bug ? References: <200809031808.55821.toots@rastageeks.org> In-Reply-To: <200809031808.55821.toots@rastageeks.org> X-Enigmail-Version: 0.95.0 OpenPGP: id=FCE03DAA Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Miltered: at concorde with ID 48BF0814.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; toplevel:01 bug:01 bug:01 toplevel:01 segfault:01 -linkall:01 segfault:01 mli:01 abstracted:01 -linkall:01 phane:98 steph:98 phane:98 wrote:01 caml-list:01 Romain Beauxis wrote: > I've encountered a strange bug while preparing a caml module with C fun= ction.=20 > Depending on the execution of a caml-defined function, the toplevel is = > evaluated or not, leading to a segfault when calling a caml callback fr= om C. > [...] I don't know whether this is a bug, but I have an explanation. At linking phase, module Test is not linked in because it is not used. When you use "-linkall", the segfault disappear. Module Test is considered unused because the inferred interface for module Test records that f is an external. You can force the usage of module Test by providing your own .mli, where f is abstracted. When you do so, the segfault disappear (even without -linkall). HTH, --=20 St=C3=A9phane Glondu