Bug 434998 - utrace: ERESTARTSYS from calling a function from a debugger
utrace: ERESTARTSYS from calling a function from a debugger
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
5.1
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Jerome Marchand
Martin Jenner
:
Depends On: 434995
Blocks: 437882
  Show dependency treegraph
 
Reported: 2008-02-26 14:18 EST by Jan Kratochvil
Modified: 2009-01-20 15:14 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-20 15:14:44 EST
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 2008-02-26 14:18:19 EST
+++ This bug was initially created as a clone of Bug #434995 +++

Description of problem:
On a GDB testcase was found i386 debugger running on x86_64 kernel accidentally
causes ERESTARTSYS to be returned in errno in the process being debugged.
It is not reproducible on an i386 debugger on an i386 kernel.
It is not reproducible on an x86_64 debugger on an x86_64 kernel.

Version-Release number of selected component (if applicable):
kernel-xen-2.6.18-53.1.13.el5.x86_64 (AFAIK unrelated to xen)

How reproducible:
Always, reliably.

Steps to Reproduce:
1. wget
http://sources.redhat.com/cgi-bin/cvsweb.cgi/~checkout~/tests/ptrace-tests/tests/erestartsys.c?cvsroot=systemtap
2. gcc -o erestartsys erestartsys.c -Wall -ggdb2 -D_GNU_SOURCE -m32
-lutil;./erestartsys;echo $?

Actual results:
1

Expected results:
0

Additional info:
Correct (0):
  /* kernel-2.6.23.15-137.fc8.x86_64 -m64.  */
  /* kernel.org 2.6.22-rc4-git7 x86_64 -m64.  */
  /* kernel-2.6.23.15-137.fc8.i686 (-m32).  */
Broken (1):
  /* kernel.org 2.6.22-rc4-git7 x86_64 on -m32.  */
  /* kernel-2.6.23.15-137.fc8.x86_64 -m32.  */
Unsupported restarting (77):
  /* kernel.org 2.4.33 i686.  */
  /* kernel-2.6.18-53.el5.s390x -m64.  */

The GDB case:
cd
/home/jkratoch/redhat/fedora/gdb/devel-m32/gdb-6.7.1/build-i386-redhat-linux-gnu/gdb/testsuite
$ file ../gdb gdb.base/interrupt
../gdb:             ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
gdb.base/interrupt: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
$ ../gdb gdb.base/interrupt
GNU gdb Red Hat Linux (6.7.1-15.fc8rh)
Copyright (C) 2007 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 "i386-redhat-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run
Starting program:
/home/jkratoch/redhat/fedora/gdb/devel-m32/gdb-6.7.1/build-i386-redhat-linux-gnu/gdb/testsuite/gdb.base/interrupt

Missing separate debuginfo for /lib/ld-linux.so.2
Try: yum --enablerepo='*-debuginfo' install
/usr/lib/debug/.build-id/ac/2eeb206486bb7315d6ac4cd64de0cb50838ff6.debug
Missing separate debuginfo for /lib/libm.so.6
Try: yum --enablerepo='*-debuginfo' install
/usr/lib/debug/.build-id/92/8ab51a53627c59877a85dd9afecc1619ca866c.debug
Missing separate debuginfo for /lib/libc.so.6
Try: yum --enablerepo='*-debuginfo' install
/usr/lib/debug/.build-id/ba/4ea1118691c826426e9410cafb798f25cefad5.debug
talk to me baby

<--- Put CTRL-C from the console here.

Program received signal SIGINT, Interrupt.
0xffffe410 in __kernel_vsyscall ()
(gdb) p func1 ()
$1 = 4
(gdb) cont
Continuing.
Unknown error 512

^^^ The message `Unknown error 512' should have never been seen.
Comment 1 Jan Kratochvil 2008-03-01 12:45:40 EST
Upstream fix from Roland:
  http://www.ussg.iu.edu/hypermail/linux/kernel/0802.3/2516.html
Comment 2 Prarit Bhargava 2008-05-08 08:23:03 EDT
Roland, is anything else required to support the patch in comment #1 -- can it
be simply backported?

P.
Comment 3 Roland McGrath 2008-05-22 02:58:21 EDT
I think that patch is self-contained.
Comment 4 RHEL Product and Program Management 2008-06-13 11:38:17 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 7 Don Zickus 2008-07-23 14:54:46 EDT
in kernel-2.6.18-99.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5
Comment 11 errata-xmlrpc 2009-01-20 15:14:44 EST
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/RHSA-2009-0225.html

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