Version française
Home     About     Download     Resources     Contact us    
Browse thread
toplevel not executed: Bug ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Stéphane Glondu <steph@g...>
Subject: Re: [Caml-list] toplevel not executed: Bug ?
Romain Beauxis wrote:
> I've encountered a strange bug while preparing a caml module with C function. 
> Depending on the execution of a caml-defined function, the toplevel is 
> evaluated or not, leading to a segfault when calling a caml callback from 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,

-- 
Stéphane Glondu