English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2008-09-03 (21:56)
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).


Stéphane Glondu