Bug 552619 - gdb crash when xemacs is compiled with -feliminate-dwarf2-dups
Summary: gdb crash when xemacs is compiled with -feliminate-dwarf2-dups
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: 12
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Tom Tromey
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:565693110765629e9050d67c3ea...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-05 17:09 UTC by Jerry James
Modified: 2014-08-11 05:46 UTC (History)
4 users (show)

Fixed In Version: gdb-7.0.1-34.fc12
Clone Of:
Environment:
Last Closed: 2010-03-16 00:50:26 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (6.81 KB, text/plain)
2010-01-05 17:09 UTC, Jerry James
no flags Details
Source file with an inline function (561 bytes, text/plain)
2010-02-25 21:15 UTC, Jerry James
no flags Details

Description Jerry James 2010-01-05 17:09:01 UTC
abrt 1.0.0 detected a crash.

How to reproduce
-----
1. Compile XEmacs with these flags: -march=core2 -pipe -D_FORTIFY_SOURCE=2 -feliminate-dwarf2-dups -fno-strict-aliasing -O2 -g3
2. Start gdb with "gdb src/xemacs"
3. At the gdb prompt, type "run"

Comment: I'm guessing that either -feliminate-dwarf2-dups or -g3 produced dwarf2 output that gdb didn't expect.  I've used the former for many years, because it drastically reduces the size of the debug information.  I'll try dropping one or both of these and see if the gdb crash goes away.
Attached file: backtrace
cmdline: gdb ./xemacs
component: gdb
executable: /usr/bin/gdb
kernel: 2.6.31.9-174.fc12.x86_64
package: gdb-7.0.1-19.fc12
rating: 4
reason: Process was terminated by signal 11

Comment 1 Jerry James 2010-01-05 17:09:03 UTC
Created attachment 381798 [details]
File: backtrace

Comment 2 Jerry James 2010-01-05 17:15:14 UTC
Sure enough, without -feliminate-dwarf2-dups, gdb behaves normally.

Comment 3 Tom Tromey 2010-02-25 20:50:59 UTC
My first suspicion is that there is an underlying gcc bug.
What version of gcc did you use?
(gdb ideally should not crash on invalid dwarf, but my
understanding is that some checking is omitted because it
would slow down startup too much.)

Comment 4 Jerry James 2010-02-25 21:11:01 UTC
I apply updates aggressively, so there's no telling. :-)  However, I just tried it again with the same results.

gcc-4.4.3-4.fc12.x86_64
gdb-7.0.1-31.fc12.x86_64

I wonder if this has something to do with XEmacs' aggressive use of inline functions.  I'm going to try a little test and see if I can trigger the bug.

Comment 5 Jerry James 2010-02-25 21:15:36 UTC
Created attachment 396395 [details]
Source file with an inline function

If I compile this source file with -feliminate-dwarf2-dups, then on starting up GDB, it warns:

Reading symbols from /tmp/test/inline-test...done.
DW_FORM_strp pointing outside of .debug_str section [in module /tmp/test/inline-test]

but doesn't if I omit the -feliminate-dwarf2-dups flag.  I have no idea if this has anything to do with the crash.  Maybe I need to define LOTS of inline functions....

Comment 6 Tom Tromey 2010-03-04 21:19:30 UTC
Thanks for the test case.
This is definitely a gdb bug, not a gcc bug.
The problem is that DWARF 3 specified a change in the
size of DW_FORM_ref_addr, and gdb did not implement this change.
I'm working on it.

Comment 7 Tom Tromey 2010-03-04 22:02:26 UTC
I pushed the fix into upstream gdb.
Jan, this should go into our releases as well.
http://sourceware.org/ml/gdb-patches/2010-03/msg00219.html

Comment 8 Jerry James 2010-03-04 22:07:46 UTC
Thanks for tracking that down, Tom.

Comment 9 Fedora Update System 2010-03-12 13:58:40 UTC
gdb-7.0.1-34.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/gdb-7.0.1-34.fc12

Comment 10 Fedora Update System 2010-03-16 00:50:05 UTC
gdb-7.0.1-34.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


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