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 RAA19580; Tue, 28 Oct 2003 17:11:57 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA23805 for ; Tue, 28 Oct 2003 17:11:56 +0100 (MET) Received: from nef.ens.fr (nef.ens.fr [129.199.96.32]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h9SGBt118457 for ; Tue, 28 Oct 2003 17:11:55 +0100 (MET) Received: from fistandantilus.takhisis.org (dhcp184.dmi.ens.fr [129.199.97.184]) by nef.ens.fr (8.12.10/1.01.28121999) with ESMTP id h9SGBtcp000391 for ; Tue, 28 Oct 2003 17:11:55 +0100 (CET) Received: by fistandantilus.takhisis.org (Postfix, from userid 3148) id 1DBFE27411D; Tue, 28 Oct 2003 17:11:55 +0100 (CET) Date: Tue, 28 Oct 2003 17:11:55 +0100 From: Stefano Zacchiroli To: caml-list@inria.fr Subject: Re: [Caml-list] Segmentation Fault on #load Message-ID: <20031028161155.GA4081@fistandantilus.takhisis.org> Mail-Followup-To: caml-list@inria.fr References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Loop: caml-list@inria.fr X-Spam: no; 0.00; bononia:01 caml-list:01 dumped:01 segfaults:01 segfault:01 segfault:01 bug:01 bononia:01 cmo:01 cmo:01 ocaml:01 ocaml:01 bytecode:01 toplevel:01 toplevel:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, Oct 28, 2003 at 04:47:04PM +0100, Beck01, Wolfgang wrote: > > # #load pretty.cmo;; > > Segmentation fault (core dumped) > > Loading object files into the ocaml toplevel is not a good idea. > It's like loading pretty.cmo in your text editor (which looks > not pretty). > > If you have the source code of pretty.cmo, load it (#load "pretty.mL"). You're confusing two toplevel directive: #use and #load. The first one is the one you should use in your example: #use "pretty.ml" and interpret a source file in the same way as it would have been interpreted while typing it. The second one, correctly used in the first post asking for help, loads a bytecode object in the toplevel using ocaml dynamic loading. Regarding the reason of segfaults, it can be caused by many factors ... First of all: do you get the same segfault linking your code in an executable and executing it? If the behaviour is the same then it can be one of the usual three reasons that cause an ocaml program to segfault: use of external segfaulting C code, incorrect use of an Obj.magic, a bug. I think you need to give us more information to get an appreciable help ... Cheers. -- Stefano Zacchiroli -- Master in Computer Science @ Uni. Bologna, Italy zack@{cs.unibo.it,debian.org,bononia.it} - http://www.bononia.it/zack/ " I know you believe you understood what you think I said, but I am not sure you realize that what you heard is not what I meant! " -- G.Romney ------------------- 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