none
VS 2017 Community Debugger crashing

    Question

  • I am running experiments with Windows 10 x64 notepad. The choice of program is entirely arbitrary. I am starting notepad via VS->Tools->Launch Under Debugger. With experiments, it's quite natural for things to crash. Unfortunately, when notepad crashes it also causes the debugger to crash/close. Additionally, I get nothing from the event viewer. This makes it rather difficult to work out what's going on.

    Anyone knows how to stop the debugger crashing, or can recommend a more reliable alternative? Thanks.

    Friday, August 3, 2018 3:08 PM

Answers

  • So you are using "Debugging Tools for Windows' debugger in VS?
    Would try "windbg.exe" (the standalone version), which you may find under
    (please note x64 / x86 )
    C:\Program Files (x86)\Windows Kits\10\Debuggers\x64
    C:\Program Files (x86)\Windows Kits\10\Debuggers\x86
    or (probably) in the start menu -> Windows Kits.
    By the way 'WinDbg Preview'
    https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugging-using-windbg-preview
    has a new feature
    Time Travel Debugging
    https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/time-travel-debugging-overview
    Not quite sure, what you are doing but maybe it's possible to get a valid *.run file.

    With kind regards


    • Marked as answer by Dev10110110 Friday, August 3, 2018 9:01 PM
    Friday, August 3, 2018 5:24 PM

All replies

  • So you are using "Debugging Tools for Windows' debugger in VS?
    Would try "windbg.exe" (the standalone version), which you may find under
    (please note x64 / x86 )
    C:\Program Files (x86)\Windows Kits\10\Debuggers\x64
    C:\Program Files (x86)\Windows Kits\10\Debuggers\x86
    or (probably) in the start menu -> Windows Kits.
    By the way 'WinDbg Preview'
    https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugging-using-windbg-preview
    has a new feature
    Time Travel Debugging
    https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/time-travel-debugging-overview
    Not quite sure, what you are doing but maybe it's possible to get a valid *.run file.

    With kind regards


    • Marked as answer by Dev10110110 Friday, August 3, 2018 9:01 PM
    Friday, August 3, 2018 5:24 PM
  • Many thanks MaybeCompletelyW. What you suggested worked much better. The stand-alone debugger doesn't crash now.

    The notepad process ended with the following:

    ModLoad: 00007ffb`30ae0000 00007ffb`30afd000   C:\MyDll.dll
    ntdll!NtTerminateProcess+0x14:
    00007ffb`4c0da434 c3              ret
    
    
    Can you please explain what that means? This looks like a forceful termination.
    Friday, August 3, 2018 9:01 PM
  • Normally, this does not indicate something special/peculiar - you'll get this message, when debugger gets EXIT_PROCESS_DEBUG_EVENT
    https://docs.microsoft.com/en-us/windows/desktop/debug/debugging-events
    and 'Debug->Event Filters' Exit process is enabled. So, e.g. when a console app ends or you are quitting a windows app.
    Last thing debugger shows it's loading a dll.
    You can break on dll-load with
    sxe ld:MyDll.dll
    and try to get some breakpoints set.
    Or maybe play around with aforementioned 'Event Filters'
    enable/output for example Create/Exit Thread.
    See also
    https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/controlling-exceptions-and-events

    With kind regards


    Friday, August 3, 2018 10:50 PM
  • Normally, this does not indicate something special/peculiar - you'll get this message, when debugger gets EXIT_PROCESS_DEBUG_EVENT

    You are absolutely right! I get exactly the same thing just shutting down notepad normally. For some reason notepad treats any kernel APC received as a signal to exit. Other programs carry on normally as I expect them to. I am testing sending APC's to programs from a kernel driver and it worked out all fine.

    Thanks again for your help and expertise.

    Saturday, August 4, 2018 11:45 AM