Enabling kernel debug causes BSOD [Windows 10 Pro] INVALID_KERNEL_HANDLE

Julien Matthey 26 Reputation points
2021-03-05T00:13:31.257+00:00

Every time I enable kernel debugging with bcdedit /debug on and restart my machine, I get a BSOD on the user login screen at every boot. Then I have to open the troubleshooting command prompt and load my backup bcdedit store file.

I tried with and without secure boot to no avail. I want to do a kernel debugging session in WinDbg.

What is causing these crashes ? The error is INVALID_KERNEL_HANDLE.

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,614 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jenny Feng 14,076 Reputation points
    2021-03-05T03:26:40.283+00:00

    @Julien Matthey
    Hi,
    The INVALID_KERNEL_HANDLE bug check indicates that some kernel code (for example, a server, redirector, or another driver) tried to close an invalid handle or a protected handle
    For your reference:
    https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/bug-check-0x93--invalid-kernel-handle
    You'd better try this:
    Download Intel(R) Driver Update Utility
    There are some ways of eliminating the problem with " INVALID_KERNEL_HANDLE":
    https://recoveryutility.com/fix-bsod-invalid-kernel-handle-error
    Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.
    Hope above information can help you.

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Gary Nebbett 5,721 Reputation points
    2021-03-05T14:12:45.59+00:00

    Hello @Julien Matthey ,

    As mentioned in the article https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/bug-check-0x93--invalid-kernel-handle (provided by @Jenny Feng ), there are 3 types of this bug check:

    1. A protected handle was closed. This is a handle created with OBJ_PROTECT_CLOSE set in the OBJECT_ATTRIBUTES Attributes member. Closing this type of handle always causes a bug check, so this is probably not your issue.
    2. An invalid handle was closed or referenced. This problem only results in a bug check if the kernel variable KdDebuggerEnabled is not zero (otherwise a failure status is returned). This may well be your problem. One option is to identify where the bad handle is coming from and prevent that happening. Another option is to either patch the code in NtClose or just instruct the kernel debugger to jump over the KeBugCheckEx call.
    3. The error occurred referencing an invalid kernel handle and bad handle detection was enabled. This bug check only occurs if FLG_ENABLE_HANDLE_EXCEPTIONS is set in NtGlobalFlags. If this flag is set then a bug check occurs regardless of whether a kernel debugger is present, so this is probably also not your issue. Gary
    2 people found this answer helpful.
    0 comments No comments

  2. Julien Matthey 26 Reputation points
    2021-03-05T18:43:31.683+00:00

    @Gary Nebbett @Jenny Feng

    I am updating every driver I can and also do the Windows 20H2 udpate and see if it works.

    I found out (in the device manager) my bluetooth driver was bad and the bluetooth device could not start - I never use bluetooth.

    Could it be the cause ?

    Thanks.

    EDIT. It worked! Not sure what the culprit was but I updated every driver I could + Windows. Possibly the bad bluetooth driver (just my guess).
    Thank you.

    0 comments No comments