Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2003-10-28 (16:11)
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 "" 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

I think you need to give us more information to get an appreciable help


Stefano Zacchiroli  --  Master in Computer Science @ Uni. Bologna, Italy
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 Archives:
Bug reports: FAQ:
Beginner's list: