Bug 32990 - [Regression] gdb has symbol table issues
Summary: [Regression] gdb has symbol table issues
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-04 23:13 UTC by Ryan Johnson
Modified: 2007-08-14 14:08 UTC (History)
2 users (show)

See Also:
Host:
Target: x86_64-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Output of readelf -wf (74.51 KB, text/plain)
2007-08-10 16:20 UTC, Ryan Johnson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Johnson 2007-08-04 23:13:11 UTC
When debugging code produced by g++-4.3.0-20070716 the debugger regularly outputs the following error message when stopping at breakpoints or examining stack frames:

error: warning: (Internal error: pc 0x419e59 in read in psymtab, but not in symtab.) 

Compiling the same code with g++-4.1.2 and running the same breakpoints results in no problems. I'm using gdb-6.6-debian, if that's any help.

Unfortunately I have no idea how to narrow the test case down, and am not allowed to submit my program (it's from work). Some searching on Google indicates that .linkonce functions might be part of the issue (I have tons of those), but other than that I'm at a loss to narrow down the problem.  If anyone has ideas I'm happy to try them out and report back.
Comment 1 Andrew Pinski 2007-08-05 19:50:28 UTC
First if gdb is throwing an internal error, then there is a bug in gdb.  Now if you can prove somehow gcc's debug info is broken, then GCC has a bug.  But until we get a testcase, it is hard to say anything really.
Comment 2 Daniel Jacobowitz 2007-08-06 13:21:25 UTC
Subject: Re:   New: [Regression] gdb has symbol table issues

On Sat, Aug 04, 2007 at 11:13:11PM -0000, scovich at gmail dot com wrote:
> When debugging code produced by g++-4.3.0-20070716 the debugger regularly
> outputs the following error message when stopping at breakpoints or examining
> stack frames:
> 
> error: warning: (Internal error: pc 0x419e59 in read in psymtab, but not in
> symtab.) 

This is more likely to be a bug in GDB than in GCC.  We would need at
least the debugging info (readelf -wf) from the compilation unit
containing that address.  But the GDB developers will probably not be
able to help you without a testcase, either.

Comment 3 Ryan Johnson 2007-08-10 16:20:01 UTC
Created attachment 14050 [details]
Output of readelf -wf

I'm attaching the output of `readelf -wf' This time around some of offending PC are 0x41ac8c, 0x41bc1c, 0x41bc2d, 0x41bc44, 0x41bc45, 0x41bc55, 0x41bc56, 0x41bc63, 0x41bc64.

Also in case it helps, `readelf -a' prints the following warning/error messages:
readelf: Warning: There is a hole [0xe1fc - 0xe238] in .debug_loc section.
readelf: Warning: There is a hole [0x100dc - 0x10118] in .debug_loc section.
readelf: Warning: There is a hole [0x13860 - 0x1389c] in .debug_loc section.
readelf: Warning: There is a hole [0x138ac - 0x138e8] in .debug_loc section.
readelf: Warning: There is a hole [0x13c3c - 0x13c78] in .debug_loc section.
readelf: Warning: There is a hole [0x13f34 - 0x13f70] in .debug_loc section.
readelf: Warning: There is a hole [0x13f80 - 0x13fbc] in .debug_loc section.
readelf: Warning: There is a hole [0x14148 - 0x14184] in .debug_loc section.
readelf: Warning: There is a hole [0x15908 - 0x15944] in .debug_loc section.
readelf: Warning: There is a hole [0x16618 - 0x16654] in .debug_loc section.
readelf: Warning: There is a hole [0x17f54 - 0x17f90] in .debug_loc section.
readelf: Warning: There is a hole [0x17fec - 0x18028] in .debug_loc section.
readelf: Warning: There is a hole [0x1824c - 0x18288] in .debug_loc section.
readelf: Warning: There is a hole [0x184ac - 0x184e8] in .debug_loc section.
readelf: Warning: There is a hole [0x18590 - 0x185cc] in .debug_loc section.
readelf: Warning: There is a hole [0x22a08 - 0x22a44] in .debug_loc section.
readelf: Warning: There is a hole [0x232f0 - 0x2332c] in .debug_loc section.
readelf: Warning: There is a hole [0x26944 - 0x26980] in .debug_loc section.
readelf: Warning: There is a hole [0x29320 - 0x2935c] in .debug_loc section.
readelf: Warning: There is a hole [0x29878 - 0x298b4] in .debug_loc section.
readelf: Warning: There is a hole [0x29910 - 0x2994c] in .debug_loc section.
readelf: Error: Range lists in .debug_info section aren't in ascending order!
readelf: Warning: There is a hole [0x50 - 0xb0] in .debug_ranges section.
readelf: Warning: There is an overlap [0x2fe0 - 0x50] in .debug_ranges section.
readelf: Warning: There is a hole [0xb0 - 0x3010] in .debug_ranges section.
readelf: Warning: There is an overlap [0x30b0 - 0x2fe0] in .debug_ranges section.
readelf: Warning: There is a hole [0x3010 - 0x56e0] in .debug_ranges section.
readelf: Warning: There is a hole [0x7610 - 0x76d0] in .debug_ranges section.
readelf: Warning: There is an overlap [0x7700 - 0x7610] in .debug_ranges section.
readelf: Warning: There is a hole [0x76d0 - 0x9b40] in .debug_ranges section.
readelf: Warning: There is an overlap [0xd700 - 0x9a20] in .debug_ranges section.
readelf: Warning: There is a hole [0x9b40 - 0xd700] in .debug_ranges section.
Comment 4 Ryan Johnson 2007-08-10 16:39:00 UTC
The problem comes from adding a member function to a header file and only recompiling some of the source files that include it (make depend missed something). It looked like a regression because changing versions of gcc required a clean recompile.
Comment 5 Ryan Johnson 2007-08-10 16:50:26 UTC
Murphy strikes again -- 5 minutes after closing this bug it popped back up in spite of a clean compile. Apparently `make clean' can change which PC causes complaints but doesn't necessarily fix the problem. 
Comment 6 Daniel Jacobowitz 2007-08-13 20:29:31 UTC
Sorry, my mistake.  I meant readelf -wi (lowercase I).
Comment 7 Ryan Johnson 2007-08-13 21:10:50 UTC
(In reply to comment #6)
> Sorry, my mistake.  I meant readelf -wi (lowercase I).
> 

Unfortunately, I recompiled with 4.1 to get on with debugging, and also updated to 20070810 later that day. Now the bug won't cooperate and show up any more. Maybe the changes over the last three weeks fixed the problem? 

Also unfortunately, I will lose access to the code once my internship ends this week.  It might be best to close this bug or leave it in WAITING as a placeholder in case anyone else sees the same thing in an easier-to-replicate context...
Comment 8 Daniel Jacobowitz 2007-08-14 14:08:44 UTC
I don't think there's anything useful we can do with it without a testcase, unfortunately.