A bug in symbol loading in winedbg

Shachar Shemesh wine-devel at shemesh.biz
Fri Jun 11 02:47:26 CDT 2004


Shachar Shemesh wrote:

> Eric Pouech wrote:
>
>> Shachar Shemesh a e'crit :
>>
>>> Hi all,
>>>
>>> Bug Report:
>>> If winedbg is asked to load an external PDB file, and that file does 
>>> not match the executable being run, the debugger does not warn about 
>>> it. Instead, bad things (tm) happen when actually trying to run the 
>>> executable.
>>>
>>>          Shachar
>>>
>>>
>> could you be more specific on the errors ?
>> - running with +dbghelp
>> - pasting the output of 'info module'
>> what are the 'bad things' you're talking about ?
>>
>> A+
>
>
>
> I'm sorry - I wrote this email in a hurry, so I don't forget of the 
> problem's existance. Will give more details a bit later.
>
>             Shachar

Ok, here goes:
First - reconstruction instructions (Visual Studio 6, latest SP):
Take any C++ project (it happens with the one generated when you ask for 
a sample "hello world" application). Copy the "Release" configuration 
over, and open the project settings. Add to the "C/C++" tab, in the 
"General" section, "Debug info: Program Database". In the "Link" tab, in 
"Debug", check "Debug info", with "Microsoft format". At this point, if 
you compile your project, visual studio's integrated debugger sees the 
debug info, and can debug the application. However, if you try to load 
this very same application in winedbg, it fails to load the symbols. 
Output pasted later on.

Next, go back to the "Link" tab, and add "Separate types". Recompile 
(make sure you "rebuild all"). Now winedbg can see the debug info, and 
works. Before the latest winedbg patch, it worked in the previous mode 
as well.

Sample session of showdebug/semidebug$ WINEDEBUG=+dbghelp winedbg 
showdebug.exe
Since there is lots of cruft there, I ran it once working and once not, 
and am only pasting the diff between the two here. Those marked with ">" 
are the lines when things are working (scroll to the end to verify). The 
command run was "break WinMain".

> 523,524c523,657
> < err:dbghelp_msc:pe_load_debug_directory Got a page fault while 
> loading symbols
> < trace:dbghelp:SymEnumSymbols (0x34 00000000 "*!_WinMain" 0x40768c40 
> 0x4088e110)
> ---
> > err:dbghelp_msc:pdb_process_file -Type server .PDB imports ignored!
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1002
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > fixme:dbghelp_msc:codeview_snarf Unsupported id 1013
> > trace:dbghelp:SymGetLineFromAddr 0x34 00401000 (nil) 0x4088db74
> 526,527c659,660
> < No symbols found for WinMain
> < Unable to add breakpoint, will check again when a new DLL is loaded
> ---
> > Breakpoint 1 at 0x00401000 WinMaintrace:dbghelp:SymGetLineFromAddr 
> 0x34 00401000 (nil) 0x4088e938
> >  [S:\showdebug\showdebug.cpp:24] in showdebug

Let me know if you need any more info.

(obviously, for program listing to actually work, I pointed wine's S: to 
where my sources reside).

             Shachar

-- 
Shachar Shemesh
Lingnu Open Source Consulting ltd.
http://www.lingnu.com/




More information about the wine-devel mailing list