Bug 39070 - gdb cannot handle more than 32 threads
Summary: gdb cannot handle more than 32 threads
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gdb
Version: 7.1
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Trond Eivind Glomsrxd
QA Contact: Aaron Brown
URL:
Whiteboard:
: 27311 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-05-04 00:19 UTC by Justin A Irwin
Modified: 2007-04-18 16:33 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-08-02 04:12:29 UTC
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2001:159 0 high SHIPPED_LIVE Updated gdb is available 2001-11-26 05:00:00 UTC

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. ***


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