This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgomp/52738] New: libgomp configured with --enable-tls=no crash inside pthread function
- From: "matek09 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 27 Mar 2012 14:11:13 +0000
- Subject: [Bug libgomp/52738] New: libgomp configured with --enable-tls=no crash inside pthread function
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52738
Bug #: 52738
Summary: libgomp configured with --enable-tls=no crash inside
pthread function
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libgomp
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: matek09@gmail.com
I configured libgomp with --enable-tls=no and build it as static library. But I
get segmentation fault when I use such OpenMP inside Pthread funcion.
gomp_thread inline function from libgomp.h uses pthread_getspecific and it
returns null. Then this null value is used in context where null is not
allowed. Also in team.c when HAVE_TLS is not defined there is such code:
struct gomp_thread local_thr;
thr = &local_thr;
pthread_setspecific (gomp_tls_key, thr);
Is it safe to remember address of local variable? In team.c without HAVE_TLS
such pthread_setspecific is used multiple times.
When I use the same static library with --enable-tls=yes there is no such
problem. I think there is general problem with OpenMP without TLS and Pthreads.