Bug 140532 - PPC CFI and non-CFI backtraces broken
Summary: PPC CFI and non-CFI backtraces broken
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gdb
Version: 4.0
Hardware: powerpc
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Jan Kratochvil
QA Contact:
URL:
Whiteboard:
Depends On: 129331 213784
Blocks: 169570 238333 248673 338231 RHEL4u7_relnotes
TreeView+ depends on / blocked
 
Reported: 2004-11-23 14:52 UTC by Andrew Cagney
Modified: 2008-06-02 23:13 UTC (History)
6 users (show)

Fixed In Version: RHBA-2007-0811
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-11-15 16:11:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
non-PIC unwinding fix (1.62 KB, patch)
2007-01-01 21:14 UTC, Jan Kratochvil
no flags Details | Diff
Existing `gdb-6.3-ppccfi-20041104.patch' difference. (4.64 KB, patch)
2007-01-01 21:20 UTC, Jan Kratochvil
no flags Details | Diff
Andreas Schwab's original imported PPC .eh_frame support patch. (2.92 KB, patch)
2007-01-13 00:32 UTC, Jan Kratochvil
no flags Details | Diff
Patch workarounding GCC's broken .debug_frame CIE return address + fixing/completing DWARF registers mapping. (5.07 KB, patch)
2007-01-13 00:33 UTC, Jan Kratochvil
no flags Details | Diff
Overall PPC-targeted PPC-nonspecific testcase. (4.32 KB, patch)
2007-01-13 02:46 UTC, Jan Kratochvil
no flags Details | Diff
Another backport part (6.34 KB, patch)
2007-10-17 18:26 UTC, Jan Kratochvil
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0811 0 normal SHIPPED_LIVE gdb bug fix update 2007-11-14 17:46:14 UTC

Description Andrew Cagney 2004-11-23 14:52:12 UTC
#0  0x0fe757c8 in poll () from /lib/tls/libc.so.6
#1  0x0f91f0f0 in g_main_context_acquire () from /usr/lib/libglib-2.0.so.0
#2  0x0fe757b0 in poll () from /lib/tls/libc.so.6
#3  0x1028bbe8 in ?? ()
#4  0x0fe757b0 in poll () from /lib/tls/libc.so.6
#5  0x1028bbe8 in ?? ()
#6  0x0fe757b0 in poll () from /lib/tls/libc.so.6
#7  0x0f93cd00 in g_static_private_free () from /usr/lib/libglib-2.0.so.0
Previous frame inner to this frame (corrupt stack?)

Comment 1 Andrew Cagney 2005-02-07 19:44:33 UTC
	attach to random program (eg gdm-binary)
	dwmw2_gone	(gdb) bt
	dwmw2_gone	#0 0x07632f68 in __read_nocancel () from /lib/tls/libc.so.6
	dwmw2_gone	#1 0x08026990 in gdm_fdgetc () from /usr/bin/gdm-binary
	dwmw2_gone	#2 0x0801c930 in gdm_slave_greeter_ctl () from
/usr/bin/gdm-binary
	dwmw2_gone	#3 0x0801c930 in gdm_slave_greeter_ctl () from
/usr/bin/gdm-binary
	dwmw2_gone	#4 0x0801c930 in gdm_slave_greeter_ctl () from
/usr/bin/gdm-binary
	dwmw2_gone	...
	dwmw2_gone	#18 0x0801c930 in gdm_slave_greeter_ctl () from
/usr/bin/gdm-binary
	dwmw2_gone	Previous frame inner to this frame (corrupt stack?)
	dwmw2_gone	revert to FC2 gdb again
	dwmw2_gone	(gdb) bt
	dwmw2_gone	#0 0x07632f68 in __read_nocancel () from /lib/tls/libc.so.6
	dwmw2_gone	#1 0x08026990 in gdm_fdgetc () from /usr/bin/gdm-binary
	dwmw2_gone	#2 0x0801c930 in gdm_slave_greeter_ctl () from
/usr/bin/gdm-binary
	dwmw2_gone	#3 0x0802fca4 in gdm_verify_select_user () from
/usr/bin/gdm-binary
	dwmw2_gone	#4 0x07fda288 in pam_get_user () from /lib/libpam.so.0
	dwmw2_gone	#5 0x071a8c4c in pam_sm_authenticate ()
	dwmw2_gone	from /lib/security/../../lib/security/pam_unix.so
	dwmw2_gone	#6 0x07fdb730 in _pam_dispatch () from /lib/libpam.so.0
	dwmw2_gone	#7 0x07253878 in ?? () from /lib/security/pam_stack.so

Comment 2 Jan Kratochvil 2007-01-01 21:14:50 UTC
Created attachment 144612 [details]
non-PIC unwinding fix

Those repeating poll(2)s could be fixed (a bit) by installing *-debuginfo.
OTOH this patch should fix the unwinding even without *-debuginfo (non-CFI
way).

Still not committed to RawHide as failing to test for regressions (build system
shows regressions but I do not believe them, tooma.toronto.redhat.com died,
RHTS refuses to install any ppc recent OS).

Comment 3 Jan Kratochvil 2007-01-01 21:20:46 UTC
Created attachment 144613 [details]
Existing `gdb-6.3-ppccfi-20041104.patch' difference.

