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 A0060BCAC for ; Fri, 13 May 2005 10:14:36 +0200 (CEST) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j4D8EY08015696 for ; Fri, 13 May 2005 10:14:35 +0200 Received: from [192.168.1.200] (ppp30-126.lns1.syd2.internode.on.net [59.167.30.126]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id j4D8EWRR069475 for ; Fri, 13 May 2005 17:44:33 +0930 (CST) Subject: Re: [Caml-list] AMD64 segfault From: skaller Reply-To: skaller@users.sourceforge.net To: caml-list In-Reply-To: <1115937349.17251.8.camel@pelican.wigram> References: <1115937349.17251.8.camel@pelican.wigram> Content-Type: text/plain Organization: Message-Id: <1115972071.17482.96.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 13 May 2005 18:14:32 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 428461EA.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 segfault:01 sourceforge:01 ocamlopt:01 compiler:01 segfaults:01 bytecode:01 bignums:01 ocaml:01 gcc:01 debugging:01 gdb:01 segfault:01 exes:01 function':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 Fri, 2005-05-13 at 08:35, skaller wrote: > I just built caml 3.08.3 on my new AMD64 and compiled and ran the usual > hello world with ocamlopt.opt, however the Felix compiler segfaults. > The bytecode version runs fine. Felix uses bignums and unix, otherwise > it is a pure ocaml program (no 3pl C libraries). > > I have no idea where start looking. I'm running Ubuntu (Hoary) > and using gcc 3.4. > > Any hints? I have found the error occurs in a particular part of the program -- the instantiator, which takes a generic entity and instantiates it .. I added a debugging print in an attempt to 'binary chop' to the line with the error.. unfortunately that magically fixes the problem. Using gdb I get a message saying the SIGSEGV is in caml_apply5(). Anyone know what that is doing? More fiddling indicates the problem occurs in the code below. 1. As written it crashes. 2. uncommenting the 'processing exe' does not fix the problem, the diagnostic is not emitted before the segfault 3. uncommenting "doing exes", the diagnost IS printed before the segfault 4. uncommenting "Process function" the segfault doesn't occur at all Note that 'process_function' is just a forwarding function that forgets some arguments .. ------------------------------------- and process_exes syms bbdfns ref_insts1 ts hvarmap exes = print_endline "Doing exes"; iter (process_exe syms bbdfns ref_insts1 ts hvarmap) exes ----------------------------------------------------- Full code below from 'src.flx_inst.ml" in Felix version 1.0.23 ---------------------------------------------------------------- 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); *) match exe with .... elided ........ -> () and process_exes syms bbdfns ref_insts1 ts hvarmap exes = print_endline "Doing exes"; iter (process_exe syms bbdfns ref_insts1 ts hvarmap) exes 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 exes -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net