From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id F177F7EE20 for ; Mon, 19 Nov 2012 18:04:29 +0100 (CET) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of lhong@amnh.org) identity=pra; client-ip=216.73.244.167; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="lhong@amnh.org"; x-sender="lhong@amnh.org"; x-conformance=sidf_compatible Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of lhong@amnh.org) identity=mailfrom; client-ip=216.73.244.167; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="lhong@amnh.org"; x-sender="lhong@amnh.org"; x-conformance=sidf_compatible Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-mx-002.amnh.org) identity=helo; client-ip=216.73.244.167; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="lhong@amnh.org"; x-sender="postmaster@mail-mx-002.amnh.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvYAAMdlqlDYSfSnmWdsb2JhbAArGoJsrTqTHSMBAQEBAQgLCwcUJ4IeAQEBAwFuEAsCAQgRBAEBCwMhMhMKCAIEARIICodpAwkGAQottXcDiV6MNIQsYQOXGIoRiAWCGQ X-IronPort-AV: E=Sophos;i="4.83,280,1352070000"; d="scan'208";a="182204932" Received: from mail-mx-002.amnh.org ([216.73.244.167]) by mail1-smtp-roc.national.inria.fr with ESMTP; 19 Nov 2012 18:04:29 +0100 X-ASG-Debug-ID: 1353344658-04264150c07544f0001-jBxyQn Received: from amnh.org ([172.16.8.237]) by mail-mx-002.amnh.org with ESMTP id 8RLiBXk7NcUtnuQl; Mon, 19 Nov 2012 12:04:18 -0500 (EST) X-Barracuda-Envelope-From: lhong@amnh.org Received: from MAIL-MBX-005.internal.amnh.org ([fe80::f8d9:d817:b12:fce8]) by MAIL-CASHT-002.internal.amnh.org ([fe80::f48f:c9ac:48a3:c7ed%10]) with mapi id 14.01.0289.001; Mon, 19 Nov 2012 12:04:18 -0500 From: Lin Hong X-Barracuda-Apparent-Source-IP: fe80::f8d9:d817:b12:fce8 To: Damien Doligez , caml users Thread-Topic: [Caml-list] Segmentation fault from Array.append X-ASG-Orig-Subj: RE: [Caml-list] Segmentation fault from Array.append Thread-Index: Ac2rr9EX9pdeTykEReS0KJzd2+kKjgAIiimA///EARWAAETNAP//vV2JgABpwAD//886m4ABd/SAgDPQ5C4= Date: Mon, 19 Nov 2012 17:04:18 +0000 Message-ID: References: ,<94BF6DC4A4904A74A1CA3ADE98B0BF75@erratique.ch> ,<52D3E528-32A8-477F-89F6-EFD923EB71D2@inria.fr> In-Reply-To: <52D3E528-32A8-477F-89F6-EFD923EB71D2@inria.fr> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.8.249] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Barracuda-Connect: UNKNOWN[172.16.8.237] X-Barracuda-Start-Time: 1353344658 X-Barracuda-URL: http://spam.amnh.org:80/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at amnh.org X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=4.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.114670 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Subject: RE: [Caml-list] Segmentation fault from Array.append Hi, we recompiled Ocaml with debug version of runtime, then compiled our progra= m into byte code, run the same data-set , the problem disappear.=20 but with native version of our program, the segmentation fault still shows.= =20 As for native version, if we run it with Gc.compact() being called around A= rray.append, the problem won't show.=20 also gdb point us to some major_slice() function, so we call Gc.major_slice= () before Array.append, this also make the problem disappear.=20 still don't know what's going on here, any other suggestions are highly app= reciated.=20 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=FCnzli [daniel.buenzli@erratique.ch] > > http://rwmj.wordpress.com/2010/01/22/tip-tracking-down-ocaml-heap-corrupt= ors/ 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 vers= ion 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 asse= rtions 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=92s advi= ce, you should be able to narrow down the source of the heap corruption qui= te 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