From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id D99E0BCB0 for ; Sun, 12 Jun 2005 08:58:32 +0200 (CEST) Received: from ash25e.internode.on.net (ash25e.internode.on.net [203.16.214.182]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j5C6wU6l025639 for ; Sun, 12 Jun 2005 08:58:32 +0200 Received: from Rosella (ppp35-43.lns1.syd2.internode.on.net [59.167.35.43]) by ash25e.internode.on.net (8.12.9/8.12.6) with ESMTP id j5C6wOpI086351; Sun, 12 Jun 2005 16:28:25 +0930 (CST) (envelope-from skaller@users.sourceforge.net) Subject: Re: [Caml-list] Caml on intel-OSX From: John Skaller To: Jon Harrop Cc: caml-list@yquem.inria.fr In-Reply-To: <200506112003.33778.jon@ffconsultancy.com> References: <1118295206.7145.165.camel@rosella.wigram> <200506110039.18279.jon@ffconsultancy.com> <1118515162.7212.39.camel@rosella.wigram> <200506112003.33778.jon@ffconsultancy.com> Content-Type: text/plain Date: Sun, 12 Jun 2005 16:58:24 +1000 Message-Id: <1118559504.7152.77.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 42ABDD16.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 segfault:01 stack:01 compiler:01 config:01 ocaml:01 config:01 bytecode:01 bug:01 cvs:01 ocaml:01 cvs:01 compiler:01 segfault:01 inlining: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 Sat, 2005-06-11 at 20:03 +0100, Jon Harrop wrote: > On Saturday 11 June 2005 19:39, John Skaller wrote: > > It would help if someone tried to replicate the problem, > > to be sure it exists -- if could just be my machine. > > Sorry, I forgot to say that I did what you asked on my AMD64 and got a > segfault. I haven't checked to see if it is a stack overflow though. OK, so you replicated the problem. If you set NATIVE_CODE_COMPILER=0 in the file config/ocaml_config.py and rebuild by something like make virgin ./configure make you'll be running the bytecode version, and it should all work, indicating the problem isn't a source code bug. I tried to build the CVS Ocaml under Godi, but the build fails at the moment (I should try direct CVS build next). It is a bit of a pain for me because I'm trying to build a Debian package, and there is a dependency on Ocaml, but not native code compiler package. However, that should be a 'build-recommends', and if installed, as it is on my box, the native code compiler is automatically detected and used. Debian knows the platform architecture, but the configure script is Python, and supposed to work on all platforms, and I have no idea of how to discover the platform architecture in general. ------------------------------------------------- We have this code where the error occurs, and according the PR#3640, if the process_function debug print is included, the segfault goes away .. .. it looks to me like adding debug prints changes inlining behaviour (adding the debug print prevents inlining) and somehow after inlining the result triggers the code generation bug. I would guess inlining is higher level than code generation, so it isn't the inlining algorithm that is the problem. The AMD64 code generator sounds more likely, and this assumption is also supported by the fact it is newer code. Of course these are all GUESSES on my part. --------------------------------------------------------- and process_function syms bbdfns hvarmap ref_insts1 index sr argtypes ret exes ts = (* print_endline ("Process function " ^ si index); *) process_exes syms bbdfns ref_insts1 ts hvarmap e and process_exes syms bbdfns ref_insts1 ts hvarmap exes = (* put some debug print here too .. *) iter (process_exe syms bbdfns ref_insts1 ts hvarmap) exes and process_exe syms bbdfns ref_insts1 ts hvarmap (exe:bexe_t) = let ue sr e = process_expr syms bbdfns ref_insts1 hvarmap sr e in let uis i ts = add_inst syms ref_insts1 (i,ts) in let ui i = uis i ts in (* print_endline ("processing exe " ^ string_of_bexe syms.dfns 0 exe); A *) ..... -- 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