Version française
Home     About     Download     Resources     Contact us    
Browse thread
RE: [Caml-list] Segmentation Fault on #load
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Stefano Zacchiroli <zack@b...>
Subject: Re: [Caml-list] Segmentation Fault on #load
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