Subject: port-sparc/20537: New sparc kernels (on hypersparc?) can't run dynamically linked executables
To: None <gnats-bugs@gnats.netbsd.org>
From: None <he@netbsd.org>
List: netbsd-bugs
Date: 03/01/2003 17:46:57
>Number:         20537
>Category:       port-sparc
>Synopsis:       New sparc kernels (on hypersparc?) can't run dynamically linked executables
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-sparc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 01 08:48:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Havard Eidnes
>Release:        NetBSD 1.6P Feb 27 16:45 UTC
>Organization:
	Unorganized, Inc.
>Environment:
System: NetBSD grizzly.urc.uninett.no 1.6M NetBSD 1.6M (GENERIC.MP) #1: Sun Jan 26 21:31:33 CET 2003     he@grizzly.urc.uninett.no:/sys/arch/sparc/compile/GENERIC.MP sparc
Architecture: sparc
Machine: sparc
>Description:
	I have a dual hypersparc ss20 which is currently running 1.6M
	of Jan 26 vintage, both kernel and user-land.  It "mostly"
	works in MP mode, but that's not the problem I'm reporting
	here.

	Recently I've tried to upgrade the kernel to 1.6P of Feb 27
	vintage (initially trying with an uni-processor kernel to
	avoid any MP issues).  Booting the kernel single-user presents
	a problem starting the shell, though:

Enter pathname of shell or RETURN for sh: 
Mar  1 16:05:41 init: single user shell terminated, restarting
Enter pathname of shell or RETURN for sh: /bin/csh
Mar  1 16:06:23 init: single user shell terminated, restarting
Enter pathname of shell or RETURN for sh: 

	At this point, init is running, but the major difference
	between init and the Bourne shell (and csh) is that init is
	statically linked, while the two others are not.

grizzly: {1} file /sbin/init
/sbin/init: ELF 32-bit MSB executable, SPARC, version 1 (SYSV), for NetBSD, statically linked, stripped
grizzly: {2} file /bin/sh
/bin/sh: ELF 32-bit MSB executable, SPARC, version 1 (SYSV), for NetBSD, dynamically linked (uses shared libs), not stripped
grizzly: {3} ldd /bin/sh
/bin/sh:
         -ledit.2 => /lib/libedit.so.2
         -ltermcap.0 => /lib/libtermcap.so.0
         -lc.12 => /lib/libc.so.12
grizzly: {4} df /lib
Filesystem  1K-blocks     Used     Avail Capacity  Mounted on
/dev/sd0a       59623    33352     23289    58%    /
grizzly: {5} ls -lL /lib/libedit.so.2   
-r--r--r--  1 root  wheel  111802 Jan 21 15:33 /lib/libedit.so.2
grizzly: {6} file -L /lib/libedit.so.2
/lib/libedit.so.2: ELF 32-bit MSB shared object, SPARC, version 1 (SYSV), not stripped
grizzly: {7} ls -lL /lib/libtermcap.so.0
-r--r--r--  1 root  wheel  13296 Jan 21 15:46 /lib/libtermcap.so.0
grizzly: {8} file -L /lib/libtermcap.so.0
/lib/libtermcap.so.0: ELF 32-bit MSB shared object, SPARC, version 1 (SYSV), not stripped
grizzly: {9} ls -lL /lib/libc.so.12
-r--r--r--  1 root  wheel  854842 Jan 21 15:23 /lib/libc.so.12
grizzly: {10} file -L /lib/libc.so.12
/lib/libc.so.12: ELF 32-bit MSB shared object, SPARC, version 1 (SYSV), not stripped
grizzly: {11} 

	However, the new kernel *is* able to run the binaries from
	/rescue, all being "the same" statically linked program.

	Trying to run the normal shell (or apparently any dynamically
	linked program) results in an Abort trap and no core dump:

