English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Assertion failure in ocamlrund
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-05-27 (19:31)
From: Sami Liedes <sliedes@c...>
Subject: Assertion failure in ocamlrund

After having ocamlrun segfault on my program (only when running with
OCAMLRUNPARAM=b, without b it reports an uncaught Not_found exception)
I compiled the debugging version of it, and this is what I get:

file freelist.c; line 123 ### Assertion failed: wo_sz >= 1

Here's a backtrace:

#0  caml_failed_assert (expr=0x806f000 "wo_sz >= 1", file=0x806ee80 "freelist.c", line=123) at misc.c:25
#1  0x08067b24 in caml_fl_allocate (wo_sz=0) at freelist.c:123
#2  0x080504d3 in caml_alloc_shr (wosize=0, tag=1) at memory.c:261
#3  0x0806955a in caml_oldify_one (v=134801368, p=0xb798ebf0) at minor_gc.c:94
#4  0x0806997a in caml_oldify_mopup () at minor_gc.c:171
#5  0x08069a17 in caml_empty_minor_heap () at minor_gc.c:193
#6  0x08069ae8 in caml_minor_collection () at minor_gc.c:222
#7  0x08055b4e in caml_array_unsafe_get_float (array=-1210587644, index=17) at array.c:92
#8  0x08055bc5 in caml_array_unsafe_get (array=-1210587644, index=17) at array.c:102
#9  0x0806592b in caml_interprete (prog=0xb7df9008, prog_size=149264) at interp.c:874
#10 0x080676b3 in caml_main (argv=0xbffff754) at startup.c:404
#11 0x0804fe7f in main (argc=2, argv=0xbffff754) at main.c:35

I have put the backtrace with values of all locals (ie. gdb "bt full"
output) at


for your convenience.

Although this happens randomly, it does happen often enough so I can
reproduce it. So please ask me for more debugging information such as
contents of some heap variables if you feel it might be useful.

Lastly, here's a snippet of ocamlrund output before the crash (from a
different run). From it seems something in the bytecode program gets
crazy. There's nothing in it that should start to allocate memory like
that; it would be nice to get a backtrace though to diagnose the
problem, but I can't get it with either OCAMLRUNPARAM=b or with
ocamldebug, which seems to be confused by vmthreads or something in
the very beginning of the bytecode program[1].

### O'Caml runtime: heap check ###
!Growing heap to 480k bytes
<>$<>$Starting new major GC cycle
### O'Caml runtime: heap check ###
Compacting heap...
### O'Caml runtime: heap check ###
Shrinking heap to 240k bytes
<>Starting new major GC cycle
### O'Caml runtime: heap check ###
!<Growing heap to 2300k bytes
Growing page table to 738 entries
Growing heap to 2540k bytes
Growing page table to 800 entries
Growing heap to 8776k bytes
Growing page table to 2361 entries
Growing heap to 20544k bytes
Growing page table to 5305 entries
file freelist.c; line 123 ### Assertion failed: wo_sz >= 1


[1] shortly after "run" ocamldebug just breaks into the prompt without
    any message at all, which I find confusing, but that's already
    another story