From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA10354; Wed, 15 Oct 2003 18:57:25 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA03485 for ; Wed, 15 Oct 2003 18:57:24 +0200 (MET DST) Received: from aomori.annexia.org (annexia.force9.co.uk [212.56.101.183]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h9FGvN120844 for ; Wed, 15 Oct 2003 18:57:23 +0200 (MET DST) Received: from rich by aomori.annexia.org with local (Exim 3.36 #1 (Debian)) id 1A9oxf-0006n6-00 for ; Wed, 15 Oct 2003 17:57:23 +0100 Date: Wed, 15 Oct 2003 17:57:23 +0100 To: caml-list@inria.fr Subject: [Caml-list] Initialization order bug Message-ID: <20031015165723.GA26016@redhat.com> References: <20031015093613.GA21312@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031015093613.GA21312@redhat.com> User-Agent: Mutt/1.5.4i From: Richard Jones X-Loop: caml-list@inria.fr X-Spam: no; 0.00; bug:01 bug:01 lwp:01 useragent:99 initialized:01 crashes:01 lwp:01 useragent:99 initialized:01 caml-:01 'let:01 segfaults:01 3.07:01 freshmeat:01 ltd:98 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Related to the above issue is another strange bug in initialization order. I have two libraries called: Perl ^ |-------\ | | uses | Pl_LWP_UserAgent | | uses | Test 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 download: http://www.annexia.org/tmp/perl4caml-0.3.2.tar.gz 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. Rich. -- 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: http://www.annexia.org/freeware/monolith/ ------------------- 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