Bug 39070

Summary: gdb cannot handle more than 32 threads
Product: [Retired] Red Hat Linux Reporter: Justin A Irwin <jairwin>
Component: gdbAssignee: Trond Eivind Glomsrxd <teg>
Status: CLOSED RAWHIDE QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-08-02 04:12:29 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:
Attachments:
Description Flags
Small program to demonstrate thread limit none

Description Justin A Irwin 2001-05-04 00:19:11 UTC
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-04 00:24:58 UTC
Created attachment 17286 [details]
Small program to demonstrate thread limit

Comment 2 Trond Eivind Glomsrxd 2001-05-04 14:21:02 UTC
Confirmed.



Comment 3 Trond Eivind Glomsrxd 2001-05-04 15:12:25 UTC
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 15:34:52 UTC
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 15:33:02 UTC
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 15:17:13 UTC
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 14:11:05 UTC
*** Bug 27311 has been marked as a duplicate of this bug. ***