This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 223788 - pthread_create() fails with segmentation fault.
pthread_create() fails with segmentation fault.
Status: CLOSED WORKSFORME
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: glibc (Show other bugs)
3.0
i686 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
: 223789 223792 223793 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-01-22 09:39 EST by Jani Tolonen
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-01-22 12:13:38 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
test program for reproducing the problem (2.97 KB, text/plain)
2007-01-22 09:39 EST, Jani Tolonen
no flags Details

  None (edit)
Description Jani Tolonen 2007-01-22 09:39:11 EST
Description of problem:

System function pthread_create() fails with segmentation fault.

Originally detected problem with MySQL-4.x and MySQL-5.x series. Program
dies early in the startup always in pthread_create() function call. I have
included here a small test program that demonstrates the problem, using
only system libraries.

By switching to Linuxthreads the problem goes away. Switing back to NPTL
(version 0.60) the problem appears again. Also gdb (provided with the OS as well 
as new one compiled from source) does not work when NPTL is enabled, but it 
works with LT enabled. The symptom with gdb is that it always throws error:

"Error while reading shared library symbols:
Cannot find new threads: generic error
Cannot find user-level thread for LWP 31611: generic error"

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

glibc-2.3.2-95.37
gdb version GNU gdb Red Hat Linux (6.3.0.0-1.62rh)
kernel version 2.4.33.3

How reproducible:

Always.

Steps to Reproduce:

# First ensure NPTL is in use
shell> export LD_ASSUME_KERNEL=

# Check
shell> getconf GNU_LIBPTHREAD_VERSION
NPTL 0.60

# Compile the test program (attached)
shell> gcc thr_test_min.c -lpthread

# Run
shell> ./a.out
Init ok. Creating 100000 threads
Segmentation fault

Expected results:

# Using LinuxThreads the program creates threads successfully
shell> export LD_ASSUME_KERNEL=2.4.1

# Check
shell> getconf GNU_LIBPTHREAD_VERSION
linuxthreads-0.10

shell> ./a.out
Init ok. Creating 100000 threads
     100     200     300     400     500     600     700     800     900    1000 
   1100    1200    1300    1400    1500    1600    1700    1800    1900    2000  
  2100    2200    2300    2400    2500    2600    2700    2800    2900    3000   
 3100    3200    3300    3400    3500    3600    3700    3800    3900    4000
...
 100000
end

Additional info:

Problem originally detected with MySQL database engine.
Comment 1 Jani Tolonen 2007-01-22 09:39:11 EST
Created attachment 146183 [details]
test program for reproducing the problem
Comment 2 Jakub Jelinek 2007-01-22 11:48:11 EST
*** Bug 223793 has been marked as a duplicate of this bug. ***
Comment 3 Jakub Jelinek 2007-01-22 11:48:30 EST
*** Bug 223792 has been marked as a duplicate of this bug. ***
Comment 4 Jakub Jelinek 2007-01-22 11:48:59 EST
*** Bug 223789 has been marked as a duplicate of this bug. ***
Comment 5 Jakub Jelinek 2007-01-22 12:13:38 EST
Sorry, can't reproduce either of these problems, the testcase finishes just
fine and gdb can debug the process.
uname -r; rpm -q glibc gdb
2.4.21-38.ELsmp
glibc-2.3.2-95.39
gdb-6.3.0.0-1.90

Comment 6 Jakub Jelinek 2007-01-22 12:15:49 EST
Missed:
kernel version 2.4.33.3
That's a fatal user error, you can't run RHEL3 userland on an upstream 2.4.x
kernel.  RHEL3 userland relies on RHEL3 kernel, most importantly on the NPTL
backport in it.  NPTL is supposed in upstream only with 2.6.xx kernels.

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