[0.3.x] windbg hang when continue from breakpoint

Dec 21, 2016 at 1:48 PM
I set a breakpoint in python script, like this
...
pykd.dbgCommand("bp xul!js::math_atan2")
...
and the debugger stop at that point, but when i continue process with g (or F5), the debugger show this message:
0:000> g
ModLoad: 70760000 70773000   C:\WINDOWS\SYSTEM32\dhcpcsvc6.DLL
c0000005 Exception in debugger client IDebugEventCallbacks::LoadModule callback.
      PC: 6e027483  VA: 00000000  R/W: 0  Parameter: 0001007f
and hang. How can i fix this?

i run windbg 10.0.10586.567 32bit on windows 10
Dec 22, 2016 at 9:37 AM
1) Pls, note pykd version
2) Pls, make 'bl' windbg command after bp.
3) Try to run your script with -g option:
!py -g my_script.py
Is the bug still reproducing?
Dec 22, 2016 at 1:29 PM
1) pykd version
0:000> !pip show pykd
Name: pykd
Version: 0.3.1.7
...
2) i add one more command to execute bl like this:
...
    pykd.dbgCommand("bp xul!js::math_atan2")
    print pykd.dbgCommand("bl")
...
and result
 0 e 1192d246     0001 (0001)  0:**** xul!js::math_atan2

[+] Number of Breakpoint: 1
3) the command i use
!py --global bp.py
And it still prints that error!
0:000> g
ModLoad: 70760000 70773000   C:\WINDOWS\SYSTEM32\dhcpcsvc6.DLL
c0000005 Exception in debugger client IDebugEventCallbacks::LoadModule callback.
      PC: 6dcc7483  VA: 00000000  R/W: 0  Parameter: 0001007f
ModLoad: 70740000 70754000   C:\WINDOWS\SYSTEM32\dhcpcsvc.DLL
Dec 23, 2016 at 8:59 PM
I failed to reproduce the bug.
Can you help me and make a dump from windbg? It this be very useful. To make a dump more informative, please get a checked pykd from this link:

https://1drv.ms/u/s!AgDjWN_xJqRygRsOu-yRAWSrrZ00
Dec 24, 2016 at 7:58 AM
Edited Dec 24, 2016 at 7:58 AM
ussrhero wrote:
I failed to reproduce the bug.
Can you help me and make a dump from windbg? It this be very useful. To make a dump more informative, please get a checked pykd from this link:

https://1drv.ms/u/s!AgDjWN_xJqRygRsOu-yRAWSrrZ00
how can i do this?
Dec 24, 2016 at 9:01 AM
To replace pykd to checked version:
  1. Find pykd.pyd file
    (On my machine: C:\Python27.x86\Lib\site-packages\pykd\pykd.pyd )
  2. Make a copy of original ( to restore it after )
  3. Replace pykd.pyd with file from the archive
To make a dump:
  1. Start the second windbg and attach it to the first windbg
  2. Reproduce the bug
  3. On exception the second windbg should get control
  4. Run command: ".dump /f filename"
Dec 25, 2016 at 7:26 AM
Edited Dec 25, 2016 at 7:26 AM
Dec 25, 2016 at 10:59 AM
Edited Dec 25, 2016 at 11:01 AM
Thank you very much for this dump. Now I can reproduce this bug. In fact there are some bugs.

1 Objects don't clean properly after the script finish. If script uses callbacks ( breakpoint or eventHandler ) they continue to work. If script run as local ( by default ), after its finish the interpreter is deleted and and any attempt to call a callback will lead to a crash.

This script will crash windbg on the next module load:
import pykd

class handler(pykd.eventHandler):

    def onLoadModule(self, modBase, name):
        """Load module handler"""
        print name

        
eh = handler()
This script will work normal:
import pykd

class handler(pykd.eventHandler):

    def onLoadModule(self, modBase, name):
        """Load module handler"""
        print name

        
eh = handler()
del eh
2 The pykd bootstrapper 2.0 crashes on any call of callbacks after script finish.

If you need to use eventHandler, use pykd bootstarpper 1.0 and run script with 'global' options. I try to fix bootstrapper 2.0 ASAP.

Thank you very much for your report again!!!
Dec 27, 2016 at 11:39 PM
Please, update pykd bootstrapper to 2.0.0.6 https://pykd.codeplex.com/releases/view/624814

I hope it will fix your problem

Sorry for inconvenience