Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Dawid Toton <d0@wp.pl>
To: caml-list@yquem.inria.fr
Subject: Broken dumps from memprof patch?
Date: Mon, 08 Jun 2009 20:09:20 +0200	[thread overview]
Message-ID: <4A2D53D0.2070108@wp.pl> (raw)

I have compiled MinGW port of the comopiler (3.10) with memprof patch 
applied.
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 "shell.ml", 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 (thread.ml 
to thread_posix.ml). 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/hPLoadHeap.ml", 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 "pervasives.ml", line 302, characters 15-26
Called from file "hp/hPLoadHeap.ml", line 118, characters 4-30
Called from file "hp/hPLoadHeap.ml", line 121, characters 14-21
Called from file "hp/hPLoadHeap.ml", line 173, characters 18-43
Called from file "hp/hPMain.ml", line 20, characters 16-38
Called from file "arg.ml", line 146, characters 12-33
Called from file "arg.ml", line 197, characters 8-27
Called from file "arg.ml", line 211, characters 4-32
Called from file "hp/hPMain.ml", line 10, characters 2-1023

Any ideas?

Dawid


                 reply	other threads:[~2009-06-08 18:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A2D53D0.2070108@wp.pl \
    --to=d0@wp.pl \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox