Welcome to MSDN Blogs Sign in | Join | Help

Basics of Debugging Windows

Hello, this is East again. This blog post is about a topic that we always skip over when discussing debugging; what and where are the tools for debugging. I will touch on the different types of debuggers, loading symbols and the basics of getting started with loading up a dump under your preferred debugger.

Microsoft currently offers 4 types of debugging tools. With these tools you can remote debug another machine over firewire or serial cable (USB also but may not work consistently), as well as debug usermode processes and dump files.

Command line debuggers:

1 ) kd.exe: kernel debugger – Used to review Crash dumps created by a blue screen crash event or a stop error. (kd –z <location of dump> –y <location of symbols>)

2 ) cdb.exe: User mode debugger for reviewing applications,  processes, and process dumps  (cdb  –z <location of dump> –y <location of symbols> )

3 ) ntsd.exe: CDB and NTSD are virtually identical, except that NTSD spawns a new text window when it is started, whereas CDB inherits the Command Prompt window from which it was invoked.  When I refer to "CDB", it applies to both CDB and NTSD.

Graphical User Interface Debugger:

4) Windbg.exe is a GUI based debugger. It can debug the same things as KD & CDB using the same commands. Windbg gives you the ability to have multiple windows open simultaneously  to review source code or other selectable items under the view menu.

I like using windbg for all of my user and kernel debugging, while  others I work with prefer kd for kernel debugging and cdb for user mode debugging.

 

There are 32bit and 64bit debuggers available.

NOTE: Some people use Visual Studio as well, but this blog post will not cover using Visual Studio as a debugger.

 

You can review applications that already have started on your machine using CDB or Windbg. You can have the problematic application launch under the debugger as well:

Cdb or Windbg

-p <pid> specifies the decimal process ID to attach to ( use tlist or the task manger to obtain the PID)

-psn <name> specifies the process to attach to by service name

<application to launch> -y <symbol path>

NOTE: windbg allows you to use menu options as well: select “Attach to a Process” on the File menu to debug a user-mode application that is currently running.

 

What are dumps?

Memory dumps are a record of what was in memory and the registers at the time of a crash. There are 3 types of memory dumps:

NOTE: The type of dump that will be written upon bugcheck can be configured by right clicking my computer ->properties ->Advanced tab ->Settings, in the Write debugging section you will use the first drop down box to select what type of memory dump you want. (See KB307973)

·         Mini dump – is a subset of memory that is in use by the application creating the dump.

A mini memory Dump file is written to %SystemRoot%\Minidump\Memory.dmp by default and is usually less than a 1mb in size.

·         Kernel only – This is used to review the machine’s kernel memory at the time of the crash.

·         Full/Complete – This is the largest kernel mode dump file. It contains all information from kernel and user mode address spaces that was in physical memory at the time of the dump (about the same size as the physical memory on the box).

Kernel and Complete Memory Dumps are written to %SystemRoot%\Memory.dmp by default.

Note: You can configure the server to crash using certain keystrokes . This would be useful when troubleshooting a hung server or a timing issue, KB244139 explains how to configure your server for a manual crash.

You can also create dump files from an application or process, these are known as User-mode dumps.  Additional information can be found on these types dump in the Debugging Tools for Windows help file.

 

How do I read a dump file?

In order to make fast progress with a memory dump file, it is best to load symbol files. Symbol files contains data that the debugger uses to interpret the application or driver code. They may contain:

-          Global variable names

-          Function names

Private Symbols would contain the above information and:

-          Local variable names

-          Source-line numbers

-          Type information for variables, structures, etc.

 Microsoft currently has two ways you can access symbols for the Operating System:

Service pack download site – You will need to create:

-          Separate directories for Windows 2000 RTM, Windows 2000 SP1, Windows 2000 SP2, Windows XP RTM, etc.

-          Separate directories for all of the above for free vs. checked build

-          Separate directories for hotfix symbols

 

Public symbol server – uses a symbol store, which is a collection of symbol files. The symbol server uses the time stamp & file size to match up symbols to the active binary.After getting your symbol files together, you will need a way to tell the debugger where they are located and set up some other options.

