Discussion:
Exe and PDB having different names
(too old to reply)
Lady_A
2007-01-17 23:44:51 UTC
Permalink
Hi,

My project has some special needs that due to them the building (using
a make file system) is done in the following way : build A.win and
A.pdb then build B.exe from A.win. I am talking about DEBUG mode.
My goal is to analyze a mini dmp file using WinDgb while what I have is
B.exe and A.pdb
The pdb is good for debugging B.exe - I can debug using VS 2003 by
attaching to the process and I was able to open the mini dmp files
successfully at some point last week.
I ran the chksym utility and it confirms the A.pdb and B.exe match
Now I am struggling with some symbol matching problem in WinDbg.
I have the unable to verify checksum problem and thats fine since I am
in debug mode.
However, I also have :
*** ERROR: Symbol file could not be found.
used !sym -noisy and then reloaded the module and got
A.pdb - mismatched pdb
*** ERROR: Symbol file could not be found.
Renaming does not seem to solve anything.

I rebuilt my project, opened the executable and its the same problem.

Please help...
Oleg Starodumov
2007-01-18 09:37:12 UTC
Permalink
Post by Lady_A
My project has some special needs that due to them the building (using
a make file system) is done in the following way : build A.win and
A.pdb then build B.exe from A.win. I am talking about DEBUG mode.
My goal is to analyze a mini dmp file using WinDgb while what I have is
B.exe and A.pdb
The pdb is good for debugging B.exe - I can debug using VS 2003 by
attaching to the process and I was able to open the mini dmp files
successfully at some point last week.
I ran the chksym utility and it confirms the A.pdb and B.exe match
Now I am struggling with some symbol matching problem in WinDbg.
I have the unable to verify checksum problem and thats fine since I am
in debug mode.
*** ERROR: Symbol file could not be found.
used !sym -noisy and then reloaded the module and got
A.pdb - mismatched pdb
*** ERROR: Symbol file could not be found.
Renaming does not seem to solve anything.
Is it correct that live debugging of B.exe works, while debugging of the minidump
doesn't? If so, the first guess would be that the debugger cannot find matching
B.exe, not A.pdb (and to solve the problem, the location of matching B.exe
should be added to the search path e.g. using .exepath command).
Output of the following commands (when analysing the dump) could help
to check if that is true or not:

!sym noisy
.reload /f B.exe
!lmi B.exe

If it does not help, please post here the output of these commands, anyway.

