NO

Author Topic: Debugging: "Problem loading codeview information. Error reading from file."  (Read 9736 times)

AllBackJack

  • Guest
Got a C project that I've been working on and debugging for a little while. No real problems with Pelles C.   Suddenly I'm getting a popup that says "Problem loading codeview information. Error reading from file.", and the debug window shows just assembly output. The debugger tab on the bottom also contains

Process 10F4 started
Thread 1558 started
Problem loading CodeView information
Loading myprog.exe at 00400000
Loading ntdll.dll at 7C900000
Loading KERNEL32.dll at 7C800000
Done

I've deleted the output directory, all the objects, the exe, the tag file, rebuilt many times, etc. I can't seem to get rid of this. Tried changing the project options, etc. It just suddenly started appearing. If I allow execution to start eventually my program crashes at bad memory reference, and the debugger displays just the assembly output. No sources.

Zipped up executable can be found in http://www.burness.com/files/NoCodeview.zip

As an extra, probably extraneous bit of information, I also have Visual Studio on my system, and what's interesting is that if I just start my .exe running, when it hits the bug and crashes, I can use Visual Studio as the debugger, and it does indeed pick up all the correct symbol and source file info from the .exe to display the correct line. So the .exe probably contains the correct debugging information. But something is screwed up so that Pelles can't seem to get the info.

Help is Needed !!!!!!!

  Thanks
  Jack


« Last Edit: March 30, 2007, 10:47:14 PM by AllBackJack »

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Not sure what to make of this. Attempting to load the executable in Visual Studio 2005 gives the message "Cannot enumerate resources in the executable". Loading the executable in my 4.50 IDE works(!) - no error. Loading the executable in a more recent development version of the IDE gives the CodeView loading problem you describe. Tracing this, and looking at a dump of the CodeView information inside the executable, it appears that the Global types section is corrupt. Not sure why, and impossible to tell from the executable alone.

If nothing has happend to the executable after linking, it appears that polink is either producing corrupt information, or is unable to correctly handle corrupt input. Either way, what I need to trace this problem further, is the object files required to successfully link the executable, including the linker options used (the command line for polink). If you can post or mail me this, it would be helpful I think...

As a side note, it suprises me that Visual Studio can display correct symbol and source file info. They stopped documenting the CodeView format years ago, but since then the format has changed considerably, and it appears that the Visual Studio debugger only supports more recent versions. If I try to debug an executable from polink with Visual Studio 2005, I usually get a message saying "The debug format is obsolete".

 
/Pelle

AllBackJack

  • Guest
OK, what I've done is to redo the zip file located in  http://www.burness.com/files/NoCodeview.zip   to have the .obj's plus the project files and the map file, just in case there is some dangling piece of useful information in there. Only thing not in there are the source files, which I can't let out. FYI, the executable is not the name I used before (i.e. "MyProg.exe" to simplify things), but rather the "real" executable name of rmu_FakeIOLib.exe.

  Thanks
  Jack

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Thank you for the files - that did the trick.

To try and make a long story short, the problem was with a structure that had a "self" reference, and the total size of the structure was larger than 32767 bytes. The "self" reference part will happen for any linked list structure (the "next" member), but I guess not many structures are this big. This is probably why this bug survived some 4 - 5 years.

Attached is a new version of POLINK (4.50.3), which should fix the problem. I have done a number of tests, and gone through half a megabyte of dump files, and I can't see any problem, but since you have the source files and the problem, I would appreciate if you could try it out too, and report how it went... (before I upload another Setup package to Smorgasbordet...)
/Pelle

AllBackJack

  • Guest
It WORKS !!!!!!       ;D

  Mucho Thanks
  Jack

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 394
    • Alex's Link Sammlung
Attached is a new version of POLINK (4.50.3), which should fix the problem. I have done a number of tests, and gone through half a megabyte of dump files, and I can't see any problem, but since you have the source files and the problem, I would appreciate if you could try it out too, and report how it went... (before I upload another Setup package to Smorgasbordet...)

Will you put this update of polink to your download-page, so people which don´t read this topic can have advantage from this update.  :)

best regards
Alex  ;)
« Last Edit: April 03, 2007, 09:33:24 AM by AlexN »
best regards
 Alex ;)

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
It WORKS !!!!!!       ;D
Great news. Thanks for the info!
/Pelle

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Will you put this update of polink to your download-page, so people which don´t read this topic can have advantage from this update.  :)
Yes - I thought I already answered that...?
/Pelle

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 394
    • Alex's Link Sammlung
Will you put this update of polink to your download-page, so people which don´t read this topic can have advantage from this update.  :)
Yes - I thought I already answered that...?
Sorry, I read only the more interesting part of your message. :(

best regards
 Alex ;)

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
 ;D OK - I promise to write the unimportant stuff in bold in the future...  ;)
/Pelle