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
Broken dumps from memprof patch?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dawid Toton <d0@w...>
Subject: Broken dumps from memprof patch?
I have compiled MinGW port of the comopiler (3.10) with memprof patch 
I can produce heap dumps, but heapstats tool fails to load it.

I had to change major_gc.c, the line:
#include <unistd.h>
is replaced by a stub:
int getpid() {return 8;}

I had to tag all files in hp dir as precious (using hp/_tags file).

Surprisingly I get no linking error with boot/stdlib.cma when doing the 
first step:
make -f Makefile.nt world

Gc.dump_heap successfully created a file while running bytecode.
I had to remove labltk from OTHERLIBRARIES (in config/Makefile), 
otherwise bootstrap step results in:

File "", line 78, characters 15-27:
Unbound value Mutex.create

I got three executables: heapstats.exe, heapstats.opt and hp2ps.exe in 
root dir of the sources. 'make -f Makefile.nt install installopt' didn't 
install them.

At first, threads.cmxa and friends were not built, because my make 
(using normal Cygwin) was unable to resolve a symbolic link ( 
to I made a copy instead and it compiled.

Trying to run heapstats on a fresh dump file (from toplevel loop) 
results in (the first line is my debug output):

globals_map length = 469785344
Fatal error: exception Invalid_argument("String.create")
Raised at file "hp/", line 88, characters 20-37

The file is 320kB only, it can't contain 470MB of globals_map.
Should I assume that bytecode produces broken heap dumps?

Loading of a dump produced from native code went further:

$ heapstats.opt -heap heap.dump.8.0
globals_map length = 115
info list element length = 1721
info list element length = 193024
Fatal error: exception End_of_file
Raised at file "", line 302, characters 15-26
Called from file "hp/", line 118, characters 4-30
Called from file "hp/", line 121, characters 14-21
Called from file "hp/", line 173, characters 18-43
Called from file "hp/", line 20, characters 16-38
Called from file "", line 146, characters 12-33
Called from file "", line 197, characters 8-27
Called from file "", line 211, characters 4-32
Called from file "hp/", line 10, characters 2-1023

Any ideas?