To set the symbol path do one of the following:

-          _NT_SYMBOL_PATH environment variable

-          -y command line option

-          .sympath (Set Symbol Path) debugger command

-          WinDbg: File | Symbol File Path dialog, or CTRL+S

To set the executable Image Path (needed for minidumps only), do one of the foolowing:

-          -i command line option

-          .exepath debugger command

-          WinDbg: File | Image File Path dialog, or CTRL+i

-          Source Path

-          .srcpath WinDbg: File | Source File Path dialog, or CTRL+P

If symbol errors appear when you begin, you can try the below commands to help narrow down some problems;

!sym noisy — gives verbose symbol information

AND

.reload —  to reload all symbols

 

Also using the srv* in your symbol path tells the debugger to load and save symbols being used out to a specific directory:

srv*DownstreamStore*<symbol locations>

 

NOTE: You must always use .reload after you change the symbol path or fix a symbol error — the debugger doesn’t automatically reload your symbols!

 

Now that we are done with the overview, let’s configure our machine as a host computer to open memory a dump.  I will be using Microsoft Public Symbol servers and I want to store current symbols locally to my host machine.

Using windbg I will set my current workspace symbols to: srv*c:\pubsymbols*http://msdl.microsoft.com/download/symbols

Click the menu option File ->Symbol File Path or Ctrl + S. This will bring up an empty box that will allow you to enter or browse to your symbol path.

If using kd you want to set an environment variable (_NT_SYMBOL_PATH) under “my computer properties -> advanced tab” to always start with your symbols set to:  “srv*c:\pubsymbols*http://msdl.microsoft.com/download/symbols” or use this same path in your command line:

Kd –z <path to dump.file> -y srv*c:\pubsymbols*http://msdl.microsoft.com/download/symbols

 

NOTE: Windbg will append any workspace symbol path with the one set by the _NT_SYMBOL_PATH environment variable during loading of a memory dump.

Ok, now we know what debugger we want to use and we know our symbol locations. Let’s open our first kernel memory dump , located on <drive letter> <path to dump file>

Using windbg, I will load a dump file using menu options File ->Open crash Dump (ctrl + D) or drag the the dump file into the debugger; you can even  start windbg at the command prompt.  My command would look like this:

Windbg  –z C:\training\case 7f\MEMORY051308.22.DMP

I did not use the –y for symbol path, as it is set already in my default workspace or in my environment variable.

When the debugger first loads a dump file it displays several lines of information before giving you a prompt to get started with your commands (by default):

Microsoft (R) Windows Debugger Version 6.9.0003.113 X86  ß debugger version

Copyright (c) Microsoft Corporation. All rights reserved. ß Copyright of the debugger creator

Loading Dump File [C:\training\case 7f\MEMORY051308.22.DMP] ß location of the dump file loading

Kernel Summary Dump File: Only kernel address space is available ß type of memory dump (mini, kernel, or full)

Symbol search path is: srv*c:\pubsymbols*http://msdl.microsoft.com/download/symbols ß Symbol path for this debug session

Executable search path is:  ß points to the directory the executable files are located. For most situations this is not needed. For other situations please check the debugger help file.

 

The next 4 lines talk about The OS version, service packs and how many processors are on the box

1 -Windows Server 2003 Kernel Version 3790 (Service Pack 2) MP (8 procs) Free x86 compatible

2 - Product: Server, suite: Enterprise TerminalServer SingleUserTS

3 - Built by: 3790.srv03_sp2_gdr.070304-2240

4 - Kernel base = 0x80800000 PsLoadedModuleList = 0x808a6ea8

 

Next we would see when the machine crashed and how long it was up prior to this crash:

Debug session time: Wed May 14 01:27:36.768 2008 (GMT-4)

System Uptime: 0 days 16:32:51.921

 

After completing the above process, the debugger starts loading the dump file and parsing through the loaded symbols. Here you may notice some warnings for some user space processes which are not included in the kernel dump. This is ok.

WARNING: Process directory table base BFF0A080 doesn't match CR3 007AF000

WARNING: Process directory table base BFF0A080 doesn't match CR3 007AF000

Loading Kernel Symbols

...........................................................................................................................................

Loading User Symbols

PEB is paged out (Peb.Ldr = 7ffdf00c).  Type ".hh dbgerr001" for details

Loading unloaded module list

*******************************************************************************

*                                                                             *

*                        Bugcheck Analysis                                    *

*                                                                             *

*******************************************************************************

 

1- Use !analyze -v to get detailed debugging information.

2 - BugCheck 7F, {8, f773ffe0, 0, 0}

3 - *** ERROR: Module load completed but symbols could not be loaded for ql2300.sy

The three things I want to point out from above are:

1 - !analyze –v: This is the debugger command used to help analyze a dump file by reviewing information passed to KeBugCheck including specific parameters of that crash. It will analyze this information and provide a definition of the bugcheck, a stack showing all current function calls, and, when possible, the name of an offending driver or process that the debugger thinks is at fault.  Please review the debugger help file for additional information in this area.

2 – The type of bugcheck that occurred on the machine.

3 – An error telling you about symbols missing or not available to help diagnose a particular driver or application. This can lead to a misdiagnostis if you’re not careful.

Once loading is completed you should be at a kd> prompt. This prompt shows you the current processor you are using (if the machine has more than one).

For this dump we are at processor 3 on an 8 proc machine:

3: kd>

 

To view the current crash stack location you can use the "K" command. There are multiple forms of this command, each one dumping the basic plus additional information. As functions are executed and call other functions, a call stack is created in stack memory. Here are two common commands to view the stack:

 

3: kd> k

ChildEBP RetAddr

00000000 baebf0ce nt!KiTrap08+0x75

b3a4bffc baebf737 storport!RaCallMiniportInterrupt+0x2

b3a4c008 8088d889 storport!RaidpAdapterInterruptRoutine+0x1d

b3a4c008 80a59d8e nt!KiInterruptDispatch+0x49

b3a4c09c 80a5c2fc hal!HalpGenerateInterrupt+0x1d2

b3a4c0c0 80a5c44d hal!HalpLowerIrqlHardwareInterrupts+0x108

b3a4c0d0 808256ed hal!KfLowerIrql+0x59

<snippet>

 

3: kd> kb

ChildEBP RetAddr  Args to Child

00000000 baebf0ce 00000000 00000000 00000000 nt!KiTrap08+0x75

b3a4bffc baebf737 97bedb88 b3a4c02c 8088d889 storport!RaCallMiniportInterrupt+0x2

b3a4c008 8088d889 977b9e18 97bedad0 03010006 storport!RaidpAdapterInterruptRoutine+0x1d

b3a4c008 80a59d8e 977b9e18 97bedad0 03010006 nt!KiInterruptDispatch+0x49

b3a4c09c 80a5c2fc 97797004 97bedad0 00000102 hal!HalpGenerateInterrupt+0x1d2

b3a4c0c0 80a5c44d 00000101 977b9e02 b3a4c0d8 hal!HalpLowerIrqlHardwareInterrupts+0x108

b3a4c0d0 808256ed b3a4c0e8 baebf1c6 977b9bb0 hal!KfLowerIrql+0x59

<snippet>

 

Either one can be used depending on how much information you want to see and can use.

This completes the Basic of Debugging Windows, Part I. I will create a Part II using specific questions gathered from our readers.

 

Miscellaneous information:

To go further with this topic I would suggest starting with the debugger help file included with the Microsoft Debugging Tools. 

ADPlus – An automated way to use the cdb.exe to capture/create a usermode dump when a process hangs or crashes. (more info - http://msdn.microsoft.com/en-us/library/cc265629.aspx or kb286350)

Public Symbols for Microsoft Operating Systems:

Microsoft Public Symbol server : srv * DownstreamStore * http://msdl.microsoft.com/download/symbols

example: srv*c:\mysyms*http://msdl.microsoft.com/download/symbols

 Microsoft Symbol packages http://www.microsoft.com/whdc/devtools/debugging/symbolpkg.mspx#d

Use !Analyze-v to gather additional information about the bugcheck and a bucket-id for your dump file. The bucket-id can be submitted to Microsoft for review for similar crashes and resolutions. Try using the Microsoft Online Crash Analysis to submit your crash dump bucket-id for possible follow up from Microsoft or for Microsoft to look for trends: http://oca.microsoft.com/en/Welcome.aspx

For concepts, tools and information about the system architecture:

http://msdn.microsoft.com/en-us/default.aspx

Windows Internal 4th edition (by Mark E. Russinovich & David A. Solomon) the whole book or Chapter 14 - Crash Dump Analysis

Advanced Windows Debugging (by Mario Hewardt & Daniel Pravat )

http://technet.microsoft.com/en-us/default.aspx





Posted by ntdebug | 6 Comments
Filed under: ,

Transcript of Windows NT Debugging Blog Live Chat

For those of you that could not make the live chat on 8/13, here is the transcript of the chat session....

 

Chat Topic: PGES-Windows NT Debugging Blog Live Chat
Date: Wednesday, August 13, 2008

Daniel (Moderator):
Hello everyone-- thanks for coming to our chat on Platforms Global Escalation Services. The chat will officially get started at 1pm Eastern time. Only questions related to this topic will be addressed during this chat. Thanks!

Daniel (Moderator):
Hello everyone-- thanks for coming to our chat on Platforms Global Escalation Services. We'll get started in about 10 minutes.  You can start posting your questions now if you'd like and when the chat starts our Experts will begin answering them. Be sure to check the "Ask the Experts" box before you send your questions and please keep all questions on topic-- Thanks!

Daniel (Moderator):

Let's get started with our chat. Before we begin, though, I'd like to have our Experts introduce themselves and then they'll get started answering  your questions.

Smoke [Windows Core] (Expert):
Hi everyone, I'm an Escalation Engineer with the Window’s Core team.  I fix bugs for a living.

Matthew [MSFT EE] (Expert):
Hello, I am an Escalation Engineer with the Platforms Global Escalation Services (Windows Core) team.

East - MSFT EE (Expert):
I am East, an Escalation Engineer with the Microsoft Platforms Global Escalation Services. (Windows Core)



Todd Webb - Msft (Expert):
I am an Escalation Engineer with the Microsoft Platforms Global Escalation Services OEM hardware team...

David (Expert):
Hi, I'm an Escalation Engineer with Windows Core - reading code & debugging is my day-to-day.

stheller (Expert):
Hi, I'm a new Escalation Engineer with Platforms GES.

Mr Ninja [MSFT EE] (Expert):
Hi, I am an Escalation Engineer with Microsoft PGES.  I debug Windows for a living.

Tate [MSFT EE] (Expert):
Hi, I’m one of the EE’s on the Windows team.



Jeff Dailey MSFT EE (Expert):
Hi, my name is Jeff Dailey, I’m a Senior Escalation Engineer on the Microsoft Platforms Global Escalation Services team.



Smoke [Windows Core] (Expert):
Q: How can I track memory allocations through MmAllocateContiguousMemory?
A: You could try poolhittag on MMCM or a breakpoint on MmAllocateContiguousMemory.  If you go with the break point, you can use a conditional breakpoint and dump the stack and anything else, then 'go' the system.  There will be a perf hit each time you break in.

Tate [MSFT EE] (Expert):
Q: For MmAllocatecontiguousMemory, will !poolused show the total amount used?
A: !poolused 2 will show MmCm

Matthew [MSFT EE] (Expert):
Q: What's the best way to go about troubleshooting pool corruption dumps.
A: Special Pool can be used to track down pool corruption problems.  http://msdn.microsoft.com/en-us/library/cc265889.aspx

a-hstein (Expert):
Greetings and sorry for the late message.  I am an intern in the GES group.

Mr Ninja [MSFT EE] (Expert):
Q: Could you explain the reasons why a memory dump analysis show an "illegal instruction" exception raised from a valid instruction?
A: There are many reasons this could happen.  The instruction that was executed may not be what you see due to hardware problems such as a bit flip in the instruction when it was executed.  It is also possible for a hardware problem caused an exception to be raised on a valid instruction.  Sometimes software, or hardware, may trigger a jump to the middle of an instruction so that the instruction being executed is not what you think it is.I described a problem where we executed from the middle of an instruction in the blog http://blogs.msdn.com/ntdebugging/archive/2008/04/28/ntdebugging-puzzler-0x00000004-this-didn-t-puzzle-the-debug-ninja-how-about-you.aspx.

Smoke [Windows Core] (Expert):
Q: We use APC's to perform certain operations one of them is to have thread cleanup and exit.Is calling thread exit from an APC recommended ? This used to work fine, but with newer service packs we have threads exiting holding the heaplock!
A: This sounds like a bad idea.  I would expect different ways that this could break (just like you have observed).

David (Expert):
Q: We use APC's to perform certain operations one of them is to have thread cleanup and exit.Is calling thread exit from an APC recommended ? This used to work fine, but with newer service packs we have threads exiting holding the heaplock!
A: Part of the problem is that if ExitThread is called, any pending APCs on that thread's queue are lost.

Matthew [MSFT EE] (Expert):
Q: This question is in reference to special pool mentioned already. Is this article essentially the same as the MSDN reference?  http://support.microsoft.com/kb/188831/en-us
A: The KB article documents enabling special pool via the registry, rather than verifier.  These are two different ways to accomplish the same thing.  Enabling it via the registry is sometimes preferred, since verifier enables additional checks beyond special pool.

East - MSFT EE (Expert):
Q: We use APC's to perform certain operations one of them is to have thread cleanup and exit.Is calling thread exit from an APC recommended ? This used to work fine, but with newer service packs we have threads exiting holding the heaplock!
A: Would this help KB254956

 - If not we would need to follow-up with you for more information

East - MSFT EE (Expert):
Are there anything additional you want on the blog that we have not done?



Jeff Dailey MSFT EE (Expert):
Q: The final version of the Windows Internals Exam should be available before December 2008.  I’d like to thank all the community members that participated in the Beta.  Your feedback was very valuable.



East - MSFT EE (Expert):
Q: Are there anything additional you want on the blog that we have not done?



Jeff Dailey MSFT EE (Expert):
Q: When is the next Windows Internals exam scheduled? I would like to plan ahead.
A: The final version of the Windows Internals Exam should be available before December 2008.  I’d like to thank all the community members that participated in the Beta.  Your feedback was very valuable.



Matthew [MSFT EE] (Expert):
Q: Will we get more puzzler on the blog?
A: We’d like to do more puzzlers, but unfortunately they tend to take a lot of time, so I cannot say for sure when/if we’ll have more.



Matthew [MSFT EE] (Expert):
Q: How many of you in the audience are interested in more puzzlers on the ntdebugging blog?

Smoke [Windows Core] (Expert):
Q: Are you planning to write a book?
A: Windows Internals is a great reference book that we all rely upon.  Additionally, you can check out: <http://www.amazon.com/Advanced-Debugging-Addison-Wesley-Microsoft-Technology/dp/0321374460>



Tate [MSFT EE] (Expert):
Q: As far as the blog is concerned I'm more a fan of the case studies type posts where you go through how you troubleshooted issues that you have enountered.
A: So are we!!!

Smoke [Windows Core] (Expert):
Q: I'm very interested in puzzlers...
A: Thanks for the feedback.  We will try to create some more in the future.

Smoke [Windows Core] (Expert):
Q: Debugging MPI apps - sometimes a crash happens on remote and the local smpd daemon will terminate the process being debugged. Using the debugger, is there a way to guard from TerminateProcess from the child? I guess that would break some security models.
A: I'm not sure what MPI is, but this scenario sounds just like a service.  The service control manager will kill the service if it doesn't respond in a timely fashion.  With a service, there is a registry key to extend the timeout.  If such a mechanism isn't available for you, you should consider instrumentation/logging.

East - MSFT EE (Expert):
Q: I just skimmed over KB254956, we found APC to work. The issue here is that there are alertable waits in library modules like LSA/NDR/I_RPC calls where our APC fires which raises an user exception, gets handled and exits-thread exits holding the heap lock.
A: We would need to discuss this further offline, how can I contact you?

Matthew [MSFT EE] (Expert):
Q: An award of puzzler like next edition of Windows Internals would definitely have my full attention. :)
A: We'll consider it... thanks for the feedback!

Jeff Dailey MSFT EE (Expert):
Q: Have you ever found yourselves with an "unsolvable" case? :P
A: No cases is unsolvable, nothing is truly random.  Some cases may take a very long time to resolve through multiple debugging passes, detailed code review, reverse engineering and multiple iterations of instrumentation.  In the end we find the problem.  



Daniel (Moderator):

Just a heads-up --we have about 15 minutes left in today's chat. Be sure to post your questions asap and our Experts will try to answer as many as possible before the chat ends. Thanks.

Mr Ninja [MSFT EE] (Expert):
Q: Tri-boot machine - XP, Server 2003 and Server 2000 with 2000 being the last one installed. After awhile, I got an error: "Windows 2000 could not start because the following file is missing or corrupt: \WINDOWS\SYSTEM32\CONFIG\SYSTEMd startup options for"..
A: That is usually a known issue in Windows 2000 caused by the size of the system hive becoming too large.  We have several KB articles that describe this issue  KB269075, KB306038, KB323148, and KB277222 contain various resolutions you can try.  I have found that most often the steps in KB277222, using scrubber in a shutdown script, resolve this problem.  Starting with Windows 2003 we changed the boot architecture to prevent this problem, KB302594 describes this improvement.

Tate [MSFT EE] (Expert):
Q: Do you guys use USB debugging in Vista/2008? Why is that there is still one vendor that sells the debug dongle?
A: Serial debugging works well enough most times.  Usually only if we have hardward that doesn't have a serial connection for some reason and only has USB or Firewire we try these alternates...

East - MSFT EE (Expert):
Q: I just skimmed over KB254956, we found APC to work. The issue here is that there are alertable waits in library modules like LSA/NDR/I_RPC calls where our APC fires which raises an user exception, gets handled and exits-thread exits holding the heap lock.
A: On a better note it would be best to open a case with Microsoft Support - > <http://support.microsoft.com/> -> Need more help? -> Select a Product to start



Jeff Dailey MSFT EE (Expert):
Q: What companies are in attendance today?



Graham (Expert):
Q: There are lots of post mortum debuggers available, Dr Watson, NTSD, windbg, userdump, WER. Which ones do you usually recrommend your customers to use if you need to be sure to capture a dump from a crash?
A: Userdump.exe is quite reliable for obtaining post-mortem dumps, and is easy to use.  It (along with ADPlus, which uses CDB) are good because they attach to the process and monitor exceptions, and can create dumps for times when a JIT debugger would not be able to create a thread in the process to obtain the dump.  Normally, I will set up drwtsn32 first, and if it cannot generate the dump, then I will go to userdump. 

Smoke [Windows Core] (Expert):
Q: How can I debug cases in which just I have the Minidump for CPU Hog? I tried !runaway and does not works
A: The minidump alone may not be enough information.  You could try to look at the stacks and guess at what is using the CPU, but that require familiarity with the application.  You should capture a circular perfmon log with thread data.  Then get 3-5 dumps of the app.  From the perfmon log, you'll see what threads are active (and their activity profile).  From the dumps, you'll have a few snapshot of the process in motion.  Alternatively you could try a profiler like xperf.

David (Expert):
Q: Are there any free code coverage tools on Windows?
A: This article describes how to obtain code coverage data:

David (Expert):
A: http://msdn.microsoft.com/en-us/library/ms182496.aspx

stheller (Expert):
http://www.microsoft.com/whdc/devtools/tools/prefast.mspx discusses the PREfast static source code analysis tool

East - MSFT EE (Expert):
Q: Are there any free code coverage tools on Windows?
A: Please keep watching our blog site for the next chat - <http://blogs.msdn.com/ntdebugging>  or you can submit the question to the our blog site

Daniel (Moderator):
Well we're out of time for today's chat. Thank you very much to all of our guests who joined us today as well as to our Experts for answering so  many great questions. Have a great day!

 

Posted by ntdebug | 3 Comments

New Facebook group: “Escalation Engineers”

Are you the final tier of escalation at a company or group that supports software?
Are you fluent in assembly, C, C++, etc?

Are you the voice of reason in critical situations?

Do you spend more time debugging other people’s code than writing your own?

 

 

If you answered the above questions with “yes”, then this new Facebook group is for you. "Escalation Engineers" http://www.facebook.com/group.php?gid=23477747996

Jeff-

Posted by ntdebug | 1 Comments

How to Access the User Mode Debugger from the Kernel Debugger

In certain cases you may want to use a user mode debugger to debug a process from within the kernel debugger.    It could be that you have an application that loads a kernel mode driver, and you want to be able to debug the user mode aspect of the application and then break into the kernel to follow the calls made to kernel.

Here is how you do it!

·         Attach the kernel debugger via a serial cable (Null modem cable), USB cable or FireWire cable, and have your machine configured to be kernel debugged. The article located at  http://support.microsoft.com/kb/151981  is a good reference for pre-Vista systems.  To enable the debug options on Vista or Windows 2008 you must use bcdedit.exe because those OSes no longer use a boot.ini file. Here’s an example:

 

bcdedit /debug {<guid>} <ON | OFF>
bcdedit /dbgsettings SERIAL DEBUGPORT:1 BAUDRATE:115200

 

·         Add a new debugger key to the “Image File Execution Options” for your process.  In this case we will use notepad.exe as the target process. The new key will look like this:

 

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe

 

·         Add a string value under this key called “debugger” that contains the value “ntsd –d”. Here’s a screen shot of the registry changes for reference.

 

·         The –d option redirects the output of NTSD to the kernel debugger allowing remote control via the kernel debugger.

 

·         With the existence of this new key, the user mode debugger will automatically start and attach to your process when Notepad.exe starts.  Note: It’s important to remove the registry entry when you’re finished debugging.

 

·         You can now issue any standard NTSD Command via the kernel debugger.

 

·         When you are ready to break into the kernel and run under the kernel debugger simply type .breakin

 

 

Jeff- 





Posted by ntdebug | 3 Comments
Filed under: ,

Windows NT Debugging Blog Live Chat

Microsoft Platform Global Escalation Services is hosting our first live group debug chat session for the debugging community on August 13, 2008 at 10 AM PT.  We will be focusing on debugging techniques and any questions you may have about anything we’ve previously blogged about.  Also, we will try to cover some topics that were requested here.

 

Details about the “PGES-Windows NT Debugging Blog Live Chat” can be found here: http://www.microsoft.com/communities/chats/default.mspx

Posted by ntdebug | 1 Comments

How can I find out why the Cluster Resource Monitor dumped – Access Violation

Hello, my name is John Marlin, and I am a Support Escalation Engineer on the Microsoft Platform Cluster Services Support team.  I wanted to talk about the Windows 2003 Cluster Resource Monitor along with what happens when it crashes as well as how to debug it to find out why it crashed.

 

We need to first understand what the Cluster Resource Monitor is and does.  Below is taken from the Microsoft MSDN site describing the Cluster Resource Monitor.

 

A Resource Monitor provides a communication, monitoring, and processing layer between the Cluster service and one or more resources. Resource Monitors have the following characteristics:

·         A Resource Monitor always runs in a process separate from the Cluster service. If a resource fails, the Resource Monitor isolates the Cluster service from the effects. If the Cluster service fails, the Resource Monitor allows its resources to shut down gracefully.