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


_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to