caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Damien Doligez <damien.doligez@inria.fr>
To: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Tips to find the cause of a seg fault
Date: Fri, 3 Dec 2010 16:43:42 +0100	[thread overview]
Message-ID: <3474B264-1D16-4740-B935-995B6B38F0CE@inria.fr> (raw)
In-Reply-To: <1182061596.483210.1291158525016.JavaMail.root@zmbs1.inria.fr>


On 2010-12-01, at 00:08, Philippe Veber wrote:

> Short story (details below): I'm currently writing a program relying on react, lablgl and ocamlsdl. This program segfaults on my laptop under two linux distributions (ubuntu and gentoo) but doesn't on a PC under ubuntu. The seg fault occurs with both bytecode and native executables. I don't do any marshaling nor use any typing magic; stack overflow is not likely. I humbly ask this list about means to improve valgrind or gdb outputs, which don't report informative function names, or more generally, any tip that could help me to locate the origin of the problem.

You should try to compile the OCaml runtime in debug mode: just "make ocamlrund"
in the ...ocaml/bytecode directory, then run your program with ocamlrund.

> Many thanks for the clarification. Maybe I could (partially) "unplug" the GC by setting space_overhead to 100 ? That could give an indication on the moment the problem occurs ?

The default space_overhead is already 80.  If you want the major GC
to run very slowly, set the overhead to 1000 or 10000.  But usually
you want to do the opposite, so that the crash happens soon after the
execution of the buggy code.  You can try to pepper your code with
calls to Gc.compact, for example.  In your case, I would call it just
before the pattern matching that crashes mysteriously.

-- Damien


       reply	other threads:[~2010-12-03 15:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1182061596.483210.1291158525016.JavaMail.root@zmbs1.inria.fr>
2010-12-03 15:43 ` Damien Doligez [this message]
2010-12-05 14:50   ` Philippe Veber
2010-11-30 23:08 Philippe Veber
2010-11-30 23:18 ` [Caml-list] " oliver
2010-12-01  8:32   ` Philippe Veber
2010-12-01  9:15     ` oliver
2010-12-01 10:26       ` Philippe Veber
2010-12-01 10:51         ` oliver
2010-12-01 15:08           ` Philippe Veber
2010-12-01  1:59 ` Romain Beauxis
2010-12-01 15:17   ` Philippe Veber
2010-12-01 15:27     ` oliver
2010-12-01 16:15     ` Romain Beauxis
2010-12-01  5:51 ` Ilya Seleznev
2010-12-01 15:21   ` Philippe Veber

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=3474B264-1D16-4740-B935-995B6B38F0CE@inria.fr \
    --to=damien.doligez@inria.fr \
    --cc=caml-list@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;
as well as URLs for NNTP newsgroup(s).