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
[Caml-list] "Error while building custom runtime system"
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-10-15 (16:57)
From: Richard Jones <rich@a...>
Subject: [Caml-list] Initialization order bug
Related to the above issue is another strange bug in initialization order.

I have two libraries called:

	  |	  | uses
	  |	Pl_LWP_UserAgent
	  | uses

But in this scenario, Perl is not initialized before Test starts
running (and hence the program crashes).

If I add a false dependency so that Test uses Pl_LWP_UserAgent, then
everything works (Perl is initialized OK before use).

Unfortunately this bug defies creating a minimal example, but if you


then look at the top of examples/test.ml. Try running with and
without the fake 'let f = Pl_LWP_UserAgent.may' command at the
top of the file.

Without & it segfaults because Perl is never initialized before
being called.

With & it works OK.

The two other example programs already require one or other of the
Pl_* modules, so they work OK.

This is OCaml 3.07 from Debian/unstable.


Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj
Merjis Ltd. http://www.merjis.com/ - all your business data are belong to you.
MONOLITH is an advanced framework for writing web applications in C, easier
than using Perl & Java, much faster and smaller, reusable widget-based arch,
database-backed, discussion, chat, calendaring:

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners