Bug 76484 - Threads support is broken if glibc is linked statically with program
Threads support is broken if glibc is linked statically with program
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2002-10-22 06:17 EDT by Leonid Kanter
Modified: 2016-11-24 10:17 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-11-10 07:46:19 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Leonid Kanter 2002-10-22 06:17:32 EDT
Description of Problem:

If user program is linked with glibc statically, locale support will not be
initialised properly in threads. As a result, application doesn't work properly.

Version-Release number of selected component (if applicable):

2.2.93-5, 2.3-2

How Reproducible:


Additional Information:
This patch fixes the problem:
--- glibc-2.3/linuxthreads/manager.c.orig	Wed Aug 28 10:07:50 2002
+++ glibc-2.3/linuxthreads/manager.c	Tue Oct 22 11:29:37 2002
@@ -283,7 +283,7 @@
       __sched_setscheduler(THREAD_GETMEM(self, p_pid),
                            SCHED_OTHER, &default_params);
-#if !(USE_TLS && HAVE___THREAD) && defined SHARED
+#if !(USE_TLS && HAVE___THREAD)
   /* Initialize thread-locale current locale to point to the global one.
      With __thread support, the variable's initializer takes care of this.  */
   __uselocale (LC_GLOBAL_LOCALE);

BTW, this is the only place in manager.c when "&& define SHARED" is used with
!(USE_TLS && HAVE___THREAD). Is it really needed here?
Comment 1 William Shubert 2002-11-09 21:14:37 EST
This bug is currently biting me very badly. I have a deployed system running red
hat 7.1. I have upgraded my compile system to red hat 8.0. I now cannot compile
my application for my deployed system - compiling without "-static" gives me
binaries that won't run because the 7.1 system is missing the needed .so files,
compiling with "-static" gives me a binary that crashes whenever I call a
function that uses locale! Ouch!

Time to try moving the RH7.1 glibc.so files onto the 8.0 system, so I can link
dynamically...I'll keep my fingers crossed. But it would be great to get a fix
so "-static" works again.
Comment 2 Jakub Jelinek 2002-11-10 07:46:12 EST
It is fixed in rawhide glibc for quite some time.
It will surely make into errata when it is released.

Note You need to log in before you can comment on or make changes to this bug.