# export PATH=/rescue:$PATH
# mount
root_device on / type ffs (read-only, local)
# mount -u /
# /bin/sh
[1]   Abort trap              /bin/sh
# /bin/ls
[1]   Abort trap              /bin/ls
# /bin/csh
[1]   Abort trap              /bin/csh
# /bin/ksh
[1]   Abort trap              /bin/ksh
# 


	The boot messages for the two kernels are (failing kernel first):

Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 1.6P (GENERIC) #0: Thu Feb 27 19:54:05 CET 2003
    he@grizzly.urc.uninett.no:/sys/arch/sparc/compile/GENERIC
total memory = 255 MB
avail memory = 233 MB
using 896 buffers containing 13184 KB of memory
bootpath: /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
mainbus0 (root): SUNW,SPARCstation-20: hostid 72797978
cpu0 at mainbus0: mid 8: RT620/625 @ 150 MHz, on-chip FPU
cpu0: 512K byte write-back, 32 bytes/line, sw flush: cache enabled
cpu at mainbus0 not configured
obio0 at mainbus0
clock0 at obio0 slot 0 offset 0x200000: mk48t08
timer0 at obio0 slot 0 offset 0x300000: delay constant 73
zs0 at obio0 slot 0 offset 0x100000 level 12 softpri 6
zstty0 at zs0 channel 0 (console i/o)
zstty1 at zs0 channel 1
zs1 at obio0 slot 0 offset 0x0 level 12 softpri 6
kbd0 at zs1 channel 0: baud rate 1200
ms0 at zs1 channel 1: baud rate 1200
fdc0 at obio0 slot 0 offset 0x700000 level 11 softpri 4: chip 82077
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
auxreg0 at obio0 slot 0 offset 0x800000
power0 at obio0 slot 0 offset 0xa01000 level 2
iommu0 at mainbus0 ioaddr 0xe0000000: version 0x3/0x1, page-size 4096, range 64MB
sbus0 at iommu0: clock = 25 MHz
dma0 at sbus0 slot 15 offset 0x400000: dma rev 2
esp0 at dma0 slot 15 offset 0x800000 level 4: ESP200, 40MHz, SCSI ID 7
scsibus0 at esp0: 8 targets, 8 luns per target
ledma0 at sbus0 slot 15 offset 0x400010: dma rev 2
le0 at ledma0 slot 15 offset 0xc00000 level 6: address 08:00:20:79:79:78
le0: 8 receive buffers, 2 transmit buffers
bpp0 at sbus0 slot 15 offset 0x4800000 level 2 (ipl 3): dma rev 2
SUNW,DBRIe at sbus0 slot 14 offset 0x10000 level 9 not configured
cgsix0 at sbus0 slot 2 offset 0x0 level 9: SUNW,501-2325, 1152 x 900, rev 11
cgsix0: attached to /dev/fb
eccmemctl0 at mainbus0 ioaddr 0x0: version 0x0/0x2
Kernelized RAIDframe activated
scsibus0: waiting 2 seconds for devices to settle...
sd0 at scsibus0 target 1 lun 0: <QUANTUM, QM39100TD-SCA, N1K0> disk fixed
sd0: 8683 MB, 8057 cyl, 10 head, 220 sec, 512 bytes/sect x 17783249 sectors
sd0: sync (100.0ns offset 15), 8-bit (10.000MB/s) transfers, tagged queueing
sd1 at scsibus0 target 3 lun 0: <QUANTUM, QM39100TD-SCA, N1K0> disk fixed
sd1: 8683 MB, 8057 cyl, 10 head, 220 sec, 512 bytes/sect x 17783249 sectors
sd1: sync (100.0ns offset 15), 8-bit (10.000MB/s) transfers, tagged queueing
cd0 at scsibus0 target 6 lun 0: <TOSHIBA, XM-4101TASUNSLCD, 1755> cdrom removable
cd0: async, 8-bit transfers
root on sd0a dumps on sd0b
root file system type: ffs
Enter pathname of shell or RETURN for sh: 
Mar  1 16:05:41 init: single user shell terminated, restarting


	Working kernel:

Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 1.6M (GENERIC.MP) #1: Sun Jan 26 21:31:33 CET 2003
    he@grizzly.urc.uninett.no:/sys/arch/sparc/compile/GENERIC.MP
