From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 2680ABB84 for ; Thu, 19 Jun 2008 23:45:40 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnABAD1wWkiAKgEfiGdsb2JhbACSTAEBAQ8gnWg X-IronPort-AV: E=Sophos;i="4.27,674,1204498800"; d="scan'208";a="12319002" Received: from mail.cs.rice.edu ([128.42.1.31]) by mail2-smtp-roc.national.inria.fr with ESMTP; 19 Jun 2008 23:45:39 +0200 Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 524512C2B62 for ; Thu, 19 Jun 2008 16:45:38 -0500 (CDT) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZUrpfcDnPr-y for ; Thu, 19 Jun 2008 16:45:30 -0500 (CDT) Received: from [10.121.20.234] (nat-168-7-231-99.rice.edu [168.7.231.99]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id A8F192C2B58 for ; Thu, 19 Jun 2008 16:45:30 -0500 (CDT) Mime-Version: 1.0 (Apple Message framework v752.2) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: caml-list@yquem.inria.fr From: Raj Bandyopadhyay Subject: Segfault in Garbage collector code: any ideas? Date: Thu, 19 Jun 2008 16:45:27 -0500 X-Mailer: Apple Mail (2.752.2) X-Spam: no; 0.00; segfault:01 ocaml:01 segfault:01 inputs:01 ocaml's:01 recompiled:01 ocaml:01 gdb:01 gdb:01 oldify:01 oldify:01 interprete:01 interp:01 exn:01 narg:01 Dear all I am running a large OCaml application with a C interface, and I get a segfault for larger inputs. Since it seemed to be occurring in OCaml's garbage collector code, I recompiled OCaml with a '-g' option and used gdb to track the source of the segfault. Here's what I see in gdb: < Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x0075a000 caml_oldify_mopup () at minor_gc.c:201 201 Field (new_v, i) = f; (gdb) bt #0 caml_oldify_mopup () at minor_gc.c:201 #1 0x0011dd14 in caml_empty_minor_heap () at minor_gc.c:221 #2 0x0011de80 in caml_minor_collection () at minor_gc.c:260 #3 0x00122908 in caml_interprete (prog=0x168f0c, prog_size=7708608) at interp.c:538 #4 0x001171e8 in caml_callbackN_exn (closure=7602900, narg=1, args=0x71d004) at callback.c:82 #5 0x0011723c in caml_callback_exn (closure=7602900, arg1=7708608) at callback.c:109 ... functions from my C code 1) From past experience, this sort of thing seems to occur when I forget to use a CAMLparam/local/return macro somewhere. However, I have looked over my C code several times and can't find any such problem. Is there any other scenario where this sort of segfault can occur? 2) Can those macros be misused, somehow? I have used them in every function which is passed or returns or creates a 'value'. Any suggestions on how I'd go about finding the source of this problem would be welcome. I apologize in advance for lack of specific information about the application, I'm not sure what information would be useful. Please feel free to email me with any questions or suggestions. Thank you Raj