<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/11/5e316f00681bf9d723546195e1b57185"
  from="Aleksey Nogin &lt;nogin@c...&gt;"
  author="Aleksey Nogin"
  date="2003-11-12T23:29:41"
  subject="[Caml-list] Ocaml program crashes on Opteron"
  prev="2003/11/34ce59d3f1b53cbaafa5e4edaea674ad"
  next="2003/11/ba636ecd1fb724781a975f3a6976f883"
  prev-in-thread="2003/06/64019a77f20e5c519f6154d465d41fe1"
  next-in-thread="2003/06/bd67d7cfe0d0f08c1438684039c3c9ae"
  prev-thread="2003/06/91e314a321e0e0ef8f6b6ffd326def4f"
  next-thread="2003/06/af5a7736e772d65c11fcc014ca4e2441"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Ocaml and 64 bit address spaces?">
<msg 
  url="2003/06/a1eb16618692948ffc21d25282974e70"
  from="Niall Dalton &lt;niall@L...&gt;"
  author="Niall Dalton"
  date="2003-06-25T15:01:32"
  subject="[Caml-list] Ocaml and 64 bit address spaces?">
<msg 
  url="2003/06/64019a77f20e5c519f6154d465d41fe1"
  from="Xavier Leroy &lt;xavier.leroy@i...&gt;"
  author="Xavier Leroy"
  date="2003-06-25T15:32:25"
  subject="Re: [Caml-list] Ocaml and 64 bit address spaces?">
<msg 
  url="2003/11/5e316f00681bf9d723546195e1b57185"
  from="Aleksey Nogin &lt;nogin@c...&gt;"
  author="Aleksey Nogin"
  date="2003-11-12T23:29:41"
  subject="[Caml-list] Ocaml program crashes on Opteron">
</msg>
<msg 
  url="2003/06/bd67d7cfe0d0f08c1438684039c3c9ae"
  from="Niall Dalton &lt;niall@L...&gt;"
  author="Niall Dalton"
  date="2003-06-26T12:59:56"
  subject="Re: [Caml-list] Ocaml and 64 bit address spaces?">
</msg>
</msg>
</msg>
</thread>

<contents>
I've been trying to use OCaml 3.07 on an Opteron machine running the 
latest Fedora Core development (AKA Red Hat Rawhide) with a binary 
kernel from Mandrake 9.2beta3. I've successfully compiled Ocaml 3.07, 
but when I compile our "omake" system with it, omake segfaults in a 
reproducible fashion (it reliably works for some things and reliably 
crashes for others).

After compiling omake with "ocamlopt.opt -inline 0 -ccopt -g -cc gcc32 
-S -verbose", and then re-running the last linking step with .s files 
instead of .o files (to get debugging information tied to the assembly 
files), I get from gdb:

&gt; ...
&gt; Program received signal SIGSEGV, Segmentation fault.
&gt; Omake_wild__wild_subst_429 () at omake_wild.s:419
&gt; 419             movzbq  -8(%rbx), %rdi
&gt; Current language:  auto; currently asm
&gt; (gdb) bt
&gt; #0  Omake_wild__wild_subst_429 () at omake_wild.s:419
&gt; #1  0x0000002a9557ae00 in ?? ()
&gt; #2  0x000000000044fa02 in List__map_86 ()
&gt; #3  0x0000002a95c9b698 in ?? ()
&gt; #4  0x0000002a9557a508 in ?? ()
&gt; #5  0x0000002a95cdc780 in ?? ()
&gt; #6  0x000000000041df9a in Omake_env__collect_3575 () at omake_env.s:1780
&gt; ...

The relevant part of omake_wild.s is:
&gt; ...
&gt;    .text
&gt;    .align   16
&gt;    .globl   Omake_wild__wild_subst_429
&gt; Omake_wild__wild_subst_429:
&gt;    subq  $8, %rsp
&gt; .L145:
&gt;    movzbq   -8(%rbx), %rdi    &lt;&lt;&lt; it crashes here &lt;&lt;&lt;
&gt;    testq %rdi, %rdi
&gt;    je .L144
&gt; ...

(note that there are no references to L145 in that file) and the Ocaml
code for Omake_wild.wild_subst is:

&gt; let wild_subst (len, s) wild =
&gt;    match wild with
&gt;       WildLiteral node -&gt;
&gt;          WildNode node
&gt;     | WildSplit (plen, prefix, slen, suffix) -&gt;
&gt;          WildString (prefix ^ s ^ suffix)
&gt; 

and it is being called from

&gt;                match search patterns with
&gt;                   Some subst -&gt;
&gt;                      let source_args = List.map (wild_subst subst) sources in

Some additional information (full back trace, register contents, etc) is
available at http://cvs.metaprl.org:12000/bugzilla/show_bug.cgi?id=111

Any guesses as to what might be causing this? Any hints on what I could 
do to invertigate this further?

-- 
Aleksey Nogin

Home Page: http://nogin.org/
E-Mail: nogin@cs.caltech.edu (office), aleksey@nogin.org (personal)
Office: Jorgensen 70, tel: (626) 395-2907

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