total memory = 255 MB
avail memory = 233 MB
using 896 buffers containing 13184 KB of memory
bootpath: /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
mainbus0 (root): SUNW,SPARCstation-20
cpu0 at mainbus0: mid 8: RT620/625 @ 150 MHz, on-chip FPU
cpu0: 512K byte write-back, 32 bytes/line, sw flush: cache enabled
cpu1 at mainbus0: mid 10: RT620/625 @ 150 MHz, on-chip FPU
cpu1: 512K byte write-back, 32 bytes/line, sw flush: cache enabled
obio0 at mainbus0
clock0 at obio0 slot 0 offset 0x200000: mk48t08: hostid 72797978
timer0 at obio0 slot 0 offset 0x300000: delay constant 73
zs0 at obio0 slot 0 offset 0x100000 level 12 softpri 6
zstty0 at zs0 channel 0 (console i/o)
zstty1 at zs0 channel 1
zs1 at obio0 slot 0 offset 0x0 level 12 softpri 6
kbd0 at zs1 channel 0: baud rate 1200
ms0 at zs1 channel 1: baud rate 1200
fdc0 at obio0 slot 0 offset 0x700000 level 11 softpri 4: chip 82077
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
auxreg0 at obio0 slot 0 offset 0x800000
power0 at obio0 slot 0 offset 0xa01000 level 2
iommu0 at mainbus0 ioaddr 0xe0000000: version 0x3/0x1, page-size 4096, range 64MB
sbus0 at iommu0: clock = 25 MHz
dma0 at sbus0 slot 15 offset 0x400000: dma rev 2
esp0 at dma0 slot 15 offset 0x800000 level 4: ESP200, 40MHz, SCSI ID 7
scsibus0 at esp0: 8 targets, 8 luns per target
ledma0 at sbus0 slot 15 offset 0x400010: dma rev 2
le0 at ledma0 slot 15 offset 0xc00000 level 6: address 08:00:20:79:79:78
le0: 8 receive buffers, 2 transmit buffers
bpp0 at sbus0 slot 15 offset 0x4800000 level 2 (ipl 3): dma rev 2
SUNW,DBRIe at sbus0 slot 14 offset 0x10000 level 9 not configured
cgsix0 at sbus0 slot 2 offset 0x0 level 9: SUNW,501-2325, 1152 x 900, rev 11
cgsix0: attached to /dev/fb
eccmemctl0 at mainbus0 ioaddr 0x0: version 0x0/0x2
Kernelized RAIDframe activated
scsibus0: waiting 2 seconds for devices to settle...
sd0 at scsibus0 target 1 lun 0: <QUANTUM, QM39100TD-SCA, N1K0> disk fixed
sd0: 8683 MB, 8057 cyl, 10 head, 220 sec, 512 bytes/sect x 17783249 sectors
sd0: sync (100.0ns offset 15), 8-bit (10.000MB/s) transfers, tagged queueing
sd1 at scsibus0 target 3 lun 0: <QUANTUM, QM39100TD-SCA, N1K0> disk fixed
sd1: 8683 MB, 8057 cyl, 10 head, 220 sec, 512 bytes/sect x 17783249 sectors
sd1: sync (100.0ns offset 15), 8-bit (10.000MB/s) transfers, tagged queueing
cd0 at scsibus0 target 6 lun 0: <TOSHIBA, XM-4101TASUNSLCD, 1755> cdrom removable
cd0: async, 8-bit transfers
root on sd0a dumps on sd0b
root file system type: ffs
cpu0: booting secondary processors: cpu1


>How-To-Repeat:
	Boot new kernel, watch it fail to run dynamically linked
	binaries.  Please note, user-land is unmodified between these
	two attempts ("of course").

>Fix:
	Sorry, don't know.
>Release-Note:
>Audit-Trail:
>Unformatted: