Bug 97528

Summary: unresolved symbol pthread_once
Product: [Retired] Red Hat Linux Reporter: Mathias Fröhlich <mathias.froehlich>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: fweimer
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-06-17 15:26:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mathias Fröhlich 2003-06-17 11:45:30 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.6 (X11; Linux i686; U;) Gecko/20020830

Description of problem:
The weak aliases for the pthread functions

pthread_getspecific 
pthread_key_create 
pthread_kill_other_threads_np 
pthread_once 
pthread_rwlock_rdlock 
pthread_rwlock_unlock 
pthread_rwlock_wrlock 
pthread_setspecific 

are missing in /lib/tls/libc-2.3.2.so.
Note, that they are available in /lib/libc-2.3.2.so.

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

How reproducible:
Always

Steps to Reproduce:
1. nm /lib/tls/libc-2.3.2.so | grep pthread_once


    

Actual Results:  Noting shows here

Expected Results:      w __pthread_once


Additional info:

I found this while fixing nss_ldap's recursiv gethostbyname bug. For that I need
thread local storage and used the posix standard thread library which is
available even if gcc's tls extention is not. When booting vanilla 2.4.21
without the redhat paches to the kernel everything works fine. But if I use the
redhat shipped Kernel tls libraries are used and libnss_ldap does not load due
to unresolved symbols from the pthread library.

Comment 1 Jakub Jelinek 2003-06-17 15:26:20 UTC
They are not available in /lib/libc-2.3.2.so either (that w __pthread_once
is weak undefined symbol to __pthread_once) and never has been.
If you need those symbols, you need to link with -lpthread.
If you need to use it conditionally, you need to make them weak externs in
your library (e.g. through #pragma weak pthread_once etc.) and first test
if those symbols are actually available.