From owner-freebsd-i386@FreeBSD.ORG Mon Jun 4 17:10:03 2007 Return-Path: X-Original-To: freebsd-i386@hub.freebsd.org Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AC09516A469 for ; Mon, 4 Jun 2007 17:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 6F8BA13C469 for ; Mon, 4 Jun 2007 17:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l54HA3i7084743 for ; Mon, 4 Jun 2007 17:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l54HA3JB084742; Mon, 4 Jun 2007 17:10:03 GMT (envelope-from gnats) Resent-Date: Mon, 4 Jun 2007 17:10:03 GMT Resent-Message-Id: <200706041710.l54HA3JB084742@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-i386@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Nathan Bates Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 18A6D16A46C for ; Mon, 4 Jun 2007 17:06:37 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id 09BC513C46E for ; Mon, 4 Jun 2007 17:06:37 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l54H6aRq027780 for ; Mon, 4 Jun 2007 17:06:36 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l54H6a7e027778; Mon, 4 Jun 2007 17:06:36 GMT (envelope-from nobody) Message-Id: <200706041706.l54H6a7e027778@www.freebsd.org> Date: Mon, 4 Jun 2007 17:06:36 GMT From: Nathan Bates To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: i386/113338: GNU gcc __thread as class member X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2007 17:10:03 -0000 >Number: 113338 >Category: i386 >Synopsis: GNU gcc __thread as class member >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jun 04 17:10:02 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Nathan Bates >Release: 6.2 >Organization: >Environment: FreeBSD amd64.intra.net 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 11:05:30 UTC 2007 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 >Description: This pertains to GNU gcc Thread Local Storage. http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Thread_002dLocal.html#Thread_002dLocal The storage class specifier "__thread" malfunctions if the thread-local variable is a C++ static class member. The variable apparently had a garbage value. The same code works ok on Linux. It will work ok on FreeBSD as an ordinary global variable (C extern linkage). I used g++ 3.4.6 on FreeBSD 6.2. >How-To-Repeat: Write pthreads code where two threads access a static class member in Thread Local Storage. >Fix: >Release-Note: >Audit-Trail: >Unformatted: