Bug 39070 - gdb cannot handle more than 32 threads
gdb cannot handle more than 32 threads
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: gdb (Show other bugs)
7.1
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Trond Eivind Glomsrxd
Aaron Brown
:
: 27311 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-05-03 20:19 EDT by Justin A Irwin
Modified: 2007-04-18 12:33 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-08-02 00:12:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Small program to demonstrate thread limit (797 bytes, text/plain)
2001-05-03 20:24 EDT, Justin A Irwin
no flags Details

  None (edit)
Description Justin A Irwin 2001-05-03 20:19:11 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (WinNT; U)

Description of problem:
When using gdb to debug a program that creates a large number of threads, gdb will stop with a message of:
"Cannot find thread 33: invalid thread handle"
Trying to continue causes a seg fault.

How reproducible:
Always

Steps to Reproduce:
1. Compile the threadbug.c program (below) with:
  gcc -D_REENTRANT -g -o threadbug threadbug.c -lpthread
2. Start up gdb:
  gdb threadbug
3. Run the program
  (gdb) r


Actual Results:  Program runs, giving output like:

Starting program: /home/justin/dlock
[New Thread 1024 (LWP 9792)]
[New Thread 2049 (LWP 9793)]
Delayed SIGSTOP caught for LWP 9793.
[New Thread 1026 (LWP 9794)]
Delayed SIGSTOP caught for LWP 9794.
LWP 9794 exited.
... (cut for brevity) ...
[New Thread 31776 (LWP 9824)]
Delayed SIGSTOP caught for LWP 9824.
LWP 9824 exited.
Cannot find thread 33: invalid thread handle


Expected Results:  
Starting program: /home/justin/dlock
[New Thread 1024 (LWP 9792)]
[New Thread 2049 (LWP 9793)]
Delayed SIGSTOP caught for LWP 9793.
[New Thread 1026 (LWP 9794)]
Delayed SIGSTOP caught for LWP 9794.
LWP 9794 exited.
... (cut for brevity) ...
[New Thread 31776 (LWP 9824)]
Delayed SIGSTOP caught for LWP 9824.
LWP 9824 exited.
LWP 9793 exited.

Program exited normally.

(this isn't "real" output, but it gives the idea)

Additional info:

Running RH7.1 out of the box on an IBM Netfinity x340, IBM NetVista, and others. Problem does not seem to be isolated to any particular 
hardware.

While this qualifies as a "Normal" severity bug, it makes it impossible to debug our product on RH7.1. The only current workaround we know of 
is to roll back to RH6.2.
Comment 1 Justin A Irwin 2001-05-03 20:24:58 EDT
Created attachment 17286 [details]
Small program to demonstrate thread limit
Comment 2 Trond Eivind Glomsrxd 2001-05-04 10:21:02 EDT
Confirmed.

Comment 3 Trond Eivind Glomsrxd 2001-05-04 11:12:25 EDT
A patch can be found at
http://sources.redhat.com/ml/gdb-patches/2001-04/msg00240.html
Comment 4 Trond Eivind Glomsrxd 2001-05-04 11:34:52 EDT
You would need this as well:
http://sources.redhat.com/ml/gdb-patches/2001-05/msg00042.html

There is some discussion on the gdb-list  (found at
http://sources.redhat.com/gdb/) of this patch - I'll make new rpms when the dust
settles and something is checked into the main CVS.
Comment 5 Trond Eivind Glomsrxd 2001-05-15 11:33:02 EDT
The version of gdb in CVS (http://sources.redhat.com/gdb/) now works with your
test example. It hasn't yet propagated to the daily snapshots - I'll take the
one tomorrow and build it.
Comment 6 Trond Eivind Glomsrxd 2001-05-16 11:17:13 EDT
Fixed in gdb-5.0rh-9, which should show up in Rawhide in the not too distant
future and is available now from http://people.redhat.com/teg/gdb/
Comment 7 Trond Eivind Glomsrxd 2001-08-10 10:11:05 EDT
*** Bug 27311 has been marked as a duplicate of this bug. ***

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