[OpenAFS-devel] 1.3.73 on Solaris 9 x86

Christopher D. Clausen cclausen@acm.org
Mon, 8 Nov 2004 20:31:26 -0600


I attempted to build Openafs 1.3.73 on Solaris 9 x86 using the newest 
Sun Studio tools:
$ cc -V
cc: Sun C 5.6 2004/07/15

I get unresovled symbol errors in liblwp.a:

/opt/SUNWspro/bin/cc -I. -I.  -I/afs/acm.uiuc.edu/scratch/openafs-1.3.73/src/config 
 -I/afs/acm.uiuc.edu/scratch/openafs-1.3.73/include  -dy -Bdynamic -o 
rmtsysd rmtsysd.o libsys.a 
/afs/acm.uiuc.edu/scratch/openafs-1.3.73/lib/librx.a libsys.a 
/afs/acm.uiuc.edu/scratch/openafs-1.3.73/lib/liblwp.a 
/afs/acm.uiuc.edu/scratch/openafs-1.3.73/lib/util.a -lresolv -lsocket -lnsl 
 -lintl -ldl
Undefined                       first referenced
 symbol                             in file
savecontext 
/afs/acm.uiuc.edu/scratch/openafs-1.3.73/lib/liblwp.a(lwp.o)
returnto 
/afs/acm.uiuc.edu/scratch/openafs-1.3.73/lib/liblwp.a(lwp.o)
ld: fatal: Symbol referencing errors. No output written to rmtsysd
*** Error code 1
make: Fatal error: Command failed for target `rmtsysd'
Current working directory 
/afs/acm.uiuc.edu/scratch/openafs-1.3.73/src/sys
*** Error code 1
make: Fatal error: Command failed for target `sys'
Current working directory /afs/acm.uiuc.edu/scratch/openafs-1.3.73
*** Error code 1
make: Fatal error: Command failed for target `build'
Current working directory /afs/acm.uiuc.edu/scratch/openafs-1.3.73
*** Error code 1
make: Fatal error: Command failed for target `all'

These errors can be avoided by manually running the follwoing:
% /usr/ccs/lib/cpp -P -D__i386 -DIGNORE_STDS_H -I. process.i386.s 
process.ss
% vi process.ss (change all _<name> entries to <name> entries.)
% as -o process.o process.ss
% ar crv liblwp.a lwp.o process.o lock.o iomgr.o timer.o fasttime.o 
preempt.o  waitkey.o threadname.o AFS_component_version_number.o
% ranlib liblwp.a
% /afs/acm.uiuc.edu/scratch/openafs-1.3.73/src/pinstall/pinstall 
liblwp.a /afs/acm.uiuc.edu/scratch/openafs-1.3.73/lib/liblwp.a

So, I assume there is a slight logic problem in the Makefile or in one 
of the files included by process.i386.s.  If I track it down further 
I'll submit a patch.  Right now the exact problem has eluded me.

But, besides that, the built server binaries (pt, vl, etc.) all dump 
core after segfaulting.  Log files were not helpful.

truss showed something of value (these are similar to the errors I got 
from building 1.2.13 on the same machine):

Incurred fault #6, FLTBOUNDS  %pc = 0x080C2770
 siginfo: SIGSEGV SEGV_MAPERR addr=0xF80473DF
Received signal #11, SIGSEGV [default]
 siginfo: SIGSEGV SEGV_MAPERR addr=0xF80473DF

# adb core
core file = core -- program ``/usr/afs/bin/fileserver'' on platform 
i86pc
0x080C2770/i
fc_ecb_encrypt+0x12a:           movzbl  +0xf0000003(%ebp),%eax

---------------------------------

Incurred fault #6, FLTBOUNDS  %pc = 0x0808D4AB
 siginfo: SIGSEGV SEGV_MAPERR addr=0x00000003
Received signal #11, SIGSEGV [default]
 siginfo: SIGSEGV SEGV_MAPERR addr=0x00000003

# adb core
core file = core -- program ``/usr/afs/bin/vlserver'' on platform i86pc
 0x0808D4AB/i
des_ecb_encrypt+0x4fb:          movzbl  (%ebx),%ebx

It looks like problems in the *_ecb_encrypt functions?  Possible due to 
optimization changes in the Sun compiler?  Any suggestions?  Am I 
completely wrong?  (I don't have an older x86 compiler to test with, 
although I supose there might be one on Sun's site.)

I'm going to try building on sparc with the newest Sun Studio tools as a 
point of comparison, but I imagine this is an x86 specific problem. 
I'll also try configuring with --disable-optimize and see if that helps.

<<CDC
Christopher D. Clausen
ACM@UIUC SysAdmin