caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Anil Madhavapeddy <anil@recoil.org>
To: Paul Steckler <steck@stecksoft.com>
Cc: Mark Shinwell <mshinwell@janestreet.com>, caml-list@inria.fr
Subject: Re: [Caml-list] Segfaults with Dynlink with OCaml 3.11
Date: Mon, 23 Aug 2010 13:28:53 +0100	[thread overview]
Message-ID: <0E8825B8-E57B-4704-879A-045CC5E1CCA3@recoil.org> (raw)
In-Reply-To: <AANLkTikbSmOQLvP-jab3TnKCbkcXtLWjRXLmvOBm+ihh@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1508 bytes --]

On 23 Aug 2010, at 13:12, Paul Steckler wrote:

> On Mon, Aug 23, 2010 at 10:05 PM, Mark Shinwell
> <mshinwell@janestreet.com> wrote:
> 
>> Have you tried using gdb to determine the stack backtrace when it segfaults?
>> Also, if it can be done without disturbing too much code, it might be worth
>> trying to eliminate Dynlink from the program as a test.
> 
> I've already tried gdb, which is how I learned that the segfault
> occurs during a call
> to one of the query functions in my glue module.
> 
> Oh, we just added the Dynlink stuff.  There haven't been any recent
> crashes until
> just now.  That could be an unhappy coincidence; the real issue might
> lurk in unrelated
> code, as you point out.
> 

OCaml's runtime library also has a debug version which performs additional integrity checks on the heap during garbage collection and other operations. This can help catch problems much closer to their source than the production version of the library.  I build it by:

$ cd ocaml-3.11.2/
$ ./configure <usual args>
$ cd asmrun
$ make libasmrund.a
$ cp libasmrund.a /opt/local/lib/ocaml/

Then I swap the installed libasmrun.a with libasmrund.a when a debug version is needed, and replace the original when done.  Regularly calling Gc.compact() helps triggers the additional checks more often.

I'm not sure if there is a way of using the debug version more easily --- libasmrunp.a (the profiling version) is installed by default, but libasmrund.a is not.

-anil


[-- Attachment #2: Type: text/html, Size: 2125 bytes --]

  parent reply	other threads:[~2010-08-23 12:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-23 10:57 Paul Steckler
2010-08-23 11:06 ` [Caml-list] " Stéphane Glondu
2010-08-23 11:47   ` Paul Steckler
2010-08-23 12:05     ` Mark Shinwell
2010-08-23 12:12       ` Paul Steckler
2010-08-23 12:15         ` Daniel Bünzli
2010-08-23 12:28         ` Anil Madhavapeddy [this message]
2010-08-23 15:48         ` Stéphane Glondu
2010-08-25  4:00 ` Paul Steckler
2010-09-03 14:59   ` [Caml-list] " Damien Doligez

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=0E8825B8-E57B-4704-879A-045CC5E1CCA3@recoil.org \
    --to=anil@recoil.org \
    --cc=caml-list@inria.fr \
    --cc=mshinwell@janestreet.com \
    --cc=steck@stecksoft.com \
    /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).