Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
possible instability with native code on UltraSPARC?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: William Chesters <williamc@d...>
Subject: possible instability with native code on UltraSPARC?
   Has anyone had a problems with stability of native code on
UltraSPARC/Solaris?  When I try my program on the Uni Suns, it crashes
with a bus error or segmentation fault after some number of iterations
of a top level test loop.

   A few random remarks in case anything rings a bell:

   Depending on what I put in the test loop, it crashes anywhere from
the first to the 31st iteration, or not at all; and the place where it
crashes varies between sweep_slice (it seems to have walked off the
end having trashed the `limit' pointer), oldify, and a float array
store in of my modules (most commonly: it can happen in other places
too).  It sometimes behave a little differently under gdb than on its

   With the debug runtime libasmrund.a, it crashes in a different
place but sadly doesn't fail any assertions.

   I haven't so far been able to isolate a single piece of my code
which causes the problem.  However the whole thing is very float-array
intensive, which is probably relatively uncommon in ocaml

   I tried a few variations of the same code compiled to bytecode, and
didn't see any problems, so it seems not to be in the runtime per se.

   Using -compact with ocamlopt didn't help.  I haven't tried playing
with the -inline.

   I use camlp4 very intensively as a front end, but I don't think
this is a camlp4-related problem, because it happens just the same if
I use pr_o.cmo (which outputs ocaml-syntax ASCII text for ocaml to
parse) as with pr_dump.cmo (which outputs a marshalled syntax tree).

   The only library I am linking with is camlp4's "gramlib.cmxa" which
I use for the lexer (and yes, for what it's worth, I have recompiled
camlp4 and tried again).  That is the only `.cmxa' in the link
command; everything else is one of my `.cmx's.  There are no `.o's or
explicit `-cclib's at all.

   To concentrate my mind, here is a declaration: "I am certain that
there is nothing but ML in the code.  The only compiler involved is
vanilla out-of-the-box ocamlopt 2.02.  The only non-standard library I
am linking with is gramlib.cmxa.  I slept normally last night and have
not ingested coffee for six hours."


      SunOS stilt 5.6 Generic_105181-11 sun4u sparc  (Sun Ultra 5)

      The Objective Caml compiler, version 2.02
         compiled with gcc version 2.8.1 (*)
         configured to use posix threads for threading (+)

(*) same problem when ocaml compiled with egcs 1.1; N.B. it bootstraps
successfully with either compiler

(+) but the program isn't compiled with -thread or linked with any
thread library