On 22/12/12(Sat) 19:01, Donovan Watteau wrote:
> On 10 Nov 2012, Donovan Watteau wrote:
> > On Tue, 17 Jul 2012, Donovan Watteau wrote:
> >> On Mon, 16 Jul 2012, Philip Guenther wrote:
> >>> On Mon, 16 Jul 2012, Donovan Watteau wrote:
> >>> > >Description:
> >>> > All threaded programs end up segfaulting on my B&W G3 (Rev 1).
> >>> > This makes most ports unusable, since a lot of ports use threads
> >>> > (or a library that links to them), i.e: they almost always crash
> >>> > at start-up.
> >>> >
> >>> > This looks specific to the G3 processor, as I'm surprised it
> >>> > hasn't been reported yet.
> >>> >
> >>> > Please see the output of base gdb [1] and gdb-7.4.1 from
> >>> > ports [2]. They come from the core-dump of the following
> >>> > "thread_eight" program.
> >>> > >How-To-Repeat:
> >>> > Here's how I tried to get some information from gdb:
> >>> > * Compile a threaded program (here, thread_eight.c [3])
> >>> > * Start compiling a port. If the machine is completely idle, the
> >>> > segfault is much harder to catch.
> >>> > * Repeatedly launch the binary. It should eventually crash and
> >>> > produce a core-dump.
> >>> > * Then, launch gdb (or egdb) on it to get some information.
> >>> ...
> >>> > #0 0x9129ef30 in pthread_self () at tcb.h:60
> >>> > 60 __asm__ ("lwzx %0, %%r2, %1" : "=r" (val) : "r"
> >>> > (offset));
> >>>
> >>> Can you show the output of "info regs" for that thread?
> >>
> >> Here you go:
> >>
> >> GNU gdb 6.3
> >> Copyright 2004 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 "powerpc-unknown-openbsd5.2"...
> >> Core was generated by `thread_eight'.
> >> Program terminated with signal 11, Segmentation fault.
> >> Reading symbols from /usr/lib/libpthread.so.16.0...done.
> >> Loaded symbols for /usr/lib/libpthread.so.16.0
> >> Reading symbols from /usr/lib/libc.so.65.0...done.
> >> Loaded symbols for /usr/lib/libc.so.65.0
> >> Reading symbols from /usr/libexec/ld.so...done.
> >> Loaded symbols for /usr/libexec/ld.so
> >> #0 0x9129ef30 in pthread_self () at tcb.h:60
> >> 60 __asm__ ("lwzx %0, %%r2, %1" : "=r" (val) : "r" (offset));
> >> (gdb) info regs
> >> Undefined info command: "regs". Try "help info".
> >> (gdb) info reg
> >> r0 0x4 4
> >> r1 0x8e8a0ea0 2391412384
> >> r2 0x9032 36914
> >> r3 0x1860de8 25562600
> >> r4 0x1810ba4 25234340
> >> r5 0x8e8a0f94 2391412628
> >> r6 0x86ca4100 2261401856
> >> r7 0x800 2048
> >> r8 0x2b 43
> >> r9 0x912e22f8 2435719928
> >> r10 0x891e5fd2 2300469202
> >> r11 0x9129e3f0 2435441648
> >> r12 0x24000024 603979812
> >> r13 0x0 0
> >> r14 0x0 0
> >> r15 0x0 0
> >> r16 0x0 0
> >> r17 0x8f040000 2399404032
> >> r18 0x30634 198196
> >> r19 0xffff6060 4294926432
> >> r20 0x1 1
> >> r21 0xffff6094 4294926484
> >> r22 0x0 0
> >> r23 0x15 21
> >> r24 0xffff609c 4294926492
> >> r25 0xffff6004 4294926340
> >> r26 0x5e 94
> >> r27 0x912c2064 2435588196
> >> r28 0x1860de8 25562600
> >> r29 0x1810ba4 25234340
> >> r30 0x912d2168 2435653992
> >> r31 0x8e8a0f94 2391412628
> >> pc 0x9129ef30 2435444528
> >> ps 0xd032 53298
> >> cr 0x24000024 603979812
> >> lr 0x912d2168 2435653992
> >> ctr 0x9129e3f0 2435441648
> >> xer 0x24000024 603979812
> >> fpscr 0x0 0
> >> vscr 0x0 0
> >> vrsave 0x0 0
> >> (gdb)
> >
> > I'm afraid to report that the exact same problem still exists on a
> > 8 November snapshot, which I reinstalled from scratch.
>
> FWIW, I'm still having the same issue with a 21 December snapshot.
I'm not sure this is related to (all) G3 processors. I can't reproduce
this behavior on my PowerBook G3 with:
cpu0 at mainbus0: 750 (Revision 0x8300): 400 MHz: 1MB backside cache
See below for a similar register output taken right after executing
TCB_THREAD() in pthread_self(). Without much investigation it looks
to me that the value in your %r2 register got truncated...
Martin
(gdb) info reg
r0 0x4 4
r1 0x8d88bea0 2374549152
r2 0x886d8150 2288877904
r3 0x8628e500 2250827008
r4 0x1810bd4 25234388
r5 0x8d88bf94 2374549396
r6 0x8628e500 2250827008
r7 0x20 32
r8 0x25 37
r9 0x841a1634 2216302132
r10 0x83fa4fd2 2214219730
r11 0x0 0
r12 0x24000024 603979812
r13 0x0 0
r14 0x0 0
r15 0x0 0
r16 0x0 0
r17 0x88230000 2283995136
r18 0x30648 198216
r19 0xffff2f90 4294913936
r20 0x1 1
r21 0xffff2fc4 4294913988
r22 0x0 0
r23 0x13 19
r24 0xffff2fcc 4294913996
r25 0xffff2f34 4294913844
r26 0x61 97
r27 0x841813c8 2216170440
r28 0x1860e18 25562648
r29 0x1810bd4 25234388
r30 0x841914a0 2216236192
r31 0x8d88bf94 2374549396
pc 0x8415c16c 2216018284
ps 0xd432 54322
cr 0x24000024 603979812
lr 0x841914a0 2216236192
ctr 0x8415d61c 2216023580
xer 0x24000024 603979812
fpscr 0x0 0
vscr 0x0 0
vrsave 0x0 0
[ using 511668 bytes of bsd ELF symbol table ]
console out [ATY,RageM3pA]console in [keyboard] , using ADB
using parent ATY,RageM3pParent:: memaddr b4000000 size 4000000, : consaddr b6008
000, : ioaddr b0020000, size 20000: memtag 8000, iotag 8000: width 1024 linebyte
s 1024 height 768 depth 8
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
Copyright (c) 1995-2012 OpenBSD. All rights reserved. http://www.OpenBSD.org
OpenBSD 5.2-current (GENERIC) #180: Mon Dec 10 13:41:39 CET 2012
[email protected]:/usr/src/sys/arch/macppc/compile/GENERIC
real mem = 603979776 (576MB)
avail mem = 570208256 (543MB)
mainbus0 at root: model PowerBook3,1
cpu0 at mainbus0: 750 (Revision 0x8300): 400 MHz: 1MB backside cache
mem0 at mainbus0
spdmem0 at mem0: 64MB SDRAM non-parity PC100CL3
spdmem1 at mem0: 512MB SDRAM non-parity PC100CL3
memc0 at mainbus0: uni-n rev 0x7
kiic0 at memc0 offset 0xf8001000
iic0 at kiic0
mpcpcibr0 at mainbus0 pci: uni-north, Revision 0xff
pci0 at mpcpcibr0 bus 0
pchb0 at pci0 dev 11 function 0 "Apple Uni-N AGP" rev 0x00
appleagp0 at pchb0
agp0 at appleagp0: aperture at 0x0, size 0x20000000
vgafb0 at pci0 dev 16 function 0 "ATI Mobility M3" rev 0x02, mmio
wsdisplay0 at vgafb0 mux 1: console (std, vt100 emulation)
mpcpcibr1 at mainbus0 pci: uni-north, Revision 0x0
pci1 at mpcpcibr1 bus 0
pchb1 at pci1 dev 11 function 0 "Apple Uni-N" rev 0x00
macobio0 at pci1 dev 23 function 0 "Apple Keylargo" rev 0x02
openpic0 at macobio0 offset 0x40000: version 0x4614 feature 3f0302 LE
macgpio0 at macobio0 offset 0x50
macgpio1 at macgpio0 irq 47
pgs0 at macgpio0: irq 55
"escc-legacy" at macobio0 offset 0x12000 not configured
zsc0 at macobio0 offset 0x13000: irq 22,23
zstty0 at zsc0 channel 0
zstty1 at zsc0 channel 1
awacs0 at macobio0 offset 0x14000: irq 24,9,10 speaker
audio0 at awacs0
"timer" at macobio0 offset 0x15000 not configured
adb0 at macobio0 offset 0x16000 irq 25: via-pmu, 3 targets
akbd0 at adb0 addr 2: iBook keyboard with inverted T (ISO layout)
wskbd0 at akbd0: console keyboard, using wsdisplay0
ams0 at adb0 addr 3: EMP trackpad <tpad> 2-button, 400 dpi
wsmouse0 at ams0 mux 0
abtn0 at adb0 addr 7: brightness/volume/eject buttons
apm0 at adb0: battery flags 0x5, 60% charged
"battery" at macobio0 offset 0x0 not configured
"backlight" at macobio0 offset 0xf300 not configured
kiic1 at macobio0 offset 0x18000
iic1 at kiic1
wdc0 at macobio0 offset 0x1f000 irq 19: DMA
wd0 at wdc0 channel 0 drive 0: <HTS548040M9AT00>
wd0: 16-sector PIO, LBA48, 38154MB, 78140160 sectors
wd0(wdc0:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 4
mediabay0 at macobio0 offset 0x34 irq 16
wdc1 at mediabay0 offset 0x20000 irq 20: DMA
atapiscsi0 at wdc1 channel 0 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <MATSHITA, DVD-ROM SR-8174, C113> ATAPI 5/cdrom re
movable
cd0(wdc1:0:0): using BIOS timings, DMA mode 2
wdc2 at macobio0 offset 0x21000 irq 21: DMA
wi0 at macobio0 offset 0x30000 irq 57:
wi0: Firmware 8.70 variant 1, address 00:30:65:19:8e:e1
ohci0 at pci1 dev 24 function 0 "Apple USB" rev 0x00: irq 27, version 1.0
ohci1 at pci1 dev 25 function 0 "Apple USB" rev 0x00: irq 28, version 1.0
cbb0 at pci1 dev 26 function 0 "TI PCI1211 CardBus" rev 0x00: irq 58
usb0 at ohci0: USB revision 1.0
uhub0 at usb0 "Apple OHCI root hub" rev 1.00/1.00 addr 1
usb1 at ohci1: USB revision 1.0
uhub1 at usb1 "Apple OHCI root hub" rev 1.00/1.00 addr 1
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 1 device 0 cacheline 0x8, lattimer 0x20
pcmcia0 at cardslot0
mpcpcibr2 at mainbus0 pci: uni-north, Revision 0x16
pci2 at mpcpcibr2 bus 0
pchb2 at pci2 dev 11 function 0 "Apple Uni-N Eth" rev 0x00
"Apple Uni-N Eth Firewire" rev 0x01 at pci2 dev 14 function 0 not configured
gem0 at pci2 dev 15 function 0 "Apple Uni-N GMAC" rev 0x01: irq 41, address 00:3
0:65:53:5f:de
bmtphy0 at gem0 phy 0: BCM5201 10/100 PHY, rev. 2
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
bootpath: /pci@f2000000/mac-io@17/ata-4@1f000/disk@0:/bsd
root on wd0a (edfd3ffdbde88c92.a) swap on wd0b dump on wd0b