Bug 42362 - gdb stack crawl at point of internal error in WalkerTest
Summary: gdb stack crawl at point of internal error in WalkerTest
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-13 22:30 UTC by Jack Howarth
Modified: 2009-12-13 22:59 UTC (History)
1 user (show)

See Also:
Host: x86_64-apple-darwin10
Target: x86_64-apple-darwin10
Build: x86_64-apple-darwin10
Known to work:
Known to fail:
Last reconfirmed:


Attachments
assembly from WalkerTest.jar in gcc trunk on x86_64-apple-darwin10 (1.60 KB, text/plain)
2009-12-13 22:34 UTC, Jack Howarth
Details
assembly from WalkerTest.jar in gcc 4.4.2 on x86_64-apple-darwin10 (1.45 KB, text/plain)
2009-12-13 22:34 UTC, Jack Howarth
Details
diff between assembly from gcc 4.4.2 and gcc trunk on x86_64-apple-darwin10 (1.74 KB, text/plain)
2009-12-13 22:36 UTC, Jack Howarth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jack Howarth 2009-12-13 22:30:12 UTC
The dwarf debug code generated by gcj in gcc trunk is not backward compatible with the older gdb release used by Apple in darwin10.  When compiled as...

gcj WalkerTest.jar -w -bind_at_load -multiply_defined suppress -Wl,-allow_stack_execute --main=WalkerTest -g -lm -o WalkerTest.exe 

The resulting WalkerTest.exe binary from gcc trunk causes the following error in Apple's gdb...

gdb ./WalkerTest.exeGNU gdb 6.3.50-20050815 (Apple version gdb-1346) (Fri Sep 18 20:40:51 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ...... done

gdb stack crawl at point of internal error:
0   gdb-i386-apple-darwin               0x00000001001076e7 internal_vproblem + 308
1   gdb-i386-apple-darwin               0x00000001001078c1 internal_verror + 27
2   gdb-i386-apple-darwin               0x000000010010795f align_down + 0
3   gdb-i386-apple-darwin               0x00000001000b1fc4 find_partial_die_in_comp_unit + 79
4   gdb-i386-apple-darwin               0x00000001000bd97f find_partial_die + 626
5   gdb-i386-apple-darwin               0x00000001000bd9cc fixup_partial_die + 55
6   gdb-i386-apple-darwin               0x00000001000be08d scan_partial_symbols + 58
7   gdb-i386-apple-darwin               0x00000001000bef51 dwarf2_build_psymtabs + 2982
8   gdb-i386-apple-darwin               0x0000000100144af3 macho_symfile_read + 294
9   gdb-i386-apple-darwin               0x000000010004bbb8 syms_from_objfile + 1401
10  gdb-i386-apple-darwin               0x000000010004c601 symbol_file_add_with_addrs_or_offsets_using_objfile + 690
11  gdb-i386-apple-darwin               0x000000010004c5bb symbol_file_add_with_addrs_or_offsets_using_objfile + 620
12  gdb-i386-apple-darwin               0x000000010004c894 symbol_file_add_name_with_addrs_or_offsets + 117
13  gdb-i386-apple-darwin               0x000000010004cd5c symbol_file_add_main_1 + 207
14  gdb-i386-apple-darwin               0x000000010006e75d catch_command_errors + 65
/SourceCache/gdb/gdb-1346/src/gdb/dwarf2read.c:8233: internal-error: could not find partial DIE in cache

A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n

This error doesn't occur when the FSF gdb from the current gdb cvs is used. The problem also doesn't occur with Apple's gdb when the WalkerTest is compiled with the gcj from gcc 4.4.2.
Comment 1 Andrew Pinski 2009-12-13 22:31:30 UTC
Sounds like this should be reported to Apple really.
Comment 2 Jack Howarth 2009-12-13 22:34:09 UTC
Created attachment 19284 [details]
assembly from WalkerTest.jar in gcc trunk on x86_64-apple-darwin10

Generated with...

gcj WalkerTest.jar -w -bind_at_load -multiply_defined suppress -Wl,-allow_stack_execute --main=WalkerTest --save-temps -g -lm -o WalkerTest.exe
Comment 3 Jack Howarth 2009-12-13 22:34:51 UTC
Created attachment 19285 [details]
assembly from WalkerTest.jar in gcc 4.4.2 on x86_64-apple-darwin10

Generated using...

gcj WalkerTest.jar -w -bind_at_load -multiply_defined suppress -Wl,-allow_stack_execute --main=WalkerTest --save-temps -g -lm -o WalkerTest.exe
Comment 4 Jack Howarth 2009-12-13 22:36:11 UTC
Created attachment 19286 [details]
diff between assembly from gcc 4.4.2 and gcc trunk on x86_64-apple-darwin10
Comment 5 Jack Howarth 2009-12-13 22:37:10 UTC
Using built-in specs.
Reading specs from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.2.0/4.5.0/../../../libgcj.spec
rename spec startfile to startfileorig
rename spec lib to liborig
COLLECT_GCC=gcj
COLLECT_LTO_WRAPPER=/sw/lib/gcc4.5/libexec/gcc/x86_64-apple-darwin10.2.0/4.5.0/lto-wrapper
Target: x86_64-apple-darwin10.2.0
Configured with: ../gcc-4.5-20091211/configure --prefix=/sw --prefix=/sw/lib/gcc4.5 --mandir=/sw/share/man --infodir=/sw/share/info --enable-languages=c,c++,fortran,objc,obj-c++,java --with-gmp=/sw --with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-mpc=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --disable-libjava-multilib
Thread model: posix
gcc version 4.5.0 20091212 (experimental) (GCC)
Comment 6 Jack Howarth 2009-12-13 22:41:33 UTC
(In reply to comment #1)
> Sounds like this should be reported to Apple really.
> 

True except that i recall some discussion of making at least a minimal effort to be backward compatible with older gdb's. This should at least cover making a cursory evaluation of the cause of the gdb crash and whether there is a simple fix.
Comment 7 Richard Biener 2009-12-13 22:59:56 UTC
This isn't a gcc bug.