Failure to backtrace out of glibc system call stubs

Bug #684218 reported by Yao Qi
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GDB
Fix Released
Medium
Ulrich Weigand
eglibc (Ubuntu)
Fix Released
Undecided
Unassigned
gdb (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

In linaro gdb r32980,

FAIL: gdb.base/call-signal-resume.exp: backtrace
FAIL: gdb.base/call-signal-resume.exp: dummy stack frame number
XPASS: gdb.base/call-signal-resume.exp: frame
FAIL: gdb.base/call-signal-resume.exp: continue to breakpoint at stop_two
FAIL: gdb.base/call-signal-resume.exp: continue to receipt of signal
FAIL: gdb.base/call-signal-resume.exp: continue to breakpoint at handle_signal
FAIL: gdb.base/call-signal-resume.exp: continue to program exit

  === gdb Summary ===

# of expected passes 13
# of unexpected failures 6
# of unexpected successes 1

We can see the same failures in GDB cvs trunk.

Tags: testsuite

Related branches

Revision history for this message
Ulrich Weigand (uweigand) wrote :

This failure goes away if debug information for glibc is present.

The problem is that without CFI debug data, GDB is currently unable to backtrace out of the "kill" routine correctly:

000259f0 <kill>:
   259f0: e1a0c007 mov ip, r7
   259f4: e3a07025 mov r7, #37 ; 0x25
   259f8: ef000000 svc 0x00000000
   259fc: e1a0700c mov r7, ip
   25a00: e3700a01 cmn r0, #4096 ; 0x1000
   25a04: 312fff1e bxcc lr
   25a08: eaffbf0c b 15640 <__libc_start_main+0x1d0>
   25a0c: e320f000 nop {0}

because it doesn't detect that r7 has been saved into ip. (Thus, when backtracing out of the caller requires use of the caller's r7, GDB uses the incorrect value.)

Unfortunately, even with my patch to add support for ARM unwind tables (#661253), this particular case *still* is not handled, because the kill routine doesn't even provide correct ARM unwind tables. See the discussion leading up to this:
http://sourceware.org/ml/gdb-patches/2010-12/msg00005.html

So it looks like a glibc fix will be required in addition to the #661253 GDB fix.

Changed in gdb-linaro:
status: New → Confirmed
importance: Undecided → Medium
Michael Hope (michaelh1)
tags: added: testsuite
Changed in gdb-linaro:
assignee: nobody → Ulrich Weigand (uweigand)
Revision history for this message
Ulrich Weigand (uweigand) wrote :

This problem is also the root cause of the following failures:

FAIL: gdb.base/foll-vfork.exp: vfork parent follow, finish after tcatch vfork
FAIL: gdb.base/foll-vfork.exp: vfork child follow, finish after tcatch vfork

summary: - Failures in gdb.base/call-signal-resume.exp
+ Failures to backtrace out of glibc system call stubs
summary: - Failures to backtrace out of glibc system call stubs
+ Failure in gdb.base/call-signal-resume.exp
summary: - Failure in gdb.base/call-signal-resume.exp
+ Failure to backtrace out of glibc system call stubs
Changed in gdb-linaro:
status: Confirmed → In Progress
Revision history for this message
Ulrich Weigand (uweigand) wrote :

GDB part of the fix now committed.

Changed in gdb-linaro:
status: In Progress → Fix Committed
milestone: none → 7.2-2011.04-0
Revision history for this message
Ulrich Weigand (uweigand) wrote :

glibc part of the fix is now committed to libc-ports:

[PATCH][arm] Create ARM unwind records for system call stubs
http://sourceware.org/ml/libc-ports/2011-03/msg00035.html
http://sourceware.org/ml/glibc-cvs/2011-q1/msg00119.html
commit 738860089d5c510f3445f9830d9924ab58659c51

Can this be backported to the Ubuntu eglibc package?

Revision history for this message
Matthias Klose (doko) wrote :

could you point to the corresponding gdb change?

Revision history for this message
Ulrich Weigand (uweigand) wrote :

The main change (support for .ARM.exidx unwind info) is already in Ubuntu GDB (came in with the Linaro GDB merge).

There is one minor additional fix (actually a pre-existing bug in the ARM prologue parser exposed by the glibc change) that is not yet in Ubuntu GDB. This extra fix has been committed to mainline GDB:
http://sourceware.org/ml/gdb-patches/2011-03/msg00964.html
and also to Linaro GDB (rev. 32997).

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package eglibc - 2.13-0ubuntu9

---------------
eglibc (2.13-0ubuntu9) natty; urgency=low

  * Update to r13241 from the eglibc-2.13 branch.
  * Create ARM unwind records for system call stubs (Ulrich Weigand).
    LP: #684218.
 -- Matthias Klose <email address hidden> Wed, 23 Mar 2011 00:35:13 +0100

Changed in eglibc (Ubuntu):
status: New → Fix Released
Revision history for this message
Ulrich Weigand (uweigand) wrote :

I've verified that the problem is fixed with 2.13-0ubuntu9. Thanks!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdb - 7.2-1ubuntu11

---------------
gdb (7.2-1ubuntu11) natty; urgency=low

  * Fix minor ARM prologue parsing bug (Ulrich Weigand). LP: #684218.
 -- Matthias Klose <email address hidden> Thu, 24 Mar 2011 10:41:22 +0100

Changed in gdb (Ubuntu):
status: New → Fix Released
Michael Hope (michaelh1)
Changed in gdb-linaro:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.