caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: [Caml-list] Segmentation Fault on #load
  2003-10-28 15:47 [Caml-list] Segmentation Fault on #load Beck01, Wolfgang
@ 2003-10-28  9:05 ` David Brown
  2003-10-28 19:37   ` Oleg Trott
  2003-10-28 16:11 ` Stefano Zacchiroli
  1 sibling, 1 reply; 8+ messages in thread
From: David Brown @ 2003-10-28  9:05 UTC (permalink / raw)
  To: Beck01, Wolfgang; +Cc: edahlman, caml-list

On Tue, Oct 28, 2003 at 04:47:04PM +0100, Beck01, Wolfgang wrote:
> 
> You wrote:
> > $ ocaml
> >        Objective Caml version 3.07+2
> >
> > # #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).

No, this is supposed to work.  It should load the bytecode into the
toplevel.

Dave

-------------------
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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Caml-list] Segmentation Fault on #load
@ 2003-10-28 15:47 Beck01, Wolfgang
  2003-10-28  9:05 ` David Brown
  2003-10-28 16:11 ` Stefano Zacchiroli
  0 siblings, 2 replies; 8+ messages in thread
From: Beck01, Wolfgang @ 2003-10-28 15:47 UTC (permalink / raw)
  To: edahlman, caml-list


You wrote:
> $ ocaml
>        Objective Caml version 3.07+2
>
> # #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").
If not, you have to build a toplevel (the 'ocaml' command)
linked to your object file or library. To do this, read the manual page of
ocamlmktop. This program works like ocamlc, but builds a program
that works like the ocaml command. This should be in a FAQ.


Wolfgang

-------------------
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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Segmentation Fault on #load
  2003-10-28 15:47 [Caml-list] Segmentation Fault on #load Beck01, Wolfgang
  2003-10-28  9:05 ` David Brown
@ 2003-10-28 16:11 ` Stefano Zacchiroli
  1 sibling, 0 replies; 8+ messages in thread
From: Stefano Zacchiroli @ 2003-10-28 16:11 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Segmentation Fault on #load
  2003-10-28  9:05 ` David Brown
@ 2003-10-28 19:37   ` Oleg Trott
  0 siblings, 0 replies; 8+ messages in thread
From: Oleg Trott @ 2003-10-28 19:37 UTC (permalink / raw)
  To: David Brown, Beck01, Wolfgang; +Cc: edahlman, caml-list

On Tuesday 28 October 2003 04:05 am, David Brown wrote:
> On Tue, Oct 28, 2003 at 04:47:04PM +0100, Beck01, Wolfgang wrote:
> > You wrote:
> > > $ ocaml
> > >        Objective Caml version 3.07+2
> > >
> > > # #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).
>
> No, this is supposed to work.  It should load the bytecode into the
> toplevel.
>
> Dave

Technically, it's possible for "#load" to cause seg-fault if "pretty" uses
FFI and there is a bug somewhere. Otherwise, there may be a problem
with Eric's copy of OCaml.

-- 
Oleg Trott <oleg_trott@columbia.edu>

-------------------
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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Caml-list] Segmentation Fault on #load
@ 2003-10-29  8:20 Beck01, Wolfgang
  0 siblings, 0 replies; 8+ messages in thread
From: Beck01, Wolfgang @ 2003-10-29  8:20 UTC (permalink / raw)
  To: caml-list; +Cc: caml-list



>> > 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).
> 
> No, this is supposed to work.  It should load the bytecode into the
> toplevel.
> 
> Dave

I didn't know that. It even works with libraries. Nice.


Wolfgang

-------------------
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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Caml-list] Segmentation Fault on #load
  2003-10-28 19:56 Kevin S. Millikin
@ 2003-10-28 21:37 ` Eric Dahlman
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Dahlman @ 2003-10-28 21:37 UTC (permalink / raw)
  To: kmillikin, 'Oleg Trott', 'David Brown',
	'Beck01, Wolfgang'
  Cc: caml-list

Howdy,

At this point I suspect that something was wrong with my version of
OCaml. I changed machines this morning and have reinstalled everything.
I don't believe that I have done anything different but now #load does
not cause a segfault.  I have not had time to test much more than that
to see if there are still some other problems present.  I'll let you
know if something else appears.

-Eric

P.S. The significant difference between the two setups is that the
problematic one was running Windows 2000 Pro and the new one is running
Windows XP.



> -----Original Message-----
> From: owner-caml-list@pauillac.inria.fr [mailto:owner-caml-
> list@pauillac.inria.fr] On Behalf Of Kevin S. Millikin
> Sent: Tuesday, October 28, 2003 1:57 PM
> To: 'Oleg Trott'; David Brown; Beck01, Wolfgang
> Cc: edahlman@atcorp.com; caml-list@inria.fr
> Subject: RE: [Caml-list] Segmentation Fault on #load
> 
> On Tuesday, October 28, 2003 1:38 PM, Oleg Trott
> [SMTP:oleg_trott@columbia.edu] wrote:
> >  Technically, it's possible for "#load" to cause seg-fault if
> "pretty" uses
> >  FFI and there is a bug somewhere. Otherwise, there may be a problem
> >  with Eric's copy of OCaml.
> 
> "pretty" is the pretty printer from George Necula's CIL.  It does not
> contain foreign code, but does call Obj.magic.
> 
> It appears to work for me (Ocaml 3.07 compiled with cygwin), but not
> for Eric (Ocaml 3.07+2, cygwin).
> 
> ----
> Kevin S. Millikin           Architecture Technology Corporation
> Research Scientist          Specialists in Computer Architecture
> (952)829-5864 x162          http://www.atcorp.com
> 
> 
> 
> -------------------
> 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

-------------------
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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [Caml-list] Segmentation Fault on #load
@ 2003-10-28 19:56 Kevin S. Millikin
  2003-10-28 21:37 ` Eric Dahlman
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin S. Millikin @ 2003-10-28 19:56 UTC (permalink / raw)
  To: 'Oleg Trott', David Brown, Beck01, Wolfgang; +Cc: edahlman, caml-list

On Tuesday, October 28, 2003 1:38 PM, Oleg Trott 
[SMTP:oleg_trott@columbia.edu] wrote:
>  Technically, it's possible for "#load" to cause seg-fault if 
"pretty" uses
>  FFI and there is a bug somewhere. Otherwise, there may be a problem
>  with Eric's copy of OCaml.

"pretty" is the pretty printer from George Necula's CIL.  It does not 
contain foreign code, but does call Obj.magic.

It appears to work for me (Ocaml 3.07 compiled with cygwin), but not 
for Eric (Ocaml 3.07+2, cygwin).

----
Kevin S. Millikin           Architecture Technology Corporation
Research Scientist          Specialists in Computer Architecture
(952)829-5864 x162          http://www.atcorp.com



-------------------
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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Caml-list] Segmentation Fault on #load
@ 2003-10-27 19:23 Eric Dahlman
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Dahlman @ 2003-10-27 19:23 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 703 bytes --]

Hello,

 

I am a new ocaml user and I am having problems trying to get it to load
compiled code into the top level.  Specifically if I try to load a .cmo
or .cma file I get a segmentation violation.  This is under cygwin and
here is an example 

 

$ ocaml

        Objective Caml version 3.07+2

 

# #load pretty.cmo;;

Segmentation fault (core dumped)

 

I have been trying to track this down but have not been having too much
luck.  What could be going wrong and what should I be looking for either
as a potential source of problems or as a solution.  I was hoping to be
able to get a bit more information on what is going wrong but alas I
also could not figure out how to.

 

Thanks,

 

-Eric


[-- Attachment #2: Type: text/html, Size: 24771 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-10-29  8:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-28 15:47 [Caml-list] Segmentation Fault on #load Beck01, Wolfgang
2003-10-28  9:05 ` David Brown
2003-10-28 19:37   ` Oleg Trott
2003-10-28 16:11 ` Stefano Zacchiroli
  -- strict thread matches above, loose matches on Subject: below --
2003-10-29  8:20 Beck01, Wolfgang
2003-10-28 19:56 Kevin S. Millikin
2003-10-28 21:37 ` Eric Dahlman
2003-10-27 19:23 Eric Dahlman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).