Bug 237572 - Can not singlestep over pthread function
Can not singlestep over pthread function
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gdb (Show other bugs)
rawhide
ppc64 Linux
high Severity high
: ---
: ---
Assigned To: Jan Kratochvil
: Reopened
Depends On: 235186
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-23 16:40 EDT by Jan Kratochvil
Modified: 2007-11-30 17:12 EST (History)
1 user (show)

See Also:
Fixed In Version: gdb-6.6-18.fc8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-06-26 00:40:19 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)

  None (edit)
Description Jan Kratochvil 2007-04-23 16:40:55 EDT
---Problem Description---
Gdb cant singlestep over pthread function
 
---uname output---
Linux devel 2.6.18-8.1.1.el5 #1 SMP Mon Feb 26 20:42:34 EST 2007 ppc64 ppc64
ppc64 GNU/Linux
 
---Steps to Reproduce---
[root@devel gdb]# cat test.c
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>

void *tf( void *ptr )
{
     char *ptr1;
     ptr1 = (char *) ptr;
     printf("%s \\n", ptr1);
}

main()
{
     pthread_t thread;
     char *ptr = "Thread";
     int  iret;

     iret = pthread_create( &thread, NULL, tf, (void*)ptr);

     pthread_join( thread, NULL);

     printf("Thread returns: %d\\n",iret);
     exit(0);
}

=== 32bit ===

[root@devel gdb]# gcc -g -o test.32 test.c -lpthread
[root@devel gdb]# gdb -q test.32
Using host libthread_db library "/lib64/libthread_db.so.1".
(gdb) b main
Breakpoint 1 at 0x100005ac: file test.c, line 15.
(gdb) b tf
Breakpoint 2 at 0x10000564: file test.c, line 8.
(gdb) r
Starting program: /home/public/test-tools/gdb/test.32
[Thread debugging using libthread_db enabled]
[New Thread 268377056 (LWP 32324)]
[Switching to Thread 268377056 (LWP 32324)]

Breakpoint 1, main () at test.c:15
15           char *ptr = "Thread";
(gdb) n
18           iret = pthread_create( &thread, NULL, tf, (void*)ptr);
(gdb) n
[New Thread 4160681152 (LWP 32327)]
20           pthread_join( thread, NULL);
(gdb) n
[Switching to Thread 4160681152 (LWP 32327)]

Breakpoint 2, tf (ptr=0x10000a68) at test.c:8
8            ptr1 = (char *) ptr;
(gdb) n
9            printf("%s \\n", ptr1);
(gdb) n
Thread
10      }
(gdb) n
0x0fcf66d4 in start_thread () from /lib/libpthread.so.0
(gdb) n
Single stepping until exit from function start_thread,
which has no line number information.
0x0fd02860 in call___do_global_ctors_aux () from /lib/libpthread.so.0
(gdb) n
Single stepping until exit from function call___do_global_ctors_aux,
which has no line number information.
0x0ffd4e1c in _dl_runtime_resolve () from /lib/ld.so.1
(gdb) n
Single stepping until exit from function _dl_runtime_resolve,
which has no line number information.
0x0ff7b5a0 in __libc_thread_freeres () from /lib/libc.so.6
(gdb) n
Single stepping until exit from function __libc_thread_freeres,
which has no line number information.
0x0fcf66e0 in start_thread () from /lib/libpthread.so.0
(gdb) n
Single stepping until exit from function start_thread,
which has no line number information.
                      ----------> hangs here

=== 64bit === 

[root@devel gdb]# gcc -g -m64 -o test.64 test.c -lpthread
[root@devel gdb]# gdb -q test.64
Using host libthread_db library "/lib64/libthread_db.so.1".
(gdb) b main
Breakpoint 1 at 0x100006e8: file test.c, line 15.
(gdb) b tf
Breakpoint 2 at 0x1000069c: file test.c, line 8.
(gdb) r
Starting program: /home/public/test-tools/gdb/test.64
[Thread debugging using libthread_db enabled]
[New Thread 553248246304 (LWP 32351)]
[Switching to Thread 553248246304 (LWP 32351)]

Breakpoint 1, main () at test.c:15
15           char *ptr = "Thread";
(gdb) n
18           iret = pthread_create( &thread, NULL, tf, (void*)ptr);
(gdb) n
[New Thread 4398057189936 (LWP 32356)]
20           pthread_join( thread, NULL);
(gdb) n
[Switching to Thread 4398057189936 (LWP 32356)]

Breakpoint 2, tf (ptr=0x10000958) at test.c:8
8            ptr1 = (char *) ptr;
(gdb) n
9            printf("%s \\n", ptr1);
(gdb) n
Thread
10      }
(gdb) n
0x00000080d057b808 in .start_thread () from /lib64/libpthread.so.0
(gdb) n
Single stepping until exit from function .start_thread,
which has no line number information.
                      ----------> hangs here

 
---GDB - Power Component Data---
Userspace tool common name: gdb

The userspace tool has the following bit modes: both 32 and 64-bit modes

Userspace rpm: gdb-6.5-16.el5

-- Additional comment on 2007-04-04 08:32 EST --
Sending up... This is reproducible. If a box on which this can be
reproduced is required, I can provide the details.
Comment 1 Jan Kratochvil 2007-04-28 14:01:09 EDT
Fix of the implementation + testcase posted upstream:
  http://sources.redhat.com/ml/gdb-patches/2007-04/msg00374.html

This version would be applicable to Rawhide.
Comment 2 Jan Kratochvil 2007-06-21 01:23:26 EDT
Committed to Rawhide CVS:
* Thu Jun 21 2007 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.6-17
- Support for stepping over PPC atomic instruction sequences (BZ 237572).
- `set scheduler-locking step' is no longer enforced but it is now default.
Comment 3 Jan Kratochvil 2007-06-26 00:39:18 EDT
Reopened, some cases were unreliable.
Comment 4 Jan Kratochvil 2007-06-26 00:40:19 EDT
CVS-Rawhide-committed fix of the fix:
* Tue Jun 26 2007 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.6-18
- Fix PPC software watchpoints active while stepping atomic instr. (BZ 237572).
Comment 5 Jan Kratochvil 2007-06-26 09:16:59 EDT
Posted upstream:
http://sources.redhat.com/ml/gdb-patches/2007-06/msg00455.html

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