I just tried again and my *trivial* repro didn’t cause problems.
Can you enable handle tracing for WinDbg, and when you attach WinDbg to
WinDbg_A, create a full dump (.dump /ma).
Send mail to xxxxx@microsoft.com and we’ll look into how to get the
dump file to us. This would be much appreciated.
Thanks,
Jason
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jean F.
Sent: Friday, September 09, 2005 1:50 PM
To: Kernel Debugging Interest List
Subject: Re:[windbg] Windbg locking driver .pdb file
Looks like the .reload /u module not always works,
-
The driver is unloaded
lm
(…)
Unloaded modules:
f7378000 f737f000 driver.sys
be4fb000 be509000 swmidi.sys
be197000 be1bc000 kmixer.sys
(…)
- ProcessExplorer tells me that WinDbg owns an handle pointing to the
pdb.
Attached a WinDbg to this WinDbg_A , !handle 0x2ec gives:
Handle 2ec
Type File
Attributes 0
GrantedAccess 0x120089:
ReadControl,Synch
Read/List,ReadEA,ReadAttr
HandleCount 2
PointerCount 3
No Object Specific Information available
(However ProcessExplorer says its 1 handle and 1 reference, who knows?)
.reload /u driver doesnt work because the driver isnt on lm list:
kd> .reload /u driver
Unable to find module ‘driver’
(same with driver.sys)
I done a .reload /s after that, only ntoskrnl.pdb and my driver.pdb were
still being used by WinDbg,
at first sight looks that WinDbg or DBGHELP is forgetting to close the
driver pdb handle.
“Jason Shay” wrote in message
news:xxxxx@windbg…
>> Satya Das,
>> good hint, looks like WinDbg closes the pdb handle with that command,
as >> expected.
Ahh – I didn’t realize that your target system hadn’t actually unloaded
the driver yet.
Well to anyone else listening, if you get into a situation with WinDbg
6.5 where:
- Your driver is unloaded
- Your driver is not listed in the module list under ‘lm’, unless under
the unloaded module section
- Your PDB file remains locked
Then we’re interested in debugging this situation, and appreciate any
help you can provide. We’re also interested in cases where ‘.reload /u’
does not work.
Jason
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jean F.
Sent: Friday, September 09, 2005 5:42 AM
To: Kernel Debugging Interest List
Subject: Re:[windbg] Windbg locking driver .pdb file
Jason,
I’ve tried to attach WinDbg_B to WinDbg_A (which is debugging the driver
and locking the .pdb),
however WinDbg_B gave an error (maybe I was attaching to the wrong
WinDbg).
Then I tried ProcessExplorer (from SysInternals) to have a look at used
windbg handles,
and there is one handle pointing to the driver pdb, access value is
0x00120089.
The security flags (handle properties dialog) look good since it allows
Delete, Synchronize,
QueryState, ModifyState and SpecialPermissions to everyone user.
I closed WinDbg_A and reopenned it trough WinDbg_B (“Open
executable…”) all ok, enabled handle
tracing, done some debugging on the driver, !htrace -diff and with the
help of ProcessExplorer
found which was the handle pointing to the driver pdb:
(…)
Handle = 0x00000764 - OPEN
Thread ID = 0x00000FE8, Process ID = 0x00000CC4
0x030CCFEF: dbghelp!MiniDumpReadDumpStream+0x0007713F
0x030CE393: dbghelp!MiniDumpReadDumpStream+0x000784E3
0x030CE484: dbghelp!MiniDumpReadDumpStream+0x000785D4
0x030BE0C6: dbghelp!MiniDumpReadDumpStream+0x00068216
0x030BE5B9: dbghelp!MiniDumpReadDumpStream+0x00068709
0x03083610: dbghelp!MiniDumpReadDumpStream+0x0002D760
0x03017A84: dbghelp+0x00017A84
0x03018531: dbghelp+0x00018531
---------
(…)
0:002> !handle 0x764 ff
Handle 764
Type File
Attributes 0
GrantedAccess 0x120089:
ReadControl,Synch
Read/List,ReadEA,ReadAttr
HandleCount 2
PointerCount 4
No Object Specific Information available
(Note: I wasnt able to get an handle object, or that handle “name” from
WinDbg, just from ProcessExplorer).
So I assume its due to how the .pdb file is openned, restricts how it
can be accessed.
Shall windbg allow to delete\write on the .pdb file while debugging the
driver or… we must unload
the symbols from the driver before compile?
—
Satya Das,
good hint, looks like WinDbg closes the pdb handle with that command, as
expected.
Thanks both for replies,
Jean F.
------------------------------------------------------------------------
-------------------
“Jason Shay” wrote in message
news:xxxxx@windbg…
Do you have a set of steps that we can try to consistently repro the
behavior. We’ve been getting complaints of this, but have never seen it
under a debugger.
Alternatively, if you turn on handle tracing, attach a debugger to the
debugger when its in the state, and take a full dump (.dump /ma) for us
to check out, we may be able to get something from it. Feel free to
contact xxxxx@microsoft.com if this is the route you want to take.
Jason
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jean F.
Sent: Thursday, September 08, 2005 5:44 PM
To: Kernel Debugging Interest List
Subject: [windbg] Windbg locking driver .pdb file
Hi,
everytime I need to recompile I’ve to close WinDBG because it locks the
driver .pdb file,
Is there anything I could do to avoid this?
I found 1 or 2 posts related to this problem on the lists but no
detailed explanation,
Posted by Roddy, Mark:
“I setup my development builds and my debugger so that the target
directory is NOT where I point windbg at to find the symbols for test
drivers/exes. That way the worst case is that windbg is looking at the
wrong symbols and not that I can’t build because the pdb file is locked.
I just have to remember to refresh the test directory as well as the
target system. That is error prone of course, but I’ve taken care of
that for all but boot drivers by using a map file.”
From what I know the driver shall have the .pdb location (somewhere in
Debugging DataDirectory?)
so Mark meant he changes this location? or simply the location of the
.pdb?
Thanks in advance!
Jean F.
—
You are currently subscribed to windbg as: xxxxx@winse.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
—
You are currently subscribed to windbg as: xxxxx@winse.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
—
You are currently subscribed to windbg as: xxxxx@winse.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com