--
Oleg
[VC++ MVP http://www.debuginfo.com/]
Lady_A
2007-01-19 07:20:09 UTC
Permalink
Oleg - thank you so much for your help!

I want to make 2 things clear :
B.exe is basically A.win renamed.
Each time I build the project I can sucessfully attach to the process
and debug it.
This time I did not try before giving the build for testing - of course
there is the slight chance that I am out of luck and of all the builds
I would not have been able to debug this one using VS.
In such a case - could you please tell me in what way can I check that
the build will be able to open in WinDbg and find the symbols correctly
? I tried the open executable command, after I made a brand new build,
setting all the sym path and source path and I still have the same
errors basically. I know I can debug in VS with that new build.

Here is the output from running the commands you suggested on my dump
opened in WinDbg :

Symbol search path is: MyPath
Executable search path is: MyPath
.........................................
*** ERROR: Symbol file could not be found. Defaulted to export symbols
for ntdll.dll -
This dump file has an exception of interest stored in it.
The stored exception information can be accessed via .ecxr.
(f8c.7bc): Access violation - code c0000005 (first/second chance not
available)
eax=0105ce48 ebx=00000000 ecx=0105ce48 edx=dddddddd esi=01d7ec8c
edi=01d7f364
eip=005094e1 esp=01d7ec88 ebp=01d7f364 iopl=0 nv up ei pl nz na
pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000
efl=00000206
*** WARNING: Unable to verify checksum for B.exe
*** ERROR: Symbol file could not be found. Defaulted to export symbols
for B.exe -
my_product_name_which_is_B+0x1094e1:
005094e1 ff12 call dword ptr [edx]
ds:0023:dddddddd=????????
0:010> .exepath
Executable image search path is: MyPath
0:010> .sympath
Symbol search path is: MyPath
0:010> !sym noisy
noisy mode - symbol prompts on
0:010> .reload /f B.exe
DBGHELP: MyPath\A.pdb - mismatched pdb
DBGHELP: MyPath\symbols\exe\A.pdb - file not found
DBGHELP: MyPath\exe\A.pdb - file not found
DBGHELP: MySourcePath\A.pdb - file not found
DBGHELP: Couldn't load mismatched pdb for B.exe
*** WARNING: Unable to verify checksum for B.exe
*** ERROR: Symbol file could not be found. Defaulted to export symbols
for B.exe -
DBGHELP: B- export symbols
0:010> !lmi B.exe
Loaded Module Info: [B.exe]
Module: B
Base Address: 00400000
Image Name: B.exe
Machine Type: 332 (I386)
Time Stamp: 45a85018 Fri Jan 12 19:20:56 2007
Size: 3f5000
CheckSum: 0
Characteristics: 10f
Debug Data Dirs: Type Size VA Pointer
CODEVIEW 4d, 39622c, 39622c RSDS - GUID: {CD260FC1-
5BA-446E-BAD5-D8B7B6525928}
Age: 1, Pdb: MySourcePath\A.pdb
Image Type: MEMORY - Image read successfully from loaded memory.
Symbol Type: EXPORT - PDB not found
Load Report: export symbols
0:010> .sympath MySourcePath
DBGHELP: Symbol Search Path: MySourcePath
Symbol search path is: C:\SRC\fnc1\googleclient\bin-DEBUG\
0:010> .reload /f B.exe
DBGHELP: MySourcePath\A.pdb - mismatched pdb
DBGHELP: MySourcePath\symbols\exe\A.pdb - file not found
DBGHELP: MySourcePath\exe\A.pdb - file not found
DBGHELP: MySourcePath\A.pdb - mismatched pdb
DBGHELP: Couldn't load mismatched pdb for B.exe
*** WARNING: Unable to verify checksum for B.exe
*** ERROR: Symbol file could not be found. Defaulted to export symbols
for B.exe -
DBGHELP: B - export symbols

Thanks!!!
Post by Oleg Starodumov
Post by Lady_A
My project has some special needs that due to them the building (using
a make file system) is done in the following way : build A.win and
A.pdb then build B.exe from A.win. I am talking about DEBUG mode.
My goal is to analyze a mini dmp file using WinDgb while what I have is
B.exe and A.pdb
The pdb is good for debugging B.exe - I can debug using VS 2003 by
attaching to the process and I was able to open the mini dmp files
successfully at some point last week.
I ran the chksym utility and it confirms the A.pdb and B.exe match
Now I am struggling with some symbol matching problem in WinDbg.
I have the unable to verify checksum problem and thats fine since I am
in debug mode.
*** ERROR: Symbol file could not be found.
used !sym -noisy and then reloaded the module and got
A.pdb - mismatched pdb
*** ERROR: Symbol file could not be found.
Renaming does not seem to solve anything.
Is it correct that live debugging of B.exe works, while debugging of the minidump
doesn't? If so, the first guess would be that the debugger cannot find matching
B.exe, not A.pdb (and to solve the problem, the location of matching B.exe
should be added to the search path e.g. using .exepath command).
Output of the following commands (when analysing the dump) could help
!sym noisy
.reload /f B.exe
!lmi B.exe
If it does not help, please post here the output of these commands, anyway.
--
Oleg
[VC++ MVP http://www.debuginfo.com/]
Oleg Starodumov
2007-01-19 08:04:58 UTC
Permalink
Post by Lady_A
B.exe is basically A.win renamed.
Each time I build the project I can sucessfully attach to the process
and debug it.
This time I did not try before giving the build for testing - of course
there is the slight chance that I am out of luck and of all the builds
I would not have been able to debug this one using VS.
In such a case - could you please tell me in what way can I check that
the build will be able to open in WinDbg and find the symbols correctly?
I tried the open executable command, after I made a brand new build,
setting all the sym path and source path and I still have the same
errors basically. I know I can debug in VS with that new build.
Yes, you should do "open executable" in WinDbg and then run the same
commands (.reload, etc.) to see if symbols have been loaded.

If VS2003 can load symbols but WinDbg cannot, it could happen that VS2003
finds matching symbols in some other location. Unfortunately, VS2003
does not offer a way to see where it loaded symbols from, but while it is running,
you can use e.g. ProcessExplorer from Sysinternals to check the list of files
loaded by VS2003 process and check where A.pdb was loaded from.

Also you can try to check if A.pdb really matches B.exe using this tool:
http://www.debuginfo.com/tools/chkmatch.html
What will it report?
Post by Lady_A
Here is the output from running the commands you suggested on my dump
It looks like B.exe was found correctly, but A.pdb really was not matched.

Oleg
Lady_A
2007-01-19 17:39:33 UTC
Permalink
Oleg,

Things got much better - WinDbg suceeded loading the pdb and matching
it using another new build.
I followed all your suggestions, debugged using VS, checked out in
process explorer which pdb does it use - same one by the way and then
switched to WinDbg, using 2 methods. 1) I atached to a running exe -
symbols got matched and 2) I opened the executable in WinDbg when it
was not running and the symbols got matched again! Oh Joy!

Now, what really confuses me is that I used chkmatch to analyze that
exe and pdb that I have the mini dump file for. It says its a match! I
tried opening the dump in WinDbg for the thousand time and of course
WinDbg refuses to match the symbols...
How do I know the same thing wont happen to the dump created with this
new build I have ?

Thanks!!!
Post by Oleg Starodumov
Post by Lady_A
B.exe is basically A.win renamed.
Each time I build the project I can sucessfully attach to the process
and debug it.
This time I did not try before giving the build for testing - of course
there is the slight chance that I am out of luck and of all the builds
I would not have been able to debug this one using VS.
In such a case - could you please tell me in what way can I check that
the build will be able to open in WinDbg and find the symbols correctly?
I tried the open executable command, after I made a brand new build,
setting all the sym path and source path and I still have the same
errors basically. I know I can debug in VS with that new build.
Yes, you should do "open executable" in WinDbg and then run the same
commands (.reload, etc.) to see if symbols have been loaded.
If VS2003 can load symbols but WinDbg cannot, it could happen that VS2003
finds matching symbols in some other location. Unfortunately, VS2003
does not offer a way to see where it loaded symbols from, but while it is running,
you can use e.g. ProcessExplorer from Sysinternals to check the list of files
loaded by VS2003 process and check where A.pdb was loaded from.
http://www.debuginfo.com/tools/chkmatch.html
What will it report?
Post by Lady_A
Here is the output from running the commands you suggested on my dump
It looks like B.exe was found correctly, but A.pdb really was not matched.
Oleg
Oleg Starodumov
2007-01-19 17:19:27 UTC
Permalink
What symbol options are active in WinDbg?
Print them with .symopt command.

Anyway, even if WinDbg refuses to load symbols when debugging the dump,
but you are sure that they match (confirmed with live debugging with
WinDbg, VS, ChkMatch, etc.), you can temporarily enable
loading unmatching symbols using .symopt+0x40 command.
Then WinDbg should be able to load symbols, hopefully
(use noisy output to verify that it has found the .pdb file in the right place)

Oleg
Post by Lady_A
Oleg,
Things got much better - WinDbg suceeded loading the pdb and matching
it using another new build.
I followed all your suggestions, debugged using VS, checked out in
process explorer which pdb does it use - same one by the way and then
switched to WinDbg, using 2 methods. 1) I atached to a running exe -
symbols got matched and 2) I opened the executable in WinDbg when it
was not running and the symbols got matched again! Oh Joy!
Now, what really confuses me is that I used chkmatch to analyze that
exe and pdb that I have the mini dump file for. It says its a match! I
tried opening the dump in WinDbg for the thousand time and of course
WinDbg refuses to match the symbols...
How do I know the same thing wont happen to the dump created with this
new build I have ?
Thanks!!!
Post by Oleg Starodumov
Post by Lady_A
B.exe is basically A.win renamed.
Each time I build the project I can sucessfully attach to the process
and debug it.
This time I did not try before giving the build for testing - of course
there is the slight chance that I am out of luck and of all the builds
I would not have been able to debug this one using VS.
In such a case - could you please tell me in what way can I check that
the build will be able to open in WinDbg and find the symbols correctly?
I tried the open executable command, after I made a brand new build,
setting all the sym path and source path and I still have the same
errors basically. I know I can debug in VS with that new build.
Yes, you should do "open executable" in WinDbg and then run the same
commands (.reload, etc.) to see if symbols have been loaded.
If VS2003 can load symbols but WinDbg cannot, it could happen that VS2003
finds matching symbols in some other location. Unfortunately, VS2003
does not offer a way to see where it loaded symbols from, but while it is running,
you can use e.g. ProcessExplorer from Sysinternals to check the list of files
loaded by VS2003 process and check where A.pdb was loaded from.
http://www.debuginfo.com/tools/chkmatch.html
What will it report?
Post by Lady_A
Here is the output from running the commands you suggested on my dump
It looks like B.exe was found correctly, but A.pdb really was not matched.
Oleg
Lady_A
2007-01-22 23:31:35 UTC
Permalink
Thanks!!!
The command forced WinDbg to use the symbol file and I can see
debugging info now!
Post by Oleg Starodumov
.symopt+0x40
Symbol options are 0x80030277:
0x00000001 - SYMOPT_CASE_INSENSITIVE
0x00000002 - SYMOPT_UNDNAME
0x00000004 - SYMOPT_DEFERRED_LOADS
0x00000010 - SYMOPT_LOAD_LINES
0x00000020 - SYMOPT_OMAP_FIND_NEAREST
0x00000040 - SYMOPT_LOAD_ANYTHING
0x00000200 - SYMOPT_FAIL_CRITICAL_ERRORS
0x00010000 - SYMOPT_AUTO_PUBLICS
0x00020000 - SYMOPT_NO_IMAGE_SEARCH
0x80000000 - SYMOPT_DEBUG

Should they be different ?

Thanks again!
Post by Oleg Starodumov
What symbol options are active in WinDbg?
Print them with .symopt command.
Anyway, even if WinDbg refuses to load symbols when debugging the dump,
but you are sure that they match (confirmed with live debugging with
WinDbg, VS, ChkMatch, etc.), you can temporarily enable
loading unmatching symbols using .symopt+0x40 command.
Then WinDbg should be able to load symbols, hopefully
(use noisy output to verify that it has found the .pdb file in the right place)
Oleg
Post by Lady_A
Oleg,
Things got much better - WinDbg suceeded loading the pdb and matching
it using another new build.
I followed all your suggestions, debugged using VS, checked out in
process explorer which pdb does it use - same one by the way and then
switched to WinDbg, using 2 methods. 1) I atached to a running exe -
symbols got matched and 2) I opened the executable in WinDbg when it
was not running and the symbols got matched again! Oh Joy!
Now, what really confuses me is that I used chkmatch to analyze that
exe and pdb that I have the mini dump file for. It says its a match! I
tried opening the dump in WinDbg for the thousand time and of course
WinDbg refuses to match the symbols...
How do I know the same thing wont happen to the dump created with this
new build I have ?
Thanks!!!
Post by Oleg Starodumov
Post by Lady_A
B.exe is basically A.win renamed.
Each time I build the project I can sucessfully attach to the process
and debug it.
This time I did not try before giving the build for testing - of course
there is the slight chance that I am out of luck and of all the builds
I would not have been able to debug this one using VS.
In such a case - could you please tell me in what way can I check that
the build will be able to open in WinDbg and find the symbols correctly?
I tried the open executable command, after I made a brand new build,
setting all the sym path and source path and I still have the same
errors basically. I know I can debug in VS with that new build.
Yes, you should do "open executable" in WinDbg and then run the same
commands (.reload, etc.) to see if symbols have been loaded.
If VS2003 can load symbols but WinDbg cannot, it could happen that VS2003
finds matching symbols in some other location. Unfortunately, VS2003
does not offer a way to see where it loaded symbols from, but while it is running,
you can use e.g. ProcessExplorer from Sysinternals to check the list of files
loaded by VS2003 process and check where A.pdb was loaded from.
http://www.debuginfo.com/tools/chkmatch.html
What will it report?
Post by Lady_A
Here is the output from running the commands you suggested on my dump
It looks like B.exe was found correctly, but A.pdb really was not matched.
Oleg
Loading...