From nobody@FreeBSD.org  Sat Mar 13 13:30:07 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3544316A4D0
	for <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <al_kotov@yahoo.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: libstdc++ on FreeBSD 5.2+ is non-usable in threaded apps
X-Send-Pr-Version: www-2.3

>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:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 13 13:30:18 PST 2004
>Closed-Date:    Wed Oct 05 03:37:56 GMT 2005
>Last-Modified:  Wed Oct 05 03:37:56 GMT 2005
>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 <pthread.h>

#include <string>
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:

From: "Alex Kotov" <al_kotov@yahoo.com>
To: <freebsd-gnats-submit@FreeBSD.org>
Cc:  
Subject: Re: gnu/64231: libstdc++ on FreeBSD 5.2+ is non-usable in threaded apps
Date: Mon, 15 Mar 2004 14:54:56 +0200

 Actually problem persists since FreeBSD 4.9-RELEASE at least.
 Both gcc 2.95.4 (as supplied) and gcc 3.3.3 are affected. Also stlport
 fix some symptoms but do not fix the problem itself.
 
 SY,
 Alex Kotov
 
State-Changed-From-To: open->closed 
State-Changed-By: rodrigc 
State-Changed-When: Wed Oct 5 03:35:41 GMT 2005 
State-Changed-Why:  
Cannot reproduce problem with gcc version 3.4.4 [FreeBSD] 20050518 

http://www.freebsd.org/cgi/query-pr.cgi?pr=64231 
>Unformatted:
