Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTFSD

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


How to debug random BSOD

Megapat2000Megapat2000 Member Posts: 6

Hi everybody,

I've started showing a lot more interest recently in windows kernel development. So far what I did was mostly "tinkering" in the kernel, meaning playing around a bit with the various APIs that are available: creating a device, setup some IOCTL communication with my usermode process, then do simple things such as parsing the list of executable processes and sending back the information to usermode. So far everything worked perfectly

I am now working on another project: a minifilter driver. I am facing a lot of random BSOD, random in the sense that:

  1. BSOD never occurs in my driver, it can actually happen after I successfully exited the driver
  2. BSOD location varies from one run to another: sometimes it's in FltMgr.sys, sometimes in nvidia driver, sometimes svchost.exe, looks a bit random
  3. BSOD code varies from one run to another (sometimes BAD_POOL_HEADER, sometimes SYSTEM_THREAD_EXCEPTION, sometimes something else)

I am looking for advice on how to debug properly those "randoms" BSOD. I can also post some crash dump here if you are interested.

Thank you very much for your help and I wish you a very pleasant day.

Comments

  • Phil_BarilaPhil_Barila Member - All Emails Posts: 176

    It's very likely you are stomping on someone else's memory, either through a buffer over/underrun, or via a stray pointer. There are other causes, but that would be the first thing to look for. Run it with Driver Verifier on with all checks except Low Memory Simulation.
    Good hunting!

  • Megapat2000Megapat2000 Member Posts: 6

    I found one ugly bug, thank you very much, I actually allocated a buffer with sizeof(PSTRUCT) instead of sizeof(STRUCT).
    Fixing this fixed my BSOD issue.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 9-13 Sept 2024 Live, Online
Developing Minifilters 15-19 July 2024 Live, Online
Internals & Software Drivers 11-15 Mar 2024 Live, Online
Writing WDF Drivers 20-24 May 2024 Live, Online