On Mon, 16 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)
> 

Back to this... now that my G3 doesn't have a dying 3GB hard-drive
anymore.

The problem is still here on -current.  OpenBSD 5.1 (just before the
switch to rthreads) works nicely, though.

A very reproduceable way of seeing this crash is to launch fw_update
on -current, now that Perl has threads enabled.  It always segfaults
at startup.  Any B&W G3 user to confirm this?  I guess it could be
a processor errata; knowing that someone else has the same problem
with the same processor might help...

If there's anything I can try, patch, or build, please let me know.
There are some others problems with Xorg and some ports forcing Altivec,
not having this bug would help fixing other problems.

Thanks.

$ sysctl hw.model
hw.model=750 (Revision 0x202)

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.4"...
Core was generated by `thread_eight'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libpthread.so.18.0...done.
Loaded symbols for /usr/lib/libpthread.so.18.0
Reading symbols from /usr/lib/libc.so.71.0...done.
Loaded symbols for /usr/lib/libc.so.71.0
Reading symbols from /usr/libexec/ld.so...done.
Loaded symbols for /usr/libexec/ld.so
#0  0x829540a0 in __errno () at tcb.h:60
60              __asm__ ("lwzx %0, %%r2, %1" : "=r" (val) : "r" (offset));
(gdb) bt
#0  0x829540a0 in __errno () at tcb.h:60
#1  0x89180ad4 in free (ptr=0x8751a260)
    at /usr/src/lib/libc/stdlib/malloc.c:1235
#2  0x82953e64 in _rthread_reaper () at /usr/src/lib/librthread/rthread.c:279
#3  0x82954a24 in pthread_join (thread=0x8ea4b900, retval=0x0)
    at /usr/src/lib/librthread/rthread.c:364
#4  0x01800b30 in main () at thread_eight.c:30
(gdb) bt full
#0  0x829540a0 in __errno () at tcb.h:60
No locals.
#1  0x89180ad4 in free (ptr=0x8751a260)
    at /usr/src/lib/libc/stdlib/malloc.c:1235
        saved_errno = Variable "saved_errno" is not available.
(gdb) info reg
r0             0x82953e64       2190818916
r1             0xfffdb440       4294816832
r2             0x9032   36914
r3             0x8751a260       2270274144
r4             0x41000  266240
r5             0x8ea4b900       2393159936
r6             0x878a42e0       2273985248
r7             0x829bc29c       2191245980
r8             0xe3     227
r9             0x4      4
r10            0x8ea4b958       2393160024
r11            0x82954098       2190819480
r12            0x24000024       603979812
r13            0x0      0
r14            0x0      0
r15            0x0      0
r16            0x0      0
r17            0x89ab0000       2309685248
r18            0x3064c  198220
r19            0xfffdb560       4294817120
r20            0x1      1
r21            0xfffdb58c       4294817164
r22            0x0      0
r23            0xfffdb594       4294817172
r24            0xfffdb58c       4294817164
r25            0x1      1
r26            0x0      0
r27            0x82969ae0       2190908128
r28            0x8751a260       2270274144
r29            0x8297a014       2190974996
r30            0x891c2a98       2300324504
r31            0x8ea4b900       2393159936
pc             0x829540a0       2190819488
ps             0xd032   53298
cr             0x24000028       603979816
lr             0x89180ad4       2300054228
ctr            0x82954098       2190819480
xer            0x24000028       603979816
fpscr          0x0      0
vscr           0x0      0
vrsave         0x0      0

[ using 552996 bytes of bsd ELF symbol table ]
console out [ATY,Rage128y]console in [keyboard] USB and ADB found, using ADB
: memaddr 88000000 size 8000000, : consaddr 88000000, : ioaddr 80920000, size 
20000: width 640 linebytes 640 height 480 depth 8
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2013 OpenBSD. All rights reserved.  http://www.OpenBSD.org

OpenBSD 5.4-current (GENERIC) #95: Thu Dec  5 19:38:10 MST 2013
    [email protected]:/usr/src/sys/arch/macppc/compile/GENERIC
real mem = 536870912 (512MB)
avail mem = 509853696 (486MB)
mainbus0 at root: model PowerMac1,1
cpu0 at mainbus0: 750 (Revision 0x202): 350 MHz: 1MB backside cache
mem0 at mainbus0
mpcpcibr0 at mainbus0 pci: grackle
pci0 at mpcpcibr0 bus 0
ppb0 at pci0 dev 13 function 0 "DEC 21154" rev 0x02
pci1 at ppb0 bus 1
macobio0 at pci1 dev 5 function 0 "Apple Paddington" rev 0x00
macintr0 at macobio0 offset 0x10
mesh0 at macobio0 offset 0x10000 irq 12: 50MHz
scsibus0 at mesh0: 8 targets, initiator 7
"escc-legacy" at macobio0 offset 0x12000 not configured
zsc0 at macobio0 offset 0x13000: irq 15,16
zstty0 at zsc0 channel 0
zstty1 at zsc0 channel 1
awacs0 at macobio0 offset 0x14000: irq 17,8,9 headphones
audio0 at awacs0
"power-mgt" at macobio0 offset 0x0 not configured
"fdc" at macobio0 offset 0x15000 not configured
adb0 at macobio0 offset 0x16000: irq 18, via-cuda, 0 targets
wdc0 at macobio0 offset 0x20000 irq 13: DMA
atapiscsi0 at wdc0 channel 0 drive 0
scsibus1 at atapiscsi0: 2 targetS
cd0 at scsibus1 targ 0 lun 0: <GoldStar, CD-ROM CRD-8322B, 1.02> ATAPI 5/cdrom 
removable
cd0(wdc0:0:0): using BIOS timings, DMA mode 2
bm0 at macobio0 offset 0x11000 irq 42,33: address XXXXXXXX
lxtphy0 at bm0 phy 0: LXT970 10/100 PHY, rev. 1
"nvram" at macobio0 offset 0x60000 not configured
"TI TSB12LV21 FireWire" rev 0x02 at pci1 dev 0 function 0 not configured
pciide0 at pci1 dev 1 function 0 "CMD Technology PCI0646" rev 0x05: DMA, 
channel 0 configured to native-PCI, channel 1 configured to native-PCI
pciide0: using irq 26 for native-PCI interrupt
wd0 at pciide0 channel 0 drive 0: <ST380011A>
wd0: 16-sector PIO, LBA48, 76319MB, 156301488 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2
pciide0: channel 1 ignored (disabled)
ahc0 at pci1 dev 2 function 0 "Adaptec AIC-7850" rev 0x03: irq 23
scsibus2 at ahc0: 8 targets, initiator 7
ohci0 at pci1 dev 6 function 0 "Opti 82C861" rev 0x10: irq 28, version 1.0, 
legacy support
usb0 at ohci0: USB revision 1.0
uhub0 at usb0 "Opti OHCI root hub" rev 1.00/1.00 addr 1
vgafb0 at pci0 dev 16 function 0 "ATI Rage 128" rev 0x00, mmio
wsdisplay0 at vgafb0 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
uhidev0 at uhub0 port 2 configuration 1 interface 0 "vendor 0x04f3 product 
0x0103" rev 1.10/1.07 addr 2
uhidev0: iclass 3/1
ukbd0 at uhidev0: 8 variable keys, 6 key codes
wskbd0 at ukbd0 mux 1
wskbd0: connecting to wsdisplay0
uhidev1 at uhub0 port 2 configuration 1 interface 1 "vendor 0x04f3 product 
0x0103" rev 1.10/1.07 addr 2
uhidev1: iclass 3/0, 2 report ids
uhid0 at uhidev1 reportid 1: input=2, output=0, feature=0
uhid1 at uhidev1 reportid 2: input=1, output=0, feature=0
vscsi0 at root
scsibus3 at vscsi0: 256 targets
softraid0 at root
scsibus4 at softraid0: 256 targets
bootpath: /pci/@d/pci-ata@1/ata-4@0/disk@0:/bsd
root on wd0a (c2143c0cddef5bee.a) swap on wd0b dump on wd0b

Reply via email to