[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issues in ia64

From: Thien-Thi Nguyen
Subject: Re: Issues in ia64
Date: Tue, 02 Jul 2002 01:58:44 -0700

   From: Ying Luo <address@hidden>
   Date: Tue, 02 Jul 2002 08:37:44 +0800

   I met some problems during running guile in ia64. When the program
   are compiled in debug mode, everything is okay except that when we
   run the scheme command (call-with-current-continuation ...) ;

i'd like to develop some test programs for call/cc (in C) that we can
run as part of "make check".  perhaps you have a fragment already that i
can use?

   but when we compile the program with optimize flag, it will catch a
   crash after several gabage collectings. The breakpoint locates in
   function scm_gc_mark(...) , which seemed the problem was caused by
   the mis-allignment during guile's stack structure. (P.S.  The
   machine's version is ia64-redhat-linux)

guile's type system holds an assumption:

 * This in turn means that cells must be aligned on a 8 byte boundary,
 * which is just right for two 32bit numbers (surprise, surprise).

alignment for 64 bit machines and such introduces to the specification
an MBZ field, let's call it machine-alignment-immediate-slack.  the
current code (libguile/struct.c:317) does not guarantee this:

  /* Adjust it even further so it's aligned on an eight-byte boundary.  */
  p = (scm_t_bits *) (((scm_t_bits) p + 7) & ~7);

it specifies the minimum and omits the slack.  ignoring slack altogether
we can probably reformulate purely using scm_t_bits, the result being:

  #define space (sizeof (scm_t_bits) * 2 - 1)
  p = (scm_t_bits *) (((scm_t_bits) p + space) & ~space);

this satisfies/implements the documented constraint directly.  it looks
like there are more of these types of changes required in struct.c (from
counting 7s), and possibly elsewhere.  and this is just for structs,
which are special-cased in practice.

   Would someone give me a hand to help me out? I searched quite a few
   days in codes but without results.  :(

it's a pretty cheesy suggestion, but: try the above fix first and see if
the problem goes away or is somehow statistically diminished.  in the
meantime, i'll go through struct.c and enforce this abstraction and will
post a diff when done.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]