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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id D9D177EC41 for ; Tue, 16 Oct 2012 19:29:37 +0200 (CEST) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of dhouse@janestreet.com) identity=pra; client-ip=38.105.200.112; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="dhouse@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of dhouse@janestreet.com designates 38.105.200.112 as permitted sender) identity=mailfrom; client-ip=38.105.200.112; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="dhouse@janestreet.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@nyc-dmz-mxout1.janestreet.com) identity=helo; client-ip=38.105.200.112; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="dhouse@janestreet.com"; x-sender="postmaster@nyc-dmz-mxout1.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgoBAJaYfVAmachwl2dsb2JhbAArGr98KwEBAQEBBhgHO4IgAQEBBBICLAEBNwEPCwsDAwQBAQEuIhIBBQEUCAYTIodiAwEHLJwlCQOKa4MpgQoBBY86BotPhj2VboEVigqDMhYphBCCFg X-IronPort-AV: E=Sophos;i="4.80,595,1344204000"; d="scan'208";a="159255011" Received: from mx1.janestreet.com (HELO nyc-dmz-mxout1.janestreet.com) ([38.105.200.112]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 16 Oct 2012 19:29:36 +0200 Received: from nyc-qsv-mail1.delacy.com ([172.25.22.57]) by nyc-dmz-mxout1.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1TOAxS-0002eR-JB for caml-list@inria.fr; Tue, 16 Oct 2012 13:29:34 -0400 Received: from nyc-dmz-mxgoog1.delacy.com ([172.25.224.109] helo=mxgoog1.janestreet.com) by nyc-qsv-mail1.delacy.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1TOAxS-0002lG-Hm for caml-list@inria.fr; Tue, 16 Oct 2012 13:29:34 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]) by mxgoog1.janestreet.com with esmtp (Exim 4.76) (envelope-from ) id 1TOAxS-0002xC-Dn for caml-list@inria.fr; Tue, 16 Oct 2012 13:29:34 -0400 Received: by mail-wi0-f174.google.com with SMTP id hq7so129831wib.9 for ; Tue, 16 Oct 2012 10:29:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=lFOFOnW5m1pPQWAvaZKKChXSOkBB+7bDhCNK4KIURyE=; b=CbEY+WGbWWSGDQU2Zq3xZBaVLzx0s1f1yKcmknrUBlVWUPbnwTU4bxBBsER8ZS3zcX Eh8v1danF3IingBFzRXQg3BSu6ei6N/HBsO1sB6vOn4jmBgyruvhW/NQoOkUEyhQF31P NflRMVDpJKx1RCuf9ULhN4L4IEeR+tX3UeiNw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=lFOFOnW5m1pPQWAvaZKKChXSOkBB+7bDhCNK4KIURyE=; b=EK57YEejrBYxXODxjx1zOUz9Kux/x1qmKKKAGQnjQXJVcjaZJKTjJXbistvgLOLjcd q5mPWVn0nXIt7zXtpUOll28BbabTIe8rFF5SSiGVUIPdmF7yoGHIBWP7jW7Vex/Bkk15 lokvnqhQgTVhYi2ll6bwE0LeROlnV1OW50J5LO9ohWSIBU5G0Ys2Y7kI3fSfcVy3G0PW XgRwoe9S1OpEdzGJOs6P5ymd5NFqVylmdDfIhiL0Iiwfx4W628Aujnn6yz/AfjR8KPQx 2ZySMEBQyiviueX89nKRnQRPRp6h2zNoveBBXNHSP+CXdx4XTxApvO4thXggmrXeBC78 8Y5g== MIME-Version: 1.0 Received: by 10.180.87.34 with SMTP id u2mr33416021wiz.4.1350408573536; Tue, 16 Oct 2012 10:29:33 -0700 (PDT) Received: by 10.180.145.104 with HTTP; Tue, 16 Oct 2012 10:29:33 -0700 (PDT) X-Originating-IP: [80.169.196.210] In-Reply-To: References: Date: Tue, 16 Oct 2012 18:29:33 +0100 Message-ID: From: David House To: Lin Hong Cc: "caml-list@inria.fr" Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQmChHYP978amxgDtwUdrlN0fYBeQRSFumTIbPsrKSGfzs7WGoMC4rj0VFUiKtDEgV43jMRy Subject: Re: [Caml-list] Segmentation fault from Array.append I don't know enough about gdb to determine that, sorry. If it's reproducible, you should be able to get a minimal test case, and then just read carefully the c functions that remain. Keep in mind the ocaml manual: http://caml.inria.fr/pub/docs/manual-ocaml/manual033.html#toc146 On Tue, Oct 16, 2012 at 4:50 PM, Lin Hong wrote: > > oh yes, we have c functions called from ocaml. > > if any of them screw heap up, why gdb debug didn't say anything. is there some debug option that we can get a closer look at heap? > > > Thanks, > > > Lin Hong > American Museum of Natural History > POY website : > https://code.google.com/p/poy/ > http://research.amnh.org/scicomp/scripts/download.php > > ________________________________________ > From: David House [dhouse@janestreet.com] > Sent: Tuesday, October 16, 2012 11:42 AM > To: Lin Hong > Cc: caml-list@inria.fr > Subject: Re: [Caml-list] Segmentation fault from Array.append > > By "c stubs" I really mean c functions that you're calling from ocaml. > It's very easy to get such things wrong and stamp all over your heap. > > On Tue, Oct 16, 2012 at 4:41 PM, Lin Hong wrote: >> >> >> if by "c stubs" you mean some function that holding up place but does nothing, we are not doing any of that. >> >> and yes it's reproducible on one mac, I will test it on other machine with Ocaml4.X.X >> >> >> Thanks, >> Lin Hong >> American Museum of Natural History >> POY website : >> https://code.google.com/p/poy/ >> http://research.amnh.org/scicomp/scripts/download.php >> >> ________________________________________ >> From: David House [dhouse@janestreet.com] >> Sent: Tuesday, October 16, 2012 11:10 AM >> To: Lin Hong >> Cc: caml-list@inria.fr >> Subject: Re: [Caml-list] Segmentation fault from Array.append >> >> Segfaults in the GC are often the fault of random heap corruption. Are >> you using any C stubs that might be at fault here? >> >> Is the fault reproducable? >> >> On Tue, Oct 16, 2012 at 4:08 PM, Lin Hong wrote: >>> Hi, all >>> >>> we got a Segmentation fault with Ocaml 4.0.0 and 4.0.1 from append function >>> of Array. gdb traceback give us this: >>> >>> Program received signal EXC_BAD_ACCESS, Could not access memory. >>> Reason: KERN_INVALID_ADDRESS at address: 0x0000000107b65000 >>> 0x0000000100488840 in mark_slice () >>> (gdb) backtrace >>> #0 0x0000000100488840 in mark_slice () >>> #1 0x0000000100489216 in caml_major_collection_slice () >>> #2 0x000000010048984c in caml_check_urgent_gc () >>> #3 0x000000010048f26d in caml_array_gather () >>> #4 0x000000010048f42e in caml_array_append () >>> #5 0x00000001003ef216 in .L363 () >>> Previous frame inner to this frame (gdb could not unwind past this frame) >>> (gdb) >>> >>> looks like the error is from array.c >>> >>> we don't see this problem with Ocaml3.X.X, they have different array >>> function in the cside anyway. >>> >>> Does anyone else have similar problem like this? >>> >>> >>> Thanks in advance for any suggestions. >>> >>> Cheers, >>> Lin Hong >>> American Museum of Natural History >>> POY website : >>> https://code.google.com/p/poy/ >>> http://research.amnh.org/scicomp/scripts/download.php