Bug#203434: libc6: accessing thread-local storage causes SIGSEGV
Package: libc6
Version: 2.3.1-17
Severity: normal
gcc-3.3.1 understands a syntax for declaring C global variables with
thread-local storage. Programs using this extension compile and link
fine, but fail at run time. As soon as a program accesses or takes
the address of any piece of thread-local storage, the program fails
with a segmentation fault (SIGSEGV).
To reproduce the problem, compile the following simple program. No
special command line flags are needed:
__thread int x;
int main()
{
x = 0;
return 0;
}
Run the program, and observe that it dies with SIGSEGV. Taking the
address of a variable with thread-local storage exhibits the same
problem.
My understanding is that while GCC has to generate the right code,
thread-local storage also requires support from the linker, run-time
loader, and C library. I'm reporting this against libc6 on the
assumption that either libc itself or the loader (/lib/ld-2.3.1.so) is
at fault. It's possible, though, that the problem is elsewhere.
For the record, I'm also using binutils 2.14.90.0.5-0.1 and gcc 3.3-2,
all on Debian unstable.
-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux brawnix 2.4.18-bf2.4 #1 Son Apr 14 09:53:28 CEST 2002 i686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8
Versions of packages libc6 depends on:
ii libdb1-compat 2.1.3-7 The Berkeley database routines [gl
-- no debconf information
Reply to: