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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id B4F1DBC69 for ; Mon, 2 Jul 2007 15:25:39 +0200 (CEST) Received: from out2.smtp.messagingengine.com (out2.smtp.messagingengine.com [66.111.4.26]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l62DPd1O024276 for ; Mon, 2 Jul 2007 15:25:39 +0200 Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 4288954FB; Mon, 2 Jul 2007 09:25:38 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 02 Jul 2007 09:25:38 -0400 X-Sasl-enc: 0cDCGrroAbeOrIxa/POVoOwGpKyFlXST41vC//aJYxrG 1183382737 Received: from [192.168.1.10] (AMontsouris-753-1-21-20.w83-202.abo.wanadoo.fr [83.202.133.20]) by mail.messagingengine.com (Postfix) with ESMTP id 7D9A1787; Mon, 2 Jul 2007 09:25:37 -0400 (EDT) Date: Mon, 2 Jul 2007 15:25:23 +0200 (CEST) From: Martin Jambon X-X-Sender: martin@martin.ec.wink.com To: =?iso-8859-1?Q?J=F8rgen?= Hermanrud Fjeld Cc: caml-list@inria.fr Subject: Re: [Caml-list] Segfault with close_out in ocaml 3.09.2 In-Reply-To: <20070701184116.GA25644@hex.no> Message-ID: References: <20070701184116.GA25644@hex.no> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-498578720-1183382723=:13983" X-Miltered: at concorde with ID 4688FCD3.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ens-lyon:01 segfault:01 ocaml:01 readable:01 unreadable:01 mime-aware:01 segfault:01 bug:01 ocaml:01 pervasives:01 bug:01 ocamlopt:01 cmxa:01 ocamlopt:01 cmxa:01 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-498578720-1183382723=:13983 Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8BIT On Sun, 1 Jul 2007, Jørgen Hermanrud Fjeld wrote: > Hi! > I can provoke a segfault with close_out, and suspect a bug somewhere in > ocaml 3.09.2 or the Pervasives module of ocaml 3.09.2, as shipping with > Ubuntu feisty. It's probably this bug: http://caml.inria.fr/mantis/view.php?id=4039 Martin > > To reproduce, save the attached files, use ocaml 3.09.2 and run > #### > ocamlopt unix.cmxa -o nosegfault nosegfault.ml > ocamlopt unix.cmxa -o segfault segfault.ml > ./nosegfault ; ./segfault > #### > > The difference between segfault.ml and nosegfault.ml is the allocation > of a large string > #### > let _ = String.create (Sys.max_string_length) in > #### > > The bug appears for the second call to close_out. > > When I use Unix.close, there is no problem. > > The original code where the testcase is derived form ran fine when > compiled with ocaml 3.08. > > When I use ocaml 3.10.0 the problem is gone. > > If someone can help discover why the segfault appears that would be > nice. > Since the bug disappears in ocaml 3.10, the bug is probably fixed, > which one can check when the cause of the segfault is discovered. > > > -- > Sincerely | Homepage: > Jørgen | http://www.hex.no/jhf > | Public GPG key: > | http://www.hex.no/jhf/key.txt > > > --8323328-498578720-1183382723=:13983--