public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/10267] New: ERESTART_RESTARTBLOCK and function calling
@ 2009-06-12 10:51 kirill at shutemov dot name
  2009-07-02 10:37 ` [Bug gdb/10267] " kirill at shutemov dot name
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: kirill at shutemov dot name @ 2009-06-12 10:51 UTC (permalink / raw)
  To: gdb-prs

I've got bug in handling ERESTART_RESTARTBLOCK. Kernel version is 2.6.28.

Steps to reproduce:
1. Attach to process while it's in a syscall which use ERESTART_RESTARTBLOCK on
interrupt. The easiest way is to attach to process which is in nanosleep().
2. Run a syscall in context.
3. Continue the process.

Results:
Syscall(nanosleep) return error code 516(ERESTART_RESTARTBLOCK). It's
kernel's internal error code and should never appear at userspace.

It seems ARM-related since I can't reproduce it on x86. I'm not sure if it's
kernel or gdb bug. Any ideas?

Example:
$ cat test.c
#include <errno.h>
#include <stdio.h>
#include <time.h>

int main()
{
       struct timespec ts;
       int ret;

       ts.tv_sec = 100;
       ts.tv_nsec = 0;

       errno = 0;
       ret = nanosleep(&ts, NULL);
       printf("ret: %d, errno: %d\n", ret, errno);

       return 0;
}
$ gcc test.c
$ ./a.out &
$ gdb -p "$(pidof a.out)" -ex 'call getuid()' -ex 'c' -ex 'quit'
GNU gdb (GDB) 6.8.50.20090417-debian
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Attaching to process 6136
Reading symbols from /root/a.out...(no debugging symbols found)...done.
Reading symbols from /lib/libc.so.6...Reading symbols from
/usr/lib/debug/lib/libc-2.5.so...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.3...Reading symbols from
/usr/lib/debug/lib/ld-2.5.so...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Loaded symbols for /lib/ld-linux.so.3
0x400bf97c in nanosleep () from /lib/libc.so.6
0x400bf97c <nanosleep+28>:      mov     r7, r12
$1 = 0
Continuing.
ret: -1, errno: 516

Program exited normally.
[1] + Done                       ./a.out

-- 
           Summary: ERESTART_RESTARTBLOCK and function calling
           Product: gdb
           Version: 6.8
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: kirill at shutemov dot name
                CC: gdb-prs at sourceware dot org
 GCC build triplet: arm-linux-gnueabi
  GCC host triplet: arm-linux-gnueabi
GCC target triplet: arm-linux-gnueabi


http://sourceware.org/bugzilla/show_bug.cgi?id=10267

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/10267] ERESTART_RESTARTBLOCK and function calling
  2009-06-12 10:51 [Bug gdb/10267] New: ERESTART_RESTARTBLOCK and function calling kirill at shutemov dot name
@ 2009-07-02 10:37 ` kirill at shutemov dot name
  2009-10-12  8:36 ` kirill at shutemov dot name
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: kirill at shutemov dot name @ 2009-07-02 10:37 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From kirill at shutemov dot name  2009-07-02 10:37 -------
Any progress?

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10267

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/10267] ERESTART_RESTARTBLOCK and function calling
  2009-06-12 10:51 [Bug gdb/10267] New: ERESTART_RESTARTBLOCK and function calling kirill at shutemov dot name
  2009-07-02 10:37 ` [Bug gdb/10267] " kirill at shutemov dot name
@ 2009-10-12  8:36 ` kirill at shutemov dot name
  2009-10-12  9:09 ` jan dot kratochvil at redhat dot com
  2009-10-12  9:09 ` jan dot kratochvil at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: kirill at shutemov dot name @ 2009-10-12  8:36 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From kirill at shutemov dot name  2009-10-12 08:36 -------
ping

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10267

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/10267] ERESTART_RESTARTBLOCK and function calling
  2009-06-12 10:51 [Bug gdb/10267] New: ERESTART_RESTARTBLOCK and function calling kirill at shutemov dot name
  2009-07-02 10:37 ` [Bug gdb/10267] " kirill at shutemov dot name
  2009-10-12  8:36 ` kirill at shutemov dot name
@ 2009-10-12  9:09 ` jan dot kratochvil at redhat dot com
  2009-10-12  9:09 ` jan dot kratochvil at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2009-10-12  9:09 UTC (permalink / raw)
  To: gdb-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jan dot kratochvil at redhat
                   |                            |dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=10267

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/10267] ERESTART_RESTARTBLOCK and function calling
  2009-06-12 10:51 [Bug gdb/10267] New: ERESTART_RESTARTBLOCK and function calling kirill at shutemov dot name
                   ` (2 preceding siblings ...)
  2009-10-12  9:09 ` jan dot kratochvil at redhat dot com
@ 2009-10-12  9:09 ` jan dot kratochvil at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2009-10-12  9:09 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From jan dot kratochvil at redhat dot com  2009-10-12 09:09 -------
While I know nothing about ARM I guess it is a kernel problem, fixed for x86*:
http://lkml.indiana.edu/hypermail/linux/kernel/0802.3/2516.html
It may be nice to update the testcase of
http://sourceware.org/systemtap/wiki/utrace/tests
specifically
http://sources.redhat.com/cgi-bin/cvsweb.cgi/~checkout~/tests/ptrace-tests/tests/erestartsys.c?cvsroot=systemtap
for ARM.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10267

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-10-12  9:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-12 10:51 [Bug gdb/10267] New: ERESTART_RESTARTBLOCK and function calling kirill at shutemov dot name
2009-07-02 10:37 ` [Bug gdb/10267] " kirill at shutemov dot name
2009-10-12  8:36 ` kirill at shutemov dot name
2009-10-12  9:09 ` jan dot kratochvil at redhat dot com
2009-10-12  9:09 ` jan dot kratochvil at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).