From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 8F403BCC1 for ; Thu, 31 Aug 2006 10:33:58 +0200 (CEST) Received: from mail.davidb.org (mail.davidb.org [66.93.32.219]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k7V8Xu6f023212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 31 Aug 2006 10:33:58 +0200 Received: from a64.davidb.org ([66.93.32.226]) by mail.davidb.org with esmtpa (Exim 4.60 #1 (Debian)) id 1GIhzo-0004uR-AP for ; Thu, 31 Aug 2006 01:33:56 -0700 Message-ID: <44F69EF1.5000702@davidb.org> Date: Thu, 31 Aug 2006 01:33:53 -0700 From: David Brown User-Agent: Thunderbird 1.5.0.5 (X11/20060801) MIME-Version: 1.0 Cc: caml-list@inria.fr Subject: Re: [Caml-list] Segfault in caml_oldify_local_roots. References: <44F68278.5060903@davidb.org> In-Reply-To: <44F68278.5060903@davidb.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 44F69EF4.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; segfault:01 oldify:01 ocaml-:01 camlzip:01 xavier's:01 oldify:01 messes:01 segfault:01 pulled:98 wrote:01 garbage:01 cryptokit:01 caml-list:01 caml-list:01 bin:01 David Brown wrote: > Just wondering if anyone has any ideas on how I might debug this. The > problem happens with ocaml-3.09.2, and doesn't with 3.08.3. The program > uses camlzip as well as the sha1 binding pulled out of Xavier's cryptokit. > > Program received signal SIGSEGV, Segmentation fault. > 52 caml_oldify_one (*sp, sp); I found the problem, in how I was using the Gzip module. I was doing something like: let fd = open_out_bin ... in let zfd = Gzip.open_out_chan fd in ... Gzip.close_out zfd; close_out fd Turns out that if I'd read it more carefully, I should have realized that Gzip.close_out will also close the underlying handle. Apparently calling close_out twice on the same handle messes things up enough to segfault the garbage collector. Dave Brown