Update for existing PPC CFI enabler to make it compatible with recent GCC.
Questions:
(1) Why is GCC using bogus "Return Address: 65" if the appropriate (while not
    strictly valid as PPC DWARF does not have PC register number) register
would
    be 108 (LR=Link Register).
(2) Why GDB before did not properly map CR (64) and FPSCR (65) registers if
    their numbers had to be known that time?
TO be posted upstream after I test the patches validity.

Still not committed to RawHide as failing to test for regressions (build system

shows regressions but I do not believe them, tooma.toronto.redhat.com died,
RHTS refuses to install any ppc recent OS).

Comment 5 Jan Kratochvil 2007-01-12 22:23:13 UTC
Committed at least the nonproblematic non-CFI part to RawHide now (no testcase):

* Fri Jan 12 2007 Jan Kratochvil <jan.kratochvil> - 6.5-25
- Fix unwinding of non-CFI (w/o debuginfo) PPC code by recent GCC (BZ 140532).

Also some SUSE .eh_frame PPC renumbering patches (the real one so far not accepted):
http://sourceware.org/ml/gdb-patches/2006-05/msg00165.html
http://sourceware.org/ml/gdb-patches/2006-05/msg00166.html


Comment 6 Jan Kratochvil 2007-01-13 00:27:36 UTC
Comment on attachment 144613 [details]
Existing `gdb-6.3-ppccfi-20041104.patch' difference.

Dropped this patch incl. its original as following more the SUSE/Andreas
Schwab's way.

Comment 7 Jan Kratochvil 2007-01-13 00:32:15 UTC
Created attachment 145505 [details]
Andreas Schwab's original imported PPC .eh_frame support patch.

Comment 8 Jan Kratochvil 2007-01-13 00:33:54 UTC
Created attachment 145506 [details]
Patch workarounding GCC's broken .debug_frame CIE return address + fixing/completing DWARF registers mapping.

Comment 9 Jan Kratochvil 2007-01-13 02:46:51 UTC
Created attachment 145513 [details]
Overall PPC-targeted PPC-nonspecific testcase.

Comment 10 Jan Kratochvil 2007-01-13 09:32:31 UTC
Committed to RawHide:
* Fri Jan 13 2007 Jan Kratochvil <jan.kratochvil> - 6.5-26
- Fix unwinding of non-debug (.eh_frame) PPC code, Andreas Schwab (BZ 140532).
- Fix unwinding of debug (.debug_frame) PPC code, workaround GCC (BZ 140532).


Comment 11 Jan Kratochvil 2007-01-13 09:38:03 UTC
Posted upstream:
http://sources.redhat.com/ml/gdb-patches/2007-01/msg00327.html


Comment 12 Jan Kratochvil 2007-02-05 09:48:03 UTC
Just KFAILed the false FAILs of `bt-ppc' testcase on x86_64:
* Mon Feb  5 2007 Jan Kratochvil <jan.kratochvil> - 6.6-3
- Testcase of unwinding has now marked its unsolvable cases (for BZ 140532).

++      # We get correct unwind but with two excessive "??" entries
++      # due to undetectable inserted alignment entry.
++      # With -fa-u-t we have correct FDE, without -O2 we have frame pointer.
++      #       1  0x0000003acb631980 in abort () from /lib64/libc.so.6
++      #       2  0x0000000000400489 in func0 ()
++      #       3  0x00000000004004d0 in ?? ()
++      #       4  0x0000000000400499 in func1 ()
++      #       5  0x00007fffc5442410 in ?? ()
++      #       6  0x00000000004004b9 in main ()


Comment 13 RHEL Program Management 2007-05-09 11:28:56 UTC
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 14 Andrew Cagney 2007-07-30 19:12:58 UTC
Testcase?
Removal of existing patch that worked around PPC's botched return-address column?


Comment 18 Andrew Cagney 2007-08-02 18:45:18 UTC
Fix and testcaes available; final approval is still dependent on available QE slot.

Comment 22 Jan Kratochvil 2007-10-17 18:26:30 UTC
Created attachment 230151 [details]
Another backport part

This patch backports another part of the PPC backtrace/prologue code, built at:

  http://brewweb.devel.redhat.com/brew/taskinfo?taskID=1011017
It fixed the gdb.pie/break.exp regression at:
  http://errata.devel.redhat.com/errata/show/6150#c14
but it has probably other regressions:
--- tests/gdb-6.3.0.0-1.153.el4.ppc.sum 2007-10-17 20:18:15.801823000 +0200
+++ tests/gdb-1011017-ppc.sum	2007-10-17 20:18:19.123503000 +0200
-PASS: gdb.base/break.exp: breakpoint small function, optimized file
+FAIL: gdb.base/break.exp: breakpoint small function, optimized file
-PASS: gdb.base/break.exp: run until breakpoint set at small function,
optimized file
+FAIL: gdb.base/break.exp: run until breakpoint set at small function,
optimized file
-FAIL: gdb.pie/break.exp: breakpoint function, optimized file
+PASS: gdb.pie/break.exp: breakpoint function, optimized file

--- tests/gdb-6.3.0.0-1.153.el4.ppc64.sum	2007-10-17 20:18:16.302327000
+0200
+++ tests/gdb-1011017-ppc64.sum 2007-10-17 20:18:19.633988000 +0200
-PASS: gdb.base/break.exp: breakpoint small function, optimized file
-PASS: gdb.base/break.exp: run until function breakpoint, optimized file
-PASS: gdb.base/break.exp: run until breakpoint set at small function,
optimized file
+FAIL: gdb.base/break.exp: breakpoint small function, optimized file
+FAIL: gdb.base/break.exp: run until function breakpoint, optimized file
+FAIL: gdb.base/break.exp: run until breakpoint set at small function,
optimized file
-FAIL: gdb.base/sepdebug.exp: run until function breakpoint
+PASS: gdb.base/sepdebug.exp: run until function breakpoint
-FAIL: gdb.base/sepdebug.exp: run until breakpoint set at small function,
optimized file
+PASS: gdb.base/sepdebug.exp: run until breakpoint set at small function,
optimized file
-PASS: gdb.pie/break.exp: breakpoint small function, optimized file
-PASS: gdb.pie/break.exp: run until function breakpoint, optimized file
-PASS: gdb.pie/break.exp: run until breakpoint set at small function, optimized
file
+FAIL: gdb.pie/break.exp: breakpoint small function, optimized file
+FAIL: gdb.pie/break.exp: run until function breakpoint, optimized file
+FAIL: gdb.pie/break.exp: run until breakpoint set at small function, optimized
file

Comment 26 Jan Kratochvil 2007-10-18 10:47:58 UTC
Don,
yesterday I forgot to note this whole issue of Comment 25 affects only the
PowerPC platform, if it still could be included for the final release notes, sorry.


Comment 27 Don Domingo 2007-10-18 22:35:00 UTC
thanks Jan. note edited accordingly to appear only in PPC release notes updates

Comment 30 errata-xmlrpc 2007-11-15 16:11:28 UTC
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-0811.html


Comment 31 Don Domingo 2008-04-28 03:03:23 UTC
quick note: added to RHEL4.7 release notes under "Resolved Issues":

<quote>
(ppc) The command break <function_name> no longer stops the execution later than
the first code instruction. As such, the function parameters are now properly
displayed when you run this command.
</quote>

please advise if any further revisions are required. thanks!

Comment 32 Don Domingo 2008-06-02 23:13:59 UTC
Hi,

the RHEL4.7 release notes deadline is on June 17, 2008 (Tuesday). they will
undergo a final proofread before being dropped to translation, at which point no
further additions or revisions will be entertained.

a mockup of the RHEL4.7 release notes can be viewed here:
http://intranet.corp.redhat.com/ic/intranet/RHEL4u7relnotesmockup.html

please use the aforementioned link to verify if your bugzilla is already in the
release notes (if it needs to be). each item in the release notes contains a
link to its original bug; as such, you can search through the release notes by
bug number.

Cheers,
Don


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