From owner-freebsd-bugs@FreeBSD.ORG Sat Mar 13 13:30:18 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA1B916A4CE for ; Sat, 13 Mar 2004 13:30:18 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA63B43D1D for ; Sat, 13 Mar 2004 13:30:18 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i2DLUIbv061995 for ; Sat, 13 Mar 2004 13:30:18 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i2DLUIae061990; Sat, 13 Mar 2004 13:30:18 -0800 (PST) (envelope-from gnats) Resent-Date: Sat, 13 Mar 2004 13:30:18 -0800 (PST) Resent-Message-Id: <200403132130.i2DLUIae061990@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alex Kotov Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3544316A4D0 for ; Sat, 13 Mar 2004 13:30:07 -0800 (PST) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3009F43D31 for ; Sat, 13 Mar 2004 13:30:07 -0800 (PST) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.10/8.12.10) with ESMTP id i2DLU772018754 for ; Sat, 13 Mar 2004 13:30:07 -0800 (PST) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.10/8.12.10/Submit) id i2DLU7IK018753; Sat, 13 Mar 2004 13:30:07 -0800 (PST) (envelope-from nobody) Message-Id: <200403132130.i2DLU7IK018753@www.freebsd.org> Date: Sat, 13 Mar 2004 13:30:07 -0800 (PST) From: Alex Kotov To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: gnu/64231: libstdc++ on FreeBSD 5.2+ is non-usable in threaded apps X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Mar 2004 21:30:19 -0000 >Number: 64231 >Category: gnu >Synopsis: libstdc++ on FreeBSD 5.2+ is non-usable in threaded apps >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Mar 13 13:30:18 PST 2004 >Closed-Date: >Last-Modified: >Originator: Alex Kotov >Release: 5.2.1-RELEASE >Organization: n/a >Environment: FreeBSD some.hostname.com 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #0: Fri Mar 12 11:10:30 EST 2004 root@:/usr/src/sys/i386/compile/BACKUP i386 >Description: Using libstdc++ with threaded apps leads to segmentation faults if application is statically linked and misterious hangs if application is dynamically linked (actually supplied example illustrate only first problem - second problem requires much more code for demonstration). >How-To-Repeat: // BUILD: gcc -pthread -D_THREAD_SAFE test.cc -o test -lstdc++ -static // AND TRY TO START IT! #include #include using namespace std; volatile int a = 0; void *threadproc( void *arg ) { for( int i = 0; i < 10000; i++ ) { a++; } return NULL; } int main( int argc, char *argv[] ) { pthread_t tt; // oops... int r = pthread_create( &tt, NULL, threadproc, 0 ); sleep( 10 ); return 0; } >Fix: Properly compiled stlport should be used in threaded apps until mantainers will fix the problem. >Release-Note: >Audit-Trail: >Unformatted: