caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Lin Hong <lhong@amnh.org>
To: Damien Doligez <damien.doligez@inria.fr>,
	caml users <caml-list@inria.fr>
Subject: RE: [Caml-list] Segmentation fault from Array.append
Date: Mon, 19 Nov 2012 17:04:18 +0000	[thread overview]
Message-ID: <C960B6881E802A459A09A7DAD55690053E7D273B@MAIL-MBX-005.internal.amnh.org> (raw)
In-Reply-To: <52D3E528-32A8-477F-89F6-EFD923EB71D2@inria.fr>

Hi,

we recompiled Ocaml with debug version of runtime, then compiled our program into byte code, run the same data-set , the problem disappear. 

but with native version of our program, the segmentation fault still shows. 

As for native version, if we run it with Gc.compact() being called around Array.append, the problem won't show. 

also gdb point us to some major_slice() function, so we call Gc.major_slice() before Array.append, this also make the problem disappear. 


still don't know what's going on here, any other suggestions are highly appreciated. 


Thanks.

Cheers,
Lin Hong
American Museum of Natural History
POY website :
https://code.google.com/p/poy/
http://research.amnh.org/scicomp/scripts/download.php

________________________________________
From: caml-list-request@inria.fr [caml-list-request@inria.fr] on behalf of Damien Doligez [damien.doligez@inria.fr]
Sent: Wednesday, October 17, 2012 9:33 AM
To: caml users
Subject: Re: [Caml-list] Segmentation fault from Array.append

Hello,

> From: Daniel Bünzli [daniel.buenzli@erratique.ch]
>
> http://rwmj.wordpress.com/2010/01/22/tip-tracking-down-ocaml-heap-corruptors/


I have posted a comment to that blog.  For the archive, here's what it says:

Starting with OCaml 4.00.0, there is an easy way to activate the debug version of the runtime:

1. configure OCaml with "-with-debug-runtime"
2. compile and install OCaml
3. compile your program with "-runtime-variant d"

This will compile your program with a version of the runtime which has assertions all over the place, and does a thorough check of the heap structure at each major GC (and at each compaction). If you then follow Rich’s advice, you should be able to narrow down the source of the heap corruption quite easily.

-- Damien


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

      reply	other threads:[~2012-11-19 17:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-16 15:08 Lin Hong
2012-10-16 15:10 ` David House
2012-10-16 15:41   ` Lin Hong
2012-10-16 15:42     ` David House
2012-10-16 15:50       ` Lin Hong
2012-10-16 17:29         ` David House
2012-10-16 18:02         ` Daniel Bünzli
2012-10-16 19:08           ` Lin Hong
2012-10-17 13:33             ` Damien Doligez
2012-11-19 17:04               ` Lin Hong [this message]

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=C960B6881E802A459A09A7DAD55690053E7D273B@MAIL-MBX-005.internal.amnh.org \
    --to=lhong@amnh.org \
    --cc=caml-list@inria.fr \
    --cc=damien.doligez@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).