Bug 247354

Summary: GDB hangs when the thread leader exits
Product: [Fedora] Fedora Reporter: Jan Kratochvil <jan.kratochvil>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: gdb-6.6-20.fc8 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-07-08 13:41:38 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:
Bug Depends On: 245168    
Bug Blocks:    
Attachments:
Description Flags
Testcase source. none

Description Jan Kratochvil 2007-07-07 17:45:10 UTC
Description of problem:
If you run the attached program and try to CTRL-C nothing happens.  GDB hangs.

Version-Release number of selected component (if applicable):
gdb-6.6-15.fc7.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. gdb /tmp/leaderexit
2. run
3. (wait)
4. CTRL-C

Actual results:
GNU gdb Red Hat Linux (6.6-15.fc7rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...
Using host libthread_db library "/lib64/libthread_db.so.1".
(gdb) r
Starting program: /tmp/leaderexit 
[Thread debugging using libthread_db enabled]
[New Thread 46912496199856 (LWP 5242)]
[New Thread 1084229968 (LWP 5245)]
-hung-

Expected results:
GNU gdb 6.6.50.20070707-cvs
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu"...
Using host libthread_db library "/lib64/libthread_db.so.1".
(gdb) r
Starting program: /tmp/leaderexit 
[Thread debugging using libthread_db enabled]
[New Thread 0x2aaaaaabe8b0 (LWP 5251)]
[New Thread 0x40a00950 (LWP 5254)]

Program received signal SIGINT, Interrupt.
[Switching to Thread 0x40a00950 (LWP 5254)]
0x0000003d6c00d5ad in pause () from /lib64/libpthread.so.0
(gdb) _

Additional info:

Comment 1 Jan Kratochvil 2007-07-07 17:45:10 UTC
Created attachment 158721 [details]
Testcase source.

Comment 3 Jan Kratochvil 2007-07-08 13:41:38 UTC
Committed to the Rawhide CVS:
* Sun Jul  8 2007 Jan Kratochvil <jan.kratochvil> - 6.6-20
- Do not hang on exit of a thread group leader (BZ 247354).


Comment 4 Jan Kratochvil 2007-07-09 09:18:12 UTC
Posted upstream:
  http://sources.redhat.com/ml/gdb-patches/2007-07/msg00136.html