Bug 247427 - utrace: i386 debugger + x86_64 kernel + threaded (i386) inferior = error
utrace: i386 debugger + x86_64 kernel + threaded (i386) inferior = error
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
5.0
x86_64 Linux
high Severity high
: ---
: ---
Assigned To: Roland McGrath
Martin Jenner
: Regression
Depends On: 247561
Blocks: 311881
  Show dependency treegraph
 
Reported: 2007-07-09 04:49 EDT by Jan Kratochvil
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version: RHBA-2007-0959
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-07 14:55:21 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)
Bugfix. (491 bytes, patch)
2007-07-09 04:49 EDT, Jan Kratochvil
no flags Details | Diff
Testcase (`-m32'). (3.70 KB, text/plain)
2007-07-09 04:50 EDT, Jan Kratochvil
no flags Details

  None (edit)
Description Jan Kratochvil 2007-07-09 04:49:40 EDT
Description of problem:
If you run i386-built GDB on x86_64 system it prints error if its (i386)
inferior starts to use threading (TLS).

Version-Release number of selected component (if applicable):
kernel-2.6.18-8.1.8.el5.x86_64
(kernel-2.6.21-1.3228.fc7.x86_64)

How reproducible:
Always.

Steps to Reproduce:
1. gdb ./threadit # threadit is a simple pthread_create() program.
2. run

Actual results:
(gdb) r
Starting program: /root/jkratoch/redhat/threadit 
warning: Lowest section in system-supplied DSO at 0xffffe000 is .hash at ffffe0b4
[Thread debugging using libthread_db enabled]
[New Thread -134482240 (LWP 25106)]
thread_get_info_callback: cannot get thread info: generic error
(gdb) _

Expected results:
(gdb) r
Starting program: /root/jkratoch/redhat/threadit 
warning: Lowest section in system-supplied DSO at 0xffffe000 is .hash at ffffe0b4
[Thread debugging using libthread_db enabled]
[New Thread -134482240 (LWP 25111)]
[New Thread -134485104 (LWP 25114)]
 - running inferior -

Additional info:
Provided a testcase.
It affects RHEL5 + F7 (expecting also F6, untested)
As it is a ptrace(2) bug it is a Regression since RHEL-4.

Testcase run on the F7 (/RHEL5) kernel:
sh-3.2# ./debugreg32 
u_debugreg[0] == 0x0
gs == 0x63
thread_area == 0xf7fc56c0
u_debugreg[0] = 0x01010101
u_debugreg[0] == 0x0
gs == 0x63
thread_area == 0x1010101
debugreg32: debugreg32.c:164: main: Assertion `debugreg0_new == 0x01010101' failed.
Aborted

Testcase run on the kernel with the attached patch:
u_debugreg[0] == 0x0
gs == 0x63
thread_area == 0xf7f1c6c0
u_debugreg[0] = 0x01010101
u_debugreg[0] == 0x1010101
gs == 0x63
thread_area == 0xf7f1c6c0
PASS

Testcase must be built with `-m32':
  gcc -o debugreg32 debugreg32.c -Wall -ggdb2 -pthread -m32
and it provides both the debugger and its inferior as i386 code.
Comment 1 Jan Kratochvil 2007-07-09 04:49:41 EDT
Created attachment 158749 [details]
Bugfix.
Comment 2 Jan Kratochvil 2007-07-09 04:50:28 EDT
Created attachment 158750 [details]
Testcase (`-m32').
Comment 4 Don Zickus 2007-09-18 15:23:54 EDT
in 2.6.18-48.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5
Comment 7 errata-xmlrpc 2007-11-07 14:55:21 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 the 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-2007-0959.html

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