Red Hat Bugzilla – Bug 247561
utrace: i386 debugger + x86_64 kernel + threaded (i386) inferior = error
Last modified: 2007-11-30 17:12:10 EST
+++ 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.
This is fixed in my "upstream" utrace patch set, f7 should get an update (fc6 too).
This was fixed in an F7 update kernel a while ago.