caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: John Skaller <skaller@users.sourceforge.net>
To: Jon Harrop <jon@ffconsultancy.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Caml on intel-OSX
Date: Sun, 12 Jun 2005 04:39:22 +1000	[thread overview]
Message-ID: <1118515162.7212.39.camel@rosella.wigram> (raw)
In-Reply-To: <200506110039.18279.jon@ffconsultancy.com>

On Sat, 2005-06-11 at 00:39 +0100, Jon Harrop wrote:
> On Thursday 09 June 2005 23:51, John Skaller wrote:
> > Whilst I personally prefer the ocaml native code compiler,
> > at present I can't use it on my AMD64 as there appears

> Do you think I shouldn't release for AMD64? 

See PR#3640 (in Incoming in the Bug Tracker) first:

My guess is if you code works it works... the bug
is fairly rare and only triggered in unusual
circumstances .. but that is just a guess.

> How confident are you that this is 
> a codegen bug? 

It would help if someone tried to replicate the problem,
to be sure it exists -- if could just be my machine.

Try to build Felix:

/http://felix.sourceforge.net/flx_1.0.25_src.tgz

on my box it segfaults in every test.

I can only guess it is a backend code generator bug
from the following data:

(a) it goes way if a print_endline " .. " is introduced
in certain places but not others.

(b) Using that technique I have isolated the problem
to a few lines of Ocaml code

(c) Something like 50 regression tests and tutorial
examples all fail in the same place

(d) gdb indicates a problem in caml_apply5()

(e) The code runs on x86 with native code compiler
and all architectures with bytecode compiler.

(f) changing stack size from 8M to 16M makes no
difference

(g) The problem only occurs in one program in one
place, other programs don't fail.

(h) It fails on both my personal build from sourcecode
of 3.08.3 and also a 3.08.2(ubuntu) binary package
(which I guess is a copy of the Debian package).

I would be a lot more confident if someone reproduced
the bug and someone from INRIA said they'd found it :)
I'm only guessing. I am not an expert on the internals
of Ocaml.

> Does your code use only OCaml's theoretically safe subset?

Yes. The code also runs on x86 native code and bytecode.
It does use Unix, Big_int, and Ocamlyacc/Ocamllex
it might be a C compiler problem, but the location
of the crash isn't using any of that and it isn't 
a random error but repeatable and consistent.

However there is no Obj.magic, and no C, and no
other third party code such as from Extlib that might
use it: everything comes from the standard distro.
[Actually ocs_scheme is linked in and might, but it
isn't being called]

There lots of things I could experiment with,
for example it might be my linker, C compiler,
or even Linux kernel... or it could be a bug
in the Felix source which luckily didn't cause
a problem in other situations (eg, a tail-recursion
that isn't handled on one processor but is on another).

But a simple bug in register allocation in the back
end seems most likely to me at this time.


-- 
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


  reply	other threads:[~2005-06-11 18:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-09  5:33 John Skaller
2005-06-09  8:23 ` [Caml-list] " Agustín Valverde
2005-06-09 14:00 ` james woodyatt
2005-06-09 15:27   ` John Skaller
2005-06-09 16:20     ` padiolea
2005-06-09 22:51       ` John Skaller
2005-06-10  0:02         ` Jonathan Bryant
2005-06-10  2:55           ` John Skaller
2005-06-10  7:10             ` Florian Hars
2005-06-10  0:41         ` Jacques Garrigue
2005-06-10  1:57           ` John Skaller
2005-06-14  0:28           ` Sven Luther
2005-06-10  6:35         ` Stefano Zacchiroli
2005-06-10  9:07           ` John Skaller
2005-06-10 23:39         ` Jon Harrop
2005-06-11 18:39           ` John Skaller [this message]
2005-06-11 19:03             ` Jon Harrop
2005-06-12  6:58               ` John Skaller
2005-06-13 19:19             ` [Caml-list] AMD64 ocamlopt bug Xavier Leroy
2005-06-13 19:32               ` John Skaller
2005-06-13 20:18                 ` Damien Doligez
2005-06-13 20:27                 ` John Skaller
2005-06-13 21:01                   ` Anil Madhavapeddy
2005-06-09 23:44       ` [Caml-list] Caml on intel-OSX Jonathan Bryant

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=1118515162.7212.39.camel@rosella.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@yquem.inria.fr \
    --cc=jon@ffconsultancy.com \
    /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).