Bug 74176 - glibc limitation to count of one process thread
Summary: glibc limitation to count of one process thread
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc   
(Show other bugs)
Version: 7.3
Hardware: All Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
Keywords: FutureFeature
Depends On:
TreeView+ depends on / blocked
Reported: 2002-09-17 13:20 UTC by Denis Fedorishenko
Modified: 2016-11-24 14:48 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-09-17 13:20:28 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 Denis Fedorishenko 2002-09-17 13:20:20 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020526

Description of problem:
MySQL, oops-cache use lot of thread. Standart distribution limited to ~256
threads per process. Patch increase limit of processes and decrease minimal
stack size(?).

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

How reproducible:

Steps to Reproduce:
1.Start one process and create threads in loop.
2.Wait for SIGSEGV


Actual Results:  If threads level too low, program crashed. With this patch
program works great.

Additional info:

diff -urN glibc-2.2.5/linuxthreads/descr.h glibc-2.2.5.new/linuxthreads/descr.h
--- glibc-2.2.5/linuxthreads/descr.h    Mon Feb 25 10:55:48 2002
+++ glibc-2.2.5.new/linuxthreads/descr.h        Wed Aug  7 14:38:58 2002
@@ -201,7 +201,7 @@
    THREAD_SELF implementation is used, this must be a power of two and
    a multiple of PAGE_SIZE.  */
 #ifndef STACK_SIZE
-#define STACK_SIZE  (2 * 1024 * 1024)
+#define STACK_SIZE  (64 * PAGE_SIZE)

 /* Get some notion of the current stack.  Need not be exactly the top
diff -urN glibc-2.2.5/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h glib
--- glibc-2.2.5/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h   Tue Apr
+++ glibc-2.2.5.new/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h
@@ -64,7 +64,7 @@
 /* The number of threads per process.  */
 #define _POSIX_THREAD_THREADS_MAX      64
 /* This is the value this implementation supports.  */
-#define PTHREAD_THREADS_MAX    1024
+#define PTHREAD_THREADS_MAX    8192

 /* Maximum amount by which a process can descrease its asynchronous I/O
    priority level.  */

Comment 1 Jakub Jelinek 2002-09-20 09:21:00 UTC
This patch is totally broken.
The first part is completely unnecessary, the latter is solved better in
rawhide glibc (and of course, with Native POSIX Thread Library
this is all history).

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