Bug 76484 - Threads support is broken if glibc is linked statically with program
Summary: Threads support is broken if glibc is linked statically with program
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc   
(Show other bugs)
Version: 8.0
Hardware: i386 Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
Depends On:
TreeView+ depends on / blocked
Reported: 2002-10-22 10:17 UTC by Leonid Kanter
Modified: 2016-11-24 15:17 UTC (History)
3 users (show)

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

Attachments (Terms of Use)

Description Leonid Kanter 2002-10-22 10:17:32 UTC
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-10 02:14:37 UTC
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 12:46:12 UTC
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.