[676] in Zephyr_Bugs

home help back first fref pref prev next nref lref last post

Bug report: DEC Alpha OSF 3.2

daemon@ATHENA.MIT.EDU (garvin@eos.ncsu.edu)
Fri Aug 4 09:58:57 1995

From: garvin@eos.ncsu.edu
To: bug-zephyr@MIT.EDU
Date: Fri, 4 Aug 1995 09:58:53 -0400 (EDT)
Cc: garvin@eos.ncsu.edu (Michael Arthur Garvin), mbcaudi@eos.ncsu.edu,
        camattin@eos.ncsu.edu, chuck@eos.ncsu.edu

Platform:
     DEC Alpha, OSF 3.2

Release:
     Zephyr 2.0.2 (athena-dist.mit.edu, dist dir)

Problem:
     zwrite intermittently fails, and zlocate always fails with:

	zlocate: Unknown code zeph 8 while locating user garvin@EOS.NCSU.EDU

Cause:
     Under OSF 3.2 longs are now 64 bits, ints are 32.  "zephyr_err.h" is
     created using longs, so the value stored is greater than a signed int can
     contain.  Checks in the code are typically against return values that are
     stored in 32-bit signed ints, thus the 64-bit define will be "rolled over"
     from positive to negative in the int, and the check will fail.

     The error comes from lib/zephyr/ZWait4Not.c, lines 39-40:

	if (retval != ZERR_NONOTICE)
	  return retval;

     where retval is a 32-bit signed int (thus negative) and ZERR_NONOTICE is a
     64-bit long (the correct positive signed value, since the 64 bit long can
     hold it).

Solution:
     Uncertain.  I was unable to come up with a good method for casting longs
     as ints, as OSF uses longs properly and this breaks intrinsic functions.
     The long-term solution is to correct the data type inconsistencies since
     this 32-bit/64-bit issue will come up more frequently in the future.

     My hack to get things working was to take the "zephyr_err.h" from an IBM
     RS/6000 (which used 32-bit signed ints, and thus had the negative values)
     and recompile the code using it.  Proper operation was achieved.

And thanks:
     Your efforts are appreciated.  This has allowed us to build a native
     version for the Alpha for the first time.  Thanks!

-- 
| Michael Garvin    \    North Carolina State University College of Engineering
| Systems Programmer \   Information Technology & Engineering Computer Services
| garvin@eos.ncsu.edu \  5 Page Hall, Box 7901 NCSU Campus,  Raleigh,  NC 27695
| (919) 515-5323       \                  http://www.eos.ncsu.edu/staff/garvin/

home help back first fref pref prev next nref lref last post