Resend (did not see this coming in on http://marc.info/?l=openbsd-bugs).

----- Forwarded message from Juha Erkkilä <[email protected]> -----

Date: Thu, 3 Jan 2013 21:47:08 +0200 (EET)
From: Juha Erkkilä <[email protected]>
To: [email protected]
Cc: Juha Erkkilä <[email protected]>
Subject: g++ with -pthread triggers C++ input streams bug (zaurus)

>Synopsis:       g++ with -pthread triggers C++ input streams bug
>Category:       user arm
>Environment:
        System      : OpenBSD 5.2
        Details     : OpenBSD 5.2-current (GENERIC) #0: Mon Dec 31 06:13:27 EET 
2012
                         
[email protected]:/sources/src/sys/arch/zaurus/compile/GENERIC

        Architecture: OpenBSD.zaurus
        Machine     : zaurus
>Description:

Compiling code with g++ and -pthread command line option produces
unexpected results on zaurus (and arm, generally?).  Practically
speaking is seems that C++ input streams are unusable.

I ran into this problem while trying to get the emulators/dosbox
port working on zaurus.  I can not reproduce the issue on i386.
The bug appears to exist on a -current code at least on late September
as well as early December (2012) (I have not tried later code).

>How-To-Repeat:

Use the following Makefile and C++ code to compile two binaries
and run them.  I would expect that both binaries should print
"Everything OK!" (which is the behaviour on i386), but on zaurus
the version without "-pthread" prints "Everything OK!" and
the version with "-pthread" prints "BUG!".

-- Makefile
all: testprog testprog-pthreads

testprog: testprog.cpp
        g++ -o $@ $>

testprog-pthreads: testprog.cpp
        g++ -pthread -o $@ $>
--

-- testprog.cpp
#include <fstream>
#include <stdio.h>

int
main(void)
{
        std::ifstream in("/");

        printf("%s!\n", !in ? "BUG" : "Everything OK");

        return 0;
}
--

>Fix:

No idea.


dmesg:
OpenBSD 5.2-current (GENERIC) #0: Mon Dec 31 06:13:27 EET 2012
    [email protected]:/sources/src/sys/arch/zaurus/compile/GENERIC
real mem  = 67108864 (64MB)
avail mem = 58392576 (55MB)
mainbus0 at root
cpu0 at mainbus0: PXA27x step C-5 (XScale core)
cpu0: DC enabled IC enabled WB enabled LABT branch prediction enabled
cpu0: 32KB(32b/l,32way) I-cache, 32KB(32b/l,32way) wr-back-lock D-cache
pxaip0 at mainbus0: CPU clock = 416.001 MHz
pxaintc0 at pxaip0 addr 0x40d00000: Interrupt Controller
pxagpio0 at pxaip0 addr 0x40e00000: GPIO Controller
pxadmac0 at pxaip0 addr 0x40000000 intr 25: DMA Controller
pxaost0 at pxaip0 addr 0x40a00000
com0 at pxaip0 addr 0x40100000 intr 22: pxa2x0, 32 byte fifo
com1 at pxaip0 addr 0x40200000 intr 21: pxa2x0, 32 byte fifo
com2 at pxaip0 addr 0x40700000 intr 20: pxa2x0, 32 byte fifo (SIR)
ohci0 at pxaip0, version 1.0
usb0 at ohci0: USB revision 1.0
uhub0 at usb0 "PXA27x OHCI root hub" rev 1.00/1.00 addr 1
lcd0 at pxaip0
wsdisplay0 at lcd0 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1 added (std, vt100 emulation)
zkbd0 at pxaip0
wskbd0 at zkbd0: console keyboard, using wsdisplay0
scoop0 at pxaip0: PCMCIA/GPIO controller
scoop1 at pxaip0: PCMCIA/GPIO controller
pxapcic0 at pxaip0: 2 slots
pcmcia0 at pxapcic0
pcmcia1 at pxapcic0
pxammc0 at pxaip0: MMC/SD/SDIO controller
sdmmc0 at pxammc0
zssp0 at pxaip0
apm0 at pxaip0
zts0 at pxaip0
wsmouse0 at zts0 mux 0
zaudio0 at pxaip0: I2C, I2S, WM8750 Audio
audio0 at zaudio0
zrc0 at pxaip0: CE-RH2 remote control
wskbd1 at zrc0 mux 1
wskbd1: connecting to wsdisplay0
flash0 at pxaip0: Samsung K9F1G08U0A 128Mx8 3.3V
pxaudc0 at pxaip0: USB Device Controller
usbf0 at pxaudc0: USB revision 1.1
cdcef0 at usbf0: address 2a:cb:00:00:00:00
wdc0 at pcmcia0 function 0 "KINGSTON, ULTIMATE  CF CARD 32GB, " port 0x0/16: 
irq 138
wd0 at wdc0 channel 0 drive 0: <ULTIMATE CF CARD 32GB>
wd0: 1-sector PIO, LBA, 30079MB, 61602912 sectors
wd0(wdc0:0:0): using BIOS timings
vscsi0 at root
scsibus0 at vscsi0: 256 targets
softraid0 at root
scsibus1 at softraid0: 256 targets
boot device: wd0
root on wd0a swap on wd0b dump on wd0b

usbdevs:

----- End forwarded message -----

Reply via email to