From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 3F059BCB0 for ; Fri, 10 Jun 2005 04:55:28 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j5A2tR4w000953 for ; Fri, 10 Jun 2005 04:55:27 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id EAA28689 for ; Fri, 10 Jun 2005 04:55:27 +0200 (MET DST) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j5A2tP9N000948 for ; Fri, 10 Jun 2005 04:55:26 +0200 Received: from Rosella (ppp35-43.lns1.syd2.internode.on.net [59.167.35.43]) by smtp1.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id j5A2tNWt061496; Fri, 10 Jun 2005 12:25:23 +0930 (CST) Subject: Re: [Caml-list] Caml on intel-OSX From: John Skaller To: Jonathan Bryant Cc: caml-list@inria.fr In-Reply-To: <1118361728.17936.17.camel@chunky.valdosta.edu> References: <1118295206.7145.165.camel@rosella.wigram> <0908894eeba2802d8441ea3476c67c36@wetware.com> <1118330851.8693.10.camel@rosella.wigram> <36973.131.254.50.45.1118334009.squirrel@mail.irisa.fr> <1118357500.8693.80.camel@rosella.wigram> <1118361728.17936.17.camel@chunky.valdosta.edu> Content-Type: text/plain Date: Fri, 10 Jun 2005 12:55:25 +1000 Message-Id: <1118372125.8693.139.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 42A9011F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 42A9011D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 ocamlc:01 ocamlc:01 ocamlopt:01 ocamlopt:01 bug:01 bug:01 binary:01 manifests:01 segfault:01 ocaml:01 bytecode:01 compiler:01 stack:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: On Thu, 2005-06-09 at 20:02 -0400, Jonathan Bryant wrote: > I have OCaml 3.08.3 up an running on an AMD64 box running Mandrake > 10.0. It compiled beautifully under GODI (ocamlc. ocamlc.opt, ocamlopt, > ocamlopt.opt, etc...). It might be a Debian bug... I doubt it is a Debian bug. I'm actually running Ubuntu, and the bug occurs in my local compiled from source version 3.08.3 and also in the installed binary package, which is 3.08.2. It also only manifests in one program, and it causes a segfault in that program in the exact same place independently of the input, provided that place is actually executed. No other Ocaml programs I have built on the box exhibit this problem. However, the code works fine as bytecode and also works on the x86 with native code compiler. Increasing stack size from 8M to 16M has no effect, and I don't expect the stack to be deep at the point in the source the error occurs. The error actually occurs calling a function with a lot of arguments from inside a list iteration, and that function immediately calls another function by simply dropping some arguments .. a perfect candidate for optimisation. My guess is the backend code generator has screwed up keeping track of which registers hold what data .. a problem which won't occur on the x86 simply because there aren't enough registers... :) I have verified this, approximately, by adding debugging prints at various points -- if the print is added just early enough the bug goes away. Presumably the extra call is causing a correct routine in the backend code generator to load/save registers or whatever, because the call is disabling a faulty optimisation/ register allocation. Any other interesting theory appreciated .. The segfault occurs in 'caml_apply5()' somewhere. If anyone would like to test it on another AMD64 based system I would be most happy: wget http://felix.sf.net/flx_1.0.25_src.tgz tar -zxvf flx_1.0.25.tgz cd flx_1.0.25 ./configure make [all the test program compiles segfault ..] This big is logged in the bug tracker, but i forget the PR and it's hard to find again, since i don't know what the disposition is ;( If someone else can reproduce it/fail to reproduce it, that would be valuable data, since the package is quite large (160K LOC), and I have no idea how to isolate the problem. -- John Skaller, skaller at users.sf.net PO Box 401 Glebe, NSW 2037, Australia Ph:61-2-96600850 Download Felix here: http://felix.sf.net