Bug 673696

Summary: gdb: Linux core files should use linux-thread-db.c
Product: Red Hat Enterprise Linux 6 Reporter: Jeremy Eder <jeder>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED ERRATA QA Contact: qe-baseos-tools-bugs
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: ebachalo, jeder, pbatkowski, pmuller
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: gdb-7.2-41.el6 Doc Type: Bug Fix
Doc Text:
Multithreaded program can be dumped into a core file. GDB can load core files and display the list of their threads. Previously, GDB displayed only the LWP (light-weight process) identifier for threads found in the core file. With this update, GDB initializes the libthread_db threads debugging library even while accessing a core file and GDB displays for each thread besides LWP also the pthread_t identifier.
Story Points: ---
Clone Of:
: 673697 697900 (view as bug list) Environment:
Last Closed: 2011-05-19 13:48:41 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:    
Bug Blocks: 673697, 697900    

Description Jeremy Eder 2011-01-29 21:19:24 UTC
This is upstream gdb bz 8210:
http://sourceware.org/bugzilla/show_bug.cgi?id=8210


Description of problem:
Core dumps have no pthread id on them in gdb on RHEL5 and 6.


When looking on a core dump:
(gdb) info threads
  22 process 18110  0x0000003464eccfc2 in select () from /lib64/libc.so.6
  21 process 18111  0x0000003464ed4108 in epoll_wait () from /lib64/libc.so.6

-----
 
When attaching to a running process all is good:
(gdb) info threads
  22 Thread 0x42337940 (LWP 29132)  0x0000003464eccfc2 in select () from /lib64/libc.so.6
  21 Thread 0x42d38940 (LWP 29133)  0x0000003464ed4108 in epoll_wait () from /lib64/libc.so.6

Comment 2 Jan Kratochvil 2011-01-30 19:40:29 UTC
Checked in: gdb-7.2-39.fc14

New testcases:
+PASS: gdb.threads/gcore-thread.exp: print pthread_t of main
+PASS: gdb.threads/gcore-thread.exp: print pthread_t of thread1
+PASS: gdb.threads/gcore-thread.exp: print pthread_t of thread2
+PASS: gdb.threads/gcore-thread.exp: main pthread_self found
+PASS: gdb.threads/gcore-thread.exp: thread1 pthread_self found
+PASS: gdb.threads/gcore-thread.exp: thread2 pthread_self found

Comment 5 Eva Kopalova 2011-04-05 16:01:01 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
GDB did not display pthread_t for threads found in the core. GDB now displays pthread_t for the threads.

Comment 6 Eva Kopalova 2011-04-08 16:15:36 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-GDB did not display pthread_t for threads found in the core. GDB now displays pthread_t for the threads.+Multithreaded program can be dumped into a core file. GDB can load core files and display the list of their threads. Previously, GDB displayed only the LWP (light-weight process) identifier for threads found in the core file.  With this update, GDB initializes the libthread_db threads debugging library even while accessing a core file and GDB displays for each thread besides LWP also the pthread_t identifier.

Comment 12 errata-xmlrpc 2011-05-19 13:48:41 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0638.html