caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: caml-list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] AMD64 segfault
Date: 13 May 2005 18:14:32 +1000	[thread overview]
Message-ID: <1115972071.17482.96.camel@pelican.wigram> (raw)
In-Reply-To: <1115937349.17251.8.camel@pelican.wigram>

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




      parent reply	other threads:[~2005-05-13  8:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-12 22:35 skaller
2005-05-13  1:33 ` [Caml-list] " Jon Harrop
2005-05-14  4:14   ` skaller
2005-05-14 13:29     ` Jon Harrop
2005-05-13  8:14 ` skaller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1115972071.17482.96.camel@pelican.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).