Hi,

Kaustuv Chaudhuri mentionned a few things about this issue on IRC.

First, one thing I had forgotten in my previous email: I've tried making
the functions usual ocaml-callable C functions (with
CAML{param,local,return}*) but that didn't change anything. The
segfaults still occurs in the exact same place.

I've also removed the intermediate function. It generates ten times more
C code but removing the indirection should reduce the number of possible
issues. However the issue still happens at the same place.

Finally, by printing the addresses of the entry functions, we got the
following output:
  [...]
  (* this is GtkMain disabling auto-compaction *)
  New max overhead: 1000000%
  [...]

  Initialiazing OgtkFileProps through 0x50d170.
  Done initialiazing OgtkFileProps through 0x50d3bc.
  23.016000 microseconds spent initializing OgtkFileProps.

  Initialiazing GContainer through 0x50e8b0.
  Done initialiazing GContainer through 0x1.
  483.846000 microseconds spent initializing GContainer.

  Initialiazing GPack through 0x511fa0.
  Done initialiazing GPack through 0x1.
  1931.545000 microseconds spent initializing GPack.

  Initialiazing GButton through 0x5165c0.
  <
  Program received signal SIGSEGV, Segmentation fault.
  0x0000000000581176 in caml_oldify_local_roots ()

I don't really understand why (and, to be honest, how) the function
pointer would change but maybe there's something I don't fully know with
function pointers and printf's %p format.

I've put a new file online with the aforementionned changes:
  http://notk.org/~adrien/link2.ml

Any input is particularly appreciated. :-)

By the way, a few reasons I've started this: startup speed, potential
very slow initializations for which there was no instrumentation,
detecting useless code that impacts runtime, and the fact that I want to
make an application "not get start slower" but I had no hard numbers on
how how fast it currently starts.

-- 
Adrien Nader

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to