Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] ocamlc -output-obj problems
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jonathan Roewen <jonathan.roewen@g...>
Subject: Re: [Caml-list] ocamlc -output-obj problems
> I should also note: commenting out the printf declaration, it runs fine.
>

Used gdb to trace where it's dying. It's in caml_copy_string().

Here's stacktrace:

(gdb) run
Starting program: /home/jonathan/kernel/kernel.elf

Program received signal SIGSEGV, Segmentation fault.
0x0804b48d in caml_copy_string ()
(gdb) bt
#0  0x0804b48d in caml_copy_string ()
#1  0x0804b54f in caml_alloc_array ()
#2  0x0804b595 in caml_copy_string_array ()
#3  0x08052cfb in caml_sys_get_argv ()
#4  0x080593b2 in caml_interprete ()
#5  0x0804a527 in caml_startup_code ()
#6  0x0804992b in caml_startup ()
#7  0x080498c6 in c_start ()
#8  0x080498ab in main ()

It makes no difference what I set argv to that I pass in. NULL makes
it die in caml_alloc_array(). { 0 } doesn't work, { "" } doesn't, nor
does { "", 0 }, nor does something arbitrary like { "hello", "world"
[, 0] }.

IMO, it sounds like ocamlc -output-obj is doing something funky it
shouldn't (I'm using 3.09.0 btw).

Commenting out the printf assignment thing, it runs fine .. so I'm
very, very suspicious of the compiler at this stage.

Jonathan