Subject: Re: compiler madness
To: None <eeh@netbsd.org>
From: Volker Stolz <stolz@hyperion.informatik.rwth-aachen.de>
List: port-sparc64
Date: 03/29/2002 12:26:41
Am 28. Mar 2002 um 18:30 MET schrieb eeh@netbsd.org:
> 1) How and when did you compile the innd that is segfaulting?

Hm, what do you mean by "when"? I hope the phase of the moon has
got nothing to do with it. I tried with and without optimization,
same result.

cc -DINET6 -O -g -I../include    -c timer.c
...
cc -Wl,-R/usr/pkg/lib -L/usr/pkg/lib  -o innd art.o cc.o chan.o his.o icd.o innd.o lc.o nc.o  newsfeeds.o ng.o perl.o proc.o python.o rc.o site.o  status.o tcl.o timer.o wip.o ../storage/libstorage.a ../lib/libinn.a    ../lib/perl.o -Wl,-whole-archive -lgcc -Wl,-no-whole-archive                         -Wl,-E -Wl,-R/usr/pkg/lib  -Wl,-R/usr/pkg/lib/perl5/5.6.1/sparc64-netbsd/CORE -Wl,-R/usr/pkg/lib  -L/usr/pkg/lib /usr/pkg/lib/perl5/5.6.1/sparc64-netbsd/auto/DynaLoader/DynaLoader.a -L/usr/pkg/lib/perl5/5.6.1/sparc64-netbsd/CORE -lperl -lm  -lresolv -lcrypt 

> 2) Can you provide a full register dump?  (I think info all-regs 
> should do it in gdb.)
> 3) Can you provide a full disassembly of the routine where the 
> dump is occuring?

I hope the following is sufficient:

GNU gdb 5.0nb1
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc64--netbsd"...
(gdb) set height 0
(gdb) set args -d
(gdb) run
Starting program: /usr/pkgsrc/news/inn/work.sparc64/inn-2.3.2/innd/./innd -d

Program received signal SIGSEGV, Segmentation fault.
0x1382a4 in TMRinit () at timer.c:70
70		count[i] = start[i] = cumulative[i] = 0;
(gdb) info all-registers
g0             0x0	0
g1             0x474	1140
g2             0x10b800	1095680
g3             0x29d800	2742272
g4             0x0	0
g5             0x0	0
g6             0x0	0
g7             0x0	0
o0             0x29daec	2743020
o1             0x10bab8	1096376
o2             0x29db24	2743076
o3             0x0	0
o4             0x0	0
o5             0x29d800	2742272
sp             0xffffffffffffcbf1	-13327
o7             0x138230	1278512
l0             0x1	1
l1             0x40a43020	1084502048
l2             0x40a43024	1084502052
l3             0x40a560e8	1084580072
l4             0x0	0
l5             0x0	0
l6             0x0	0
l7             0x40a4a180	1084531072
i0             0x29	41
i1             0x40a43028	1084502056
i2             0xffffffffffffd660	-10656
i3             0x0	0
i4             0x0	0
i5             0x0	0
fp             0xffffffffffffd4b0	-11088
i7             0x11c4d4	1164500
f0             1.875	(raw 0x3ff00000)	1
f1             0	(raw 0x00000000)
f2             0	(raw 0x00000000)	0
f3             0	(raw 0x00000000)
f4             0	(raw 0x00000000)	0
f5             0	(raw 0x00000000)
f6             0	(raw 0x00000000)	0
f7             0	(raw 0x00000000)
f8             0	(raw 0x00000000)	0
f9             0	(raw 0x00000000)
f10            0	(raw 0x00000000)	0
f11            0	(raw 0x00000000)
f12            0	(raw 0x00000000)	0
f13            0	(raw 0x00000000)
f14            0	(raw 0x00000000)	0
f15            0	(raw 0x00000000)
f16            0	(raw 0x00000000)	?.3588013433826612e-318
f17            4.35615488e-39	(raw 0x002f6f30)
f18            0	(raw 0x00000000)	?.4235041803620308e-318
f19            4.37450628e-39	(raw 0x002fa258)
f20            0	(raw 0x00000000)	?.2526760426559614e-318
f21            4.32605499e-39	(raw 0x002f1b48)
f22            0	(raw 0x00000000)	?.2500673760459196e-318
f23            4.3253151e-39	(raw 0x002f1938)
f24            0	(raw 0x00000000)	?.4227927258320194e-318
f25            4.3743045e-39	(raw 0x002fa1c8)
f26            0	(raw 0x00000000)	0
f27            0	(raw 0x00000000)
f28            0	(raw 0x00000000)	?.4216069682820004e-318
f29            4.37396818e-39	(raw 0x002fa0d8)
f30            0	(raw 0x00000000)	0
f31            0	(raw 0x00000000)
f32            =.5525961553162321e-318	(raw 0x000000000029db24)
f34            0	(raw 0x0000000000000000)
f36            0	(raw 0x0000000000000000)
f38            =.5486238675236684e-318	(raw 0x000000000029d800)
f40            -NaN(0xfffffffffcbf1)	(raw 0xffffffffffffcbf1)
f42            6.316688569957838e-318	(raw 0x0000000000138230)
f44            9.3872472709836843e-323	(raw 0x0000000000000013)
f46            0	(raw 0x0000000000000000)
f48            B.7968065465335594e-318	(raw 0x00000000003a0d64)
f50            B.0267953561770598e-318	(raw 0x000000000037ac98)
f52            9.3872472709836843e-323	(raw 0x0000000000000013)
f54            0	(raw 0x0000000000000000)
f56            0	(raw 0x0000000000000000)
f58            0	(raw 0x0000000000000000)
f60            0	(raw 0x0000000000000000)
f62            5.3663902167672575e-315	(raw 0x0000000040bda180)
pc             0x1382a4	1278628
npc            0x1382a8	1278632
ccr            0x44	68	xcc:NN,Z,NO,NC, icc:NN,Z,NO,NC
fsr            0x0	0	0:=, 1:=, 2:=, 3:=, rd:N, tem:0, ns:0, ver:0, ftt:0, qne:0, aexc:0, cexc:0
fprs           0x0	0	fef:0, du:0, dl:0
y              0x0	0
asi            0x82	130	ASI_PRIMARY_NOFAULT
ver            0x0	0	manuf:0, impl:0, mask:0, maxtl:0, maxwin:0
tick           0x0	0
pil            0x0	0
pstate         0x82	130	cle:0, tle:0, mm:rso, red:0, pef:0, am:0, priv:0, ie:1, ag:0
tstate         0x4482008204	294238847492
tba            0x0	0
tl             0x0	0
tt             0x0	0
tpc            0x0	0
tnpc           0x0	0
wstate         0x0	0	other:0, normal:0
cwp            0x4	4	4
cansave        0x0	0	0  before spill
canrestore     0x0	0	0  before fill
cleanwin       0x0	0	0  before clean
otherwin       0x0	0	0
asr16          0x0	0
asr17          0x0	0
asr18          0x0	0
asr19          0x0	0
asr20          0x0	0
asr21          0x0	0
asr22          0x0	0
asr23          0x0	0
asr24          0x0	0
asr25          0x0	0
asr26          0x0	0
asr27          0x0	0
asr28          0x0	0
asr29          0x0	0
asr30          0x0	0
asr31          0x0	0
icc            0x0	0
xcc            0x0	0
fcc0           0x0	0
fcc1           0x0	0
fcc2           0x0	0
fcc3           0x0	0
(gdb) p i
$1 = 0
(gdb) p count
$2 = {0 <repeats 13 times>}
(gdb) p start
$3 = {285212672, 150997485, 2417106944, 2282823688, 2435461152, 2282815496, 
  2282749952, 3155165184, 2416158847, 2450522113, 2450522115, 2484076546, 
  273154052}
(gdb) p cumulative
$4 = {0 <repeats 13 times>}
(gdb) disas
Dump of assembler code for function TMRinit:
0x13822c <TMRinit>:	save  %sp, -192, %sp
0x138230 <TMRinit+4>:	call  0x138170 <gettime>
0x138234 <TMRinit+8>:	nop 
0x138238 <TMRinit+12>:	sethi  %hi(0), %o1
0x13823c <TMRinit+16>:	sethi  %hi(0x29d800), %o2
0x138240 <TMRinit+20>:	mov  %o1, %o1
0x138244 <TMRinit+24>:	sllx  %o1, 0x20, %o1
0x138248 <TMRinit+28>:	add  %o1, %o2, %o1
0x13824c <TMRinit+32>:	st  %o0, [ %o1 + 0x320 ]
0x138250 <TMRinit+36>:	clr  %o4
0x138254 <TMRinit+40>:	sethi  %hi(0x29d800), %g3
0x138258 <TMRinit+44>:	sethi  %hi(0x10b800), %g2
0x13825c <TMRinit+48>:	sethi  %hi(0x29d800), %o5
0x138260 <TMRinit+52>:	sethi  %hi(0), %o2
0x138264 <TMRinit+56>:	mov  %o2, %o2	! 0x0
0x138268 <TMRinit+60>:	sllx  %o2, 0x20, %o2
0x13826c <TMRinit+64>:	add  %o2, %g3, %o2
0x138270 <TMRinit+68>:	or  %o2, 0x324, %o2
0x138274 <TMRinit+72>:	sllx  %o4, 2, %o3
0x138278 <TMRinit+76>:	sethi  %hi(0), %o1
0x13827c <TMRinit+80>:	mov  %o1, %o1	! 0x0
0x138280 <TMRinit+84>:	sllx  %o1, 0x20, %o1
0x138284 <TMRinit+88>:	add  %o1, %g2, %o1
0x138288 <TMRinit+92>:	or  %o1, 0x2b8, %o1
0x13828c <TMRinit+96>:	sethi  %hi(0), %o0
0x138290 <TMRinit+100>:	mov  %o0, %o0	! 0x0
0x138294 <TMRinit+104>:	sllx  %o0, 0x20, %o0
0x138298 <TMRinit+108>:	add  %o0, %o5, %o0
0x13829c <TMRinit+112>:	or  %o0, 0x2ec, %o0
0x1382a0 <TMRinit+116>:	clr  [ %o3 + %o0 ]
0x1382a4 <TMRinit+120>:	clr  [ %o3 + %o1 ]
0x1382a8 <TMRinit+124>:	add  %o4, 1, %o0
0x1382ac <TMRinit+128>:	sra  %o0, 0, %o4
0x1382b0 <TMRinit+132>:	cmp  %o4, 0xc
0x1382b4 <TMRinit+136>:	ble  %icc, 0x138260 <TMRinit+52>
0x1382b8 <TMRinit+140>:	clr  [ %o2 + %o3 ]
0x1382bc <TMRinit+144>:	rett  %i7 + 8
0x1382c0 <TMRinit+148>:	nop 
End of assembler dump.
(gdb) q
The program is running.  Exit anyway? (y or n) 
-- 
Wonderful \hbox (0.80312pt too nice) in paragraph at lines 16--18
Volker Stolz * stolz@i2.informatik.rwth-aachen.de
Please use PGP or S/MIME for correspondence!