Bug 247561 - utrace: i386 debugger + x86_64 kernel + threaded (i386) inferior = error
utrace: i386 debugger + x86_64 kernel + threaded (i386) inferior = error
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
7
x86_64 Linux
high Severity high
: ---
: ---
Assigned To: Roland McGrath
Fedora Extras Quality Assurance
: Regression
Depends On:
Blocks: 247427
  Show dependency treegraph
 
Reported: 2007-07-09 20:16 EDT by Roland McGrath
Modified: 2007-11-30 17:12 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-09-04 16:34:59 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 Roland McGrath 2007-07-09 20:16:05 EDT
+++ This bug was initially created as a clone of Bug #247427 +++

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.

-- Additional comment from jan.kratochvil@redhat.com on 2007-07-09 04:49 EST --
Created an attachment (id=158749)
Bugfix.


-- Additional comment from jan.kratochvil@redhat.com on 2007-07-09 04:50 EST --
Created an attachment (id=158750)
Testcase (`-m32').


-- Additional comment from syeghiay@redhat.com on 2007-07-09 09:38 EST --
Cleared exception flag since blocker already set due to Keywords Regression.
Comment 1 Roland McGrath 2007-07-09 20:17:07 EDT
This is fixed in my "upstream" utrace patch set, f7 should get an update (fc6 too).
Comment 2 Roland McGrath 2007-09-04 16:34:59 EDT
This was fixed in an F7 update kernel a while ago.

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