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
Created attachment 381798 [details] File: backtrace
Sure enough, without -feliminate-dwarf2-dups, gdb behaves normally.
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.)
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.
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....
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.
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
Thanks for tracking that down, Tom.
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
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.