<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>hmm</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/hmm/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/hmm/feed.xml</link>
    <description>Faik Hakan Bilgen</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:22:02 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>WaitChain</title>
      <link>https://docs.microsoft.com/archive/blogs/hmm/waitchain</link>
      <pubDate>Sun, 18 Feb 2018 14:12:30 GMT</pubDate>
      <dc:creator><![CDATA[faik hakan bilgen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hmm/?p=175</guid>
      <description><![CDATA[Hello,

There is a powerful though less known feature called "Analyze wait chain" added to Windows...]]></description>
      <content:encoded><![CDATA[Hello,

There is a powerful though less known feature called "<strong>Analyze wait chain</strong>" added to Windows Vista. This feature was accessible through Resource Monitor until Windows 8.

[caption id="attachment_185" align="alignnone" width="659"]<a href="https://msdnshared.blob.core.windows.net/media/2018/02/127.png"><img width="659" height="417" class="wp-image-185 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/127.png" /></a> Analyze wait chain accessed from Resource Monitor[/caption]

And it is accessible via Task Manager since Windows 8.<a href="https://msdnshared.blob.core.windows.net/media/2018/02/127.png"></a>

[caption id="attachment_376" align="alignnone" width="718"]<a href="https://msdnshared.blob.core.windows.net/media/2018/02/222.png"><img width="718" height="594" class="wp-image-376 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/222.png" /></a> "Analyze wait chain" accessed through Task Manager[/caption]

As a Premier Field Engineer, I’m in frequent contact with developers and administrators from different industries and countries. Whenever, I mention Wait Chain Analyzer I’m surprized to see that many people are not aware of it. I get surprized because it is a powerful feature to see whether a process is waiting on something that is noticable w/o attaching the debugger. The feature has its <a href="https://msdn.microsoft.com/en-us/library/ms681622(VS.85).aspx">limitations</a> but still very useful.

Recently, I was approached by a customer to solve the hang/freeze problems of their LOB application. The catch was that there are around 20K end users scattered around 1000 offices. Each end user has usually a non-zero length queue of customers waiting to be served. Hence, it is difficult for the IT support professionals to check the Wait Chain of the relevant process(es) get dump files, etc. To worsen the situation there are many reasons for the hangs. I’ve realized that I didn' know any tool that would generate Wait Chain list for process(es). We have only the UI that can be launched either from Resource Monitor or Task Manager. And, that UI shows one process’s Wait Chain at once. To speed up data collection I’ve developed a simple console based tool called “<strong>WaitChain</strong>”. It can either collect:
<ul>
 	<li>Every process’s Wait Chain when no particular process is specified</li>
 	<li>A particular process’s Wait Chain list if the Process ID is specified</li>
 	<li>The Wait Chain list of each process instance of an application if the process name is specified</li>
</ul>
The <strong>WaitChain.exe</strong> tool is based on the <a href="https://msdn.microsoft.com/en-us/library/cc308564.aspx">WCT API example</a> in MSDN. It can also generate the dump file of the particular process(es) and each process that shows up in the Wait Chain list. This feature requires <a href="https://download.sysinternals.com/files/Procdump.zip">procdump</a> to produce the dump files. If WaitChain is asked to generate the Wait Chain for a particular process it reports all the running processes and their IDs. This comes handy when dump files are generated and a callstack waits on a process that was not captured by WCT API and we want to know the name of the process that thread is waiting on.
<h3>How to use WaitChain.exe?</h3>
<h4>Getting help</h4>
“<strong>WaitChain.exe /?</strong>” documents the functionality of <strong>WaitChain.exe</strong>.

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/310.png"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/310.png"><img width="778" height="379" class="alignnone wp-image-205 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/310.png" /></a>

&nbsp;
<h4>Getting the Wait Chain for all processes running on the system</h4>
Simply execute <strong>WaitChain.exe</strong> without any parameters.

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/410.png"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/410.png"><img width="780" height="250" class="alignnone wp-image-215 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/410.png" /></a>

While executing <strong>WaitChain.exe</strong> puts a dot for every process that it is going to analyze. When finished the result can be read in the report file. <strong>WAITCHAIN_<em>ComputerName</em>.LOG</strong> is the report file’s name format and the file is created in the same folder as <strong>WaitChain.exe</strong> is running.

The report has 3 sections:
<ul>
 	<li><strong>Start Information</strong>
The command line information and Process ID (in both hex and dec format) of <strong>WaitChain.exe</strong> is recorded. Also, the start time of the <strong>WaitChain.exe</strong> is logged. e.g.</li>
</ul>
<p style="padding-left: 60px">PROGRESS INFORMATION
========================================
Command line : "WaitChain.exe"
PID          : (0x2F90:0n12176)
Started on   : 02/15/2018  14:55:14</p>
&nbsp;
<ul>
 	<li><strong>Wait Chain List of each process</strong>
WaitChain tries to connect to each process and get the Wait List of every thread. <strong>WaitChain.exe</strong> asks for Elevated Usage. This is to open processes running under different security context than <strong>WaitChain.exe</strong>. Some processes do not allow to be opened.
They will be listed but no information will be available for them. e.g.</li>
</ul>
<p style="padding-left: 60px">Process (0x4:0n4) - N/A
----------------------------------</p>
<p style="padding-left: 60px">Process (0x48:0n72) - N/A
----------------------------------</p>
<p style="padding-left: 60px">Process (0x24c:0n588) - smss.exe
----------------------------------</p>
<p style="padding-left: 60px">Process (0x320:0n800) - csrss.exe
----------------------------------</p>
<p style="padding-left: 60px">Process (0x388:0n904) - wininit.exe
----------------------------------</p>
<p style="padding-left: 60px">Process (0x3d0:0n976) - services.exe
----------------------------------</p>
<p style="padding-left: 60px">Process (0x72d4:0n29396) - SyncWaitTest.exe
----------------------------------
30424: [72d4:76d8:Blocked]-&gt;[End]
17008: [72d4:4270:Blocked]-&gt;[End]
25476: [72d4:6384:Blocked]-&gt;[CriticalSection:Owned]-&gt;[72d4:7688:Blocked]-&gt;[CriticalSection:Owned]-&gt;[72d4:6384:Blocked]-&gt;[End] !!!Deadlock!!!
30344: [72d4:7688:Blocked]-&gt;[CriticalSection:Owned]-&gt;[72d4:6384:Blocked]-&gt;[CriticalSection:Owned]-&gt;[72d4:7688:Blocked]-&gt;[End] !!!Deadlock!!!</p>

<ul>
 	<li><strong>End Information</strong>
Contains the completion time of the <strong>WaitChain.exe</strong> process. E.g.</li>
</ul>
<p style="padding-left: 60px">PROGRESS INFORMATION
========================================
Finished on  : 02/15/2018  14:55:50</p>
It should take less than a minute to walk each and every process.

&nbsp;
<h4>Getting the Wait Chain for a specific process</h4>
There are two ways to do this. Either:
i. Specify the Process ID
ii. Or, provide the process name (including the .exe extension)
<h4>Specifying a Process ID</h4>
The ProcessID should be passed as an argument to <strong>WaitChain.exe</strong>. e.g. WaitChain should generate a report for the process with ID 29396.

<em><strong>Note: The ProcessID argument should be in decimal format.</strong></em>

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/510.png"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/510.png"><img width="816" height="183" class="alignnone wp-image-225 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/510.png" /></a>

The report is slightly different than when <strong>WaitChain.exe</strong> is executed without arguments:
<ol>
 	<li>The start and end progress information is just the same.</li>
 	<li>Only the Wait List of the process whose ProcessID is given is reported.</li>
 	<li>The ProcessID (in both hex and dec format) and name of all running processes is listed. This list is useful for two cases:</li>
</ol>
&nbsp;
<ul>
 	<li>When the WaitList contains another process than the inspected one. The ProcessID can be looked up from that list and the process name can be retrieved. E.g.</li>
</ul>
<p style="padding-left: 60px">Process (0x7a24:0n31268) - SyncWaitTest.exe
----------------------------------
9728: [7a24:2600:Blocked]-&gt;[End]
21180: [7a24:52bc:Running]-&gt;[End]
19380: [7a24:4bb4:Running]-&gt;[End]
17168: [7a24:4310:Running]-&gt;[End]
22840: [7a24:5938:Blocked]-&gt;[ProcWait:Owned]-&gt;[4e4c:0:PidOnly]-&gt;[End]</p>
<p style="padding-left: 60px">Relevant Processes: 0x4e4c-&gt;[END]</p>
<p style="padding-left: 60px">Thread 22840 of the SyncWaitTest.exe process is waiting on the process with ProcessID 0x4e4c. Now it is time to lookup the process with ProcessID 4e4c.</p>
<p style="padding-left: 60px">RUNNING PROCESSES
=================</p>
<p style="padding-left: 60px">PID(hex:dec)    NAME
…
0x4e4c:0n20044 notepad.exe ===&gt; That is the process that the SyncWaitTest.exe process is waiting on.</p>

<ul>
 	<li>When a dump file is generated and and a callstack is showing that the thread is waiting on another process and the <strong>WaitChain.exe</strong> does not report a target ProcessID:ThreadID. WCT APIs do not report each and every wait. Therefore, generating a dump file of the inspected process might be useful. And, having a ProcessID:ProcessName list can help to find the target process on which the inspected process is waiting for.</li>
</ul>
&nbsp;
<h4>Getting the Wait Chain for a specific Process Name</h4>
In this case the process name should be provided as an argument. <strong>WaitChain.exe</strong> will analyze each instance of that application’s process. E.g. it is common to see multiple instances of w3wp.exe, svchost.exe.

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/610.png"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/610.png"><img width="759" height="178" class="alignnone wp-image-235 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/610.png" /></a>

&nbsp;

This time the report will list each instance of SyncWaitTest.exe’s Wait Chain. E.g.

Process (0x7a24:0n31268) - SyncWaitTest.exe
----------------------------------
9728: [7a24:2600:Blocked]-&gt;[End]
22840: [7a24:5938:Blocked]-&gt;[ProcWait:Owned]-&gt;[4e4c:0:PidOnly]-&gt;[End]

Relevant Processes: 0x4e4c-&gt;[END]

Process (0x6e44:0n28228) - SyncWaitTest.exe
----------------------------------
27980: [6e44:6d4c:Blocked]-&gt;[End]
28912: [6e44:70f0:Blocked]-&gt;[End]
31704: [6e44:7bd8:Blocked]-&gt;[CriticalSection:Owned]-&gt;[6e44:3388:Blocked]-&gt;[CriticalSection:Owned]-&gt;[6e44:7bd8:Blocked]-&gt;[End] !!!Deadlock!!!
13192: [6e44:3388:Blocked]-&gt;[CriticalSection:Owned]-&gt;[6e44:7bd8:Blocked]-&gt;[CriticalSection:Owned]-&gt;[6e44:3388:Blocked]-&gt;[End] !!!Deadlock!!!

The report file (WAITCHAIN log) will also contain the start end information of <strong>WaitChain.exe</strong> and the list of running processes.

&nbsp;
<h4>Generating memory dump files</h4>
WCT API is nice to detect the reason of some wait types. However, it has its limitations and usually it is required to understand why a process has ended up in that situation. In other words, a call stack information might be necessary. To walk this extra step a memory dump file is needed. WaitChain spawns an instance of ProcDump.exe to generate the memory dump file. “/d” argument will instruct <strong>WaitChain.exe</strong> to generate dump files. “/d” can be used together with ProcessID or ProcessName arguments.
<h4>Generating dumps with ProcessID</h4>
In this case <strong>WaitChain.exe</strong> will generate the dump file of the process with ProcessID. And, it will generate the dump file of the processes which show up in any Wait Chain of the process’s threads. E.g. in the following output the process with ProcID 4e4c is in the Wait Chain of the process 31268 (SyncWaitTest.exe).

Process (0x7a24:0n31268) - SyncWaitTest.exe
----------------------------------
9728: [7a24:2600:Blocked]-&gt;[End]
22840: [7a24:5938:Blocked]-&gt;[ProcWait:Owned]-&gt;[4e4c:0:PidOnly]-&gt;[End]

Hence, WaitChain.exe will generate a dump file for both processes with ProcessID 31268 and 4e4c.

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/710.png"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/710.png"><img width="729" height="417" class="alignnone wp-image-245 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/710.png" /></a>

&nbsp;
<h4>Generating dumps with Process Name</h4>
In this case <strong>WaitChain.exe</strong> is supplied with a Process Name. It will note each process that shows up in the Wait Chain of any instance of the ProcessName. At the end it will generate the dump files of each instance of ProcessName and every process that was found to be involved in the Wait Chain lists.

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/84.png"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/84.png"><img width="737" height="539" class="alignnone wp-image-255 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/84.png" /></a>

&nbsp;
<h3>How to interpret the Wait Chain Output in the WAITCHAIN log file?</h3>
<strong>WaitChain.exe</strong> gets each thread’s Wait Chain. It will list the output no matter there is a WaitChain or not.

9728: [7a24:2600:Blocked]-&gt;[End]

This line is read as “The thread with ThreadID 9728’s Wait Chain starts with the process with ProcessID 7a24 (31268 in decimal format) and ThreadID 2600 (9728 in decimal format). And, that node is the end node at the same time. Hence, there is no nodes in the Wait Chain. The thread is waiting.”

22840: [7a24:5938:Blocked]-&gt;[ProcWait:Owned]-&gt;[4e4c:0:PidOnly]-&gt;[End]

This line is read as “The thread with ThreadID 22840’s Wait Chain starts with the process with ProcessID 7a24 (31268 in decimal format) and ThreadID 5938 (22840 in decimal format). This node is waiting on a Process. That process has a ProcessID 4e4c. And, the process with ProcessID 4e4c has no further nodes in the Wait Chain”. Once the process 4e4c terminates the thread will continue execution.

As explained above the WCT API has its limitations in detecting the wait types. The details are documented in <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms681622(v=vs.85).aspx">Wait Chain Traversal</a> document. I’ve created cases to understand the possible output that I might expect from WCT API. Below, I’ll give an example for each case and add the screen shot of the UI of the “Analyze wait chain” feature, too.

&nbsp;
<h4><strong>ALPC</strong></h4>
ALPC stands for Asynchronous Local Inter-Process Communication. It is a message based communication implemented in the Windows Kernel. It can be used between user mode processes, between user mode and kernel drivers and between kernel drivers. An example is the LRPC protocol in RPC. It is based on ALPC. To see the outcome I’ve created a RPC server and client application. The client application is making a call to a method on the RPC interface at the server and that call takes long time to finish its execution. When WaitChain.exe is executed the following output is in the WAITHCAIN log file for the process that is waiting the RCP call’s result:

6840: [2600:1ab8:Blocked]-&gt;[Alpc:\RPC Control\LRPC-b06e4faaf1376606cd]-&gt;[6d00:0:PidOnly]-&gt;[End]

The line can be read as “Thread 1ab8 (6840 in decimal) of process 2600 (9728 in decimal) is waiting on ALPC request that is an LRPC end point hosted by process 6d00 (27904 in decimal)”. We can expect that once the RPC server process (PID:27904) has completed execution for the LRPC request the waiting process’s (PID:9728) thread (TID:6840) can continue execution.

The "Analyze wait chain" for the client process reports as follows:

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/92.png"><img width="640" height="529" class="alignnone wp-image-265 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/92.png" /></a>

&nbsp;

Just FYI, the RPC EndPoint port listening on the LRPC protocol can be find via <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/winobj">winobj.exe</a> as well. In fact, WinObj can list each ALPC Port.

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/103.png"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/103.png"><img width="779" height="418" class="alignnone wp-image-275 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/103.png" /></a>

&nbsp;

If <strong>WaitChain.exe</strong> is executed with the “/d” argument then the reason for wait could be understood better with checking the RPC server callstacks. E.g. below is the callstack of the RPC Server process (PID:27904) that is not responding:

0:002&gt; kbn
# ChildEBP RetAddr  Args to Child
00 04e7f4d0 7735290b 00000000 04e7f514 e1eb5440 ntdll!NtDelayExecution+0xc
01 04e7f538 7735285f <span style="color: #ff0000">0001d4c0 </span>00000000 04e7f554 KERNELBASE!SleepEx+0x9b
02 04e7f548 0005225a 0001d4c0 04e7f56c 759f2620 KERNELBASE!Sleep+0xf
03 04e7f554 759f2620 0001d4c0 00000246 00000001 CssRpcSrv!s_ExecuteLong+0x1a [c:\code\css\cssrpcsrv\cssrpcsrvimpl.cpp @ 36]
04 04e7f56c 759b5e98 00052240 04e7f7a0 00000001 rpcrt4!Invoke+0x34
05 04e7f9bc 759b4969 00000000 00000000 0300a178 rpcrt4!NdrStubCall2+0x448
06 04e7f9d8 759dcd40 0300a178 9df72f94 0300a178 rpcrt4!NdrServerCall2+0x19
07 04e7fa1c 759dc78f 00058294 0300a178 04e7faf8 rpcrt4!DispatchToStubInCNoAvrf+0x20
08 04e7fa88 75a10733 0300a178 00000000 00000000 rpcrt4!RPC_INTERFACE::DispatchToStubWorker+0x18f
09 04e7fab4 75a03819 0300a178 00000000 00000000 rpcrt4!RPC_INTERFACE::DispatchToStub+0xeb
0a 04e7fb1c 759dbd13 04e7fb54 0300a0c0 0300fec0 rpcrt4!LRPC_SCALL::DispatchRequest+0x280a9
0b 04e7fba4 759d7335 030b7f50 030b6e48 00000000 rpcrt4!LRPC_SCALL::HandleRequest+0x383
0c 04e7fbf0 759d7c62 030b7f50 04e7fc68 030b6e48 rpcrt4!LRPC_ADDRESS::HandleRequest+0x2e5
0d 04e7fce4 759dfa98 00000000 03018a40 759df9f0 rpcrt4!LRPC_ADDRESS::ProcessIO+0x252
0e 04e7fd28 777e31c9 04e7fe60 0308ef04 03018a40 rpcrt4!LrpcIoComplete+0xa8
0f 04e7fd58 777e409f 04e7fe60 03018a40 00000000 ntdll!TppAlpcpExecuteCallback+0xa9
10 04e7ff4c 74288654 03043e78 74288630 73bd2ce2 ntdll!TppWorkerThread+0x81f
11 04e7ff60 77814a77 03043e78 2e81e9fe 00000000 kernel32!BaseThreadInitThunk+0x24
12 04e7ffa8 77814a47 ffffffff 77839ef5 00000000 ntdll!__RtlUserThreadStart+0x2f
13 04e7ffb8 00000000 777e3880 03043e78 00000000 ntdll!_RtlUserThreadStart+0x1b

0:002&gt; ? <span style="color: #ff0000">1d4c0</span>
Evaluate expression: 120000 = 0001d4c0

The thread that is serving the request has called the Sleep function with the duration parameter set to 120000 msec.

&nbsp;
<h4><strong>COM</strong></h4>
The next set of wait types that WCT API can detect is COM. It can detect waits on both activation and method invocations.

<strong>Waiting on COM activation</strong>

I’ve created a simple COM object (WctActTest) and a COM+ Application (WctTestApp) that is hosting the WctActTest object. I’ve enabled object pooling and limited the maximum number of objects in the pool to be 5. The test is a short VBScript that creates 6 objects. After 5 objects are created and not released the COM+ infrastructure won’t allow the 6th activation request. Hence, the script host will wait.

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/1111.png"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/1111.png"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/1111.png"><img width="718" height="531" class="alignnone wp-image-285 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/1111.png" /></a>

The “Analyze wait chain” UI shows the following Wait Chain for the wscript.exe:

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/128.png"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/128.png"><img width="681" height="561" class="alignnone wp-image-295 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/128.png" /></a>

And, the corresponding entry in the WAITCHAIN log that is generated by <strong>WaitChain.exe</strong> is as follows:

Process (0x3778:0n14200) - wscript.exe
----------------------------------
28184: [3778:6e18:Blocked]-&gt;[Com:Owned:{b09cebcd-ba04-4c01-8927-b4122380c61d}]-&gt;[528:0:PidOnlyRpcss]-&gt;[ComActivation:Owned]-&gt;[5ee8:0:PidOnly]-&gt;[End]
9024: [3778:2340:Running]-&gt;[End]
31160: [3778:79b8:Running]-&gt;[End]
26232: [3778:6678:Running]-&gt;[End]
1712: [3778:6b0:Blocked]-&gt;[End]
11600: [3778:2d50:Running]-&gt;[End]
25832: [3778:64e8:Running]-&gt;[End]
30376: [3778:76a8:Blocked]-&gt;[End]
21164: [3778:52ac:Blocked]-&gt;[End]
11268: [3778:2c04:Blocked]-&gt;[End]

Relevant Processes: 0x528-&gt;0x5ee8-&gt;0x3778-&gt;[END]

It can be read as “The thread 6e18 (28184 in decimal) of process 3778 (14200 in decimal) is waiting on the COM object with ClassID {b09cebcd-ba04-4c01-8927-b4122380c61d}. The COM object is waiting to be activated. The activation request is delivered to the  process 528 (1320 in decimal, this is the RPCSS service). And, RPCSS is waiting on the process 5ee8 (24296 in decimal, dllhost.exe) that will do the activation”.

“When a process calls CoGetClassObject or CoCreateInstance (CreateObject or new in VB) to activate a component, the COM runtime contacts its local SCM COM activator (RPCSS service) in order to launch the corresponding COM server  that will host the desired component. If the component is remote, the local RPCSS service will forward the request to the RPCSS service of the remote machine.” Therefore, RPCSS is <a href="https://blogs.msdn.microsoft.com/asiatech/2010/03/15/how-to-troubleshoot-dcom-10009-error-logged-in-system-event/">involved</a>.

There is another entry called “Relevant Processes”. This is a list of the processes involved in the Wait Chains of the threads of the wscript.exe process.

&nbsp;

<strong>Waiting on a COM method call</strong>

In this case, there is a DCOM server process called WctComTest.exe and it is hosting a COM object with ProgID:wctCOM and ClassID: {5D74C767-00F4-400B-BE9F-11EA6F532AC2}. The COM object has a method that takes long time to finish execution. The client application that activates the wctCOM object and makes a method call on it is again a simple VBScript. Once more, the wscript.exe process is in focus as it is the waiting party.

The "Analyze wait chain" UI shows the wait chain as follows :

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/132.png"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/132.png"><img width="507" height="418" class="alignnone wp-image-305 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/132.png" /></a>

And, the corresponding entry in <strong>WaitChain.exe’s</strong> WAITCHAIN log file is:

Process (0x63d4:0n25556) - wscript.exe
----------------------------------
26872: [63d4:68f8:Blocked]-&gt;[Com:Owned]-&gt;[2840:2fdc:Blocked]-&gt;[End]
2752: [63d4:ac0:Blocked]-&gt;[End]
14620: [63d4:391c:Running]-&gt;[End]
29076: [63d4:7194:Running]-&gt;[End]
25908: [63d4:6534:Blocked]-&gt;[End]
10436: [63d4:28c4:Blocked]-&gt;[End]

Relevant Processes: 0x2840-&gt;0x63d4-&gt;[END]

This time the entry can be read as “The thread 68f8 (26872) of process 63d4 (25556 in decimal) is waiting on a COM method call that is executing on process 2840’s (10304 in decimal) thread 2fdc (12252 in decimal)”.

&nbsp;
<h4><strong>Critical Sections</strong></h4>
Critical sections can be used within a process for synchronization. It cannot be used to synchronize multiple processes. Hence, any output related to Critical Section in the WAITCHAIN log should be evaulated per process base. I have two test cases for Critical Section:
<ul>
 	<li>One is creating a deadlock</li>
 	<li>The other is the case where a thread has exited without leaving the entered critical section and another thread is waiting to enter that critical section</li>
</ul>
<strong>Deadlock</strong>

In this classic case there are two threads and two critical sections. Each thread enters a critical section and then tries to enter the other critical section. Hence, an infinite wait.

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/142.png"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/142.png"><img width="614" height="511" class="alignnone wp-image-315 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/142.png" /></a>

The “Analyze wait chain” UI has a precise explanation for the situation. The WAITCHAIN log has similar entries:

Process (0x4540:0n17728) - SyncWaitTest.exe
----------------------------------
22744: [4540:58d8:Blocked]-&gt;[End]
23712: [4540:5ca0:Blocked]-&gt;[End]
7896: [4540:1ed8:Blocked]-&gt;[CriticalSection:Owned]-&gt;[4540:39e0:Blocked]-&gt;[CriticalSection:Owned]-&gt;[4540:1ed8:Blocked]-&gt;[End] !!!Deadlock!!!
14816: [4540:39e0:Blocked]-&gt;[CriticalSection:Owned]-&gt;[4540:1ed8:Blocked]-&gt;[CriticalSection:Owned]-&gt;[4540:39e0:Blocked]-&gt;[End] !!!Deadlock!!!

The first line is read as “Thread 1ed8 (7896 in decimal) waits on a critical section that is entered by the thread 39e0 (14816 in decimal) in the same process 4540 (17728 in decimal). And, thread 39e0 tries to enter to a critical section that is already entered by thread 1ed8. Hence, a deadlock.”. The other line in the report is similar. This time the Wait Chain for the thread 39e0 is listed therefore the order of the wait chain is reversed.

&nbsp;

<strong>Waiting on an abandoned critical section</strong>

Sometimes -usually due to – a thread that has entered to a critical section exits without leaving the critical section. If that is the case then any thread that is waiting on that critical section will wait forever. Because, there is no way for the already exited thread to leave that critical section anymore. This is a wait on an abandoned critical section. The WCT API reports this situation as follows:

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/152.png"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/152.png"><img width="593" height="490" class="alignnone wp-image-325 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/152.png" /></a>

&nbsp;

The WAITCHAIN log has a very similar entry:
Process (0x76b4:0n30388) - SyncWaitTest.exe
----------------------------------
25960: [76b4:6568:Blocked]-&gt;[End]
23680: [76b4:5c80:Blocked]-&gt;[End]
29536: [76b4:7360:Blocked]-&gt;[CriticalSection:Abandoned]-&gt;[End]

Since the WaitChain tool reports the type of the wait objects and their status the explanation is a bit more descriptive. Here the thread 7360 is waiting on an abandoned critical section. This requires further troubleshooting. Application Verifier can be used to break into debugger when a thread exists without leaving the critical sections that it has entered before.

&nbsp;
<h4><strong>Mutual Exclusions (mutexes)</strong></h4>
Mutexes are synchronization objects that can be used to synchronise more than one process. I’ve created a situation where one process acquires a mutex but does not release it. A second instance of that application tries to acquire the same mutex. However, the second instance will wait for the first process instance to release that mutex object.

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/162.png"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/162.png"><img width="580" height="482" class="alignnone wp-image-335 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/162.png" /></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/162.png"></a>

&nbsp;

The WAITCHAIN report will have the wait object type therefore a bit more information:

Process (0x6524:0n25892) - SyncWaitTest.exe
----------------------------------
13244: [6524:33bc:Blocked]-&gt;[End]
24676: [6524:6064:Blocked]-&gt;[End]

Process (0x7b4c:0n31564) - SyncWaitTest.exe
----------------------------------
13468: [7b4c:349c:Blocked]-&gt;[End]
19848: [7b4c:4d88:Blocked]-&gt;[Mutex:Owned:\Sessions\43\BaseNamedObjects\SyncWaitMutex]-&gt;[6524:6064:Blocked]-&gt;[End]

Relevant Processes: 0x6524-&gt;[END]

&nbsp;

The second instance of the SyncWaitTest.exe is waiting on a mutex named “SyncWaitMutex” that is acquired by the other instance of the SyncWaitTest.exe process.

&nbsp;
<h4><strong>SendMessage</strong></h4>
SendMessage is a blocking function. It can be cumbersome to figure out which window’s Windows Procedure is targeted. SPY++ and/or dump files are necessary. WCT API is very convenient in this case to find out the process that hosts the target window for the SendMessage call.
To test the WCT API I’ve two applications:
<ul>
 	<li>One client application “SyncWaitTest.exe” that sends a message with MsgID : WM_USER+100 to the window whose class type is SampleWindowClass and window name is “LearntoProgramWindows”.</li>
 	<li>The SampleGUI.exe application which hosts this window will show a message box when that particular window message is received. Then it waits for the user to hit the OK button in the messagebox.</li>
</ul>
Until the OK button is clicked the SyncWaitTest.exe process’s thread which called the SendMessage API will wait.

This how the “Analyze wait chain” UI reports it:

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/172.png"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/172.png"><img width="602" height="500" class="alignnone wp-image-345 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/172.png" /></a>

&nbsp;

And, this is the content of the WAITCHAIN log:

Process (0x3984:0n14724) - SyncWaitTest.exe
----------------------------------
21768: [3984:5508:Blocked]-&gt;[SendMessage:Owned]-&gt;[36e4:66c:Blocked]-&gt;[End]

&nbsp;

Once more the wait type inclusion gives further hints for the nature of the wait.

&nbsp;
<h4><strong>Wait operations on processes and threads</strong></h4>
WCT APIs can detect whether a thread is waiting on another thread to complete or a process to terminate. Let’s create a process (Notepad.exe) and wait for the termination of it. The “Analyze wait chain” UI shows it as follows:

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/182.png"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/182.png"><img width="620" height="511" class="alignnone wp-image-355 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/182.png" /></a>

&nbsp;

And, it is listed in the WAITCHAIN log as follows:

Process (0x597c:0n22908) - SyncWaitTest.exe
----------------------------------
18568: [597c:4888:Blocked]-&gt;[End]
15796: [597c:3db4:Blocked]-&gt;[ProcWait:Owned]-&gt;[5ba8:0:PidOnly]-&gt;[End]

Relevant Processes: 0x5ba8-&gt;[END]

&nbsp;

Waiting on a thread has similar outcome. For the sake of completeness, I’m including the case of waiting on a thread. “Analyze wait chain” UI describes the situation as follows:

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/192.png"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/192.png"><img width="618" height="515" class="alignnone wp-image-365 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/192.png" /></a>

&nbsp;

And, the WAITCHAIN log has the following information:

Process (0x2e9c:0n11932) - SyncWaitTest.exe
----------------------------------
21336: [2e9c:5358:Blocked]-&gt;[End]
29804: [2e9c:746c:Blocked]-&gt;[ThreadWait:Owned]-&gt;[2e9c:7894:Blocked]-&gt;[End]
30868: [2e9c:7894:Blocked]-&gt;[End]

&nbsp;
<h3>Caveat</h3>
I could not find a way through the WCT API to detect the Wait Chain of a thread that is waiting on multiple objects. E.g. assume a thread creates two notepad.exe instances and then waits on both of them to terminate. At that time the waiting thread’s callstack would look like this:

0:004&gt; r;knL
rax=000000000000005b rbx=0000000000000002 rcx=0000000000000002
rdx=0000004a040ffa80 rsi=0000000000000000 rdi=0000000000000002
rip=00007ff8263f09c4 rsp=0000004a040ff6b8 rbp=0000000000000000
r8=000001d784e9b230  r9=0000000000000000 r10=0000000000000000
r11=0000000000000246 r12=0000000000000008 r13=0000004a040ffa80
r14=0000000000000000 r15=0000000000000001
iopl=0         nv up ei pl zr na po nc
cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
ntdll!NtWaitForMultipleObjects+0x14:
00007ff8`263f09c4 c3              ret
# Child-SP          RetAddr           Call Site
00 0000004a`040ff6b8 00007ff8`22faa966 ntdll!NtWaitForMultipleObjects+0x14
01 0000004a`040ff6c0 00007ff8`22faa84e KERNELBASE!WaitForMultipleObjectsEx+0x106
02 0000004a`040ff9c0 00007ff6`1fbb1e73 KERNELBASE!WaitForMultipleObjects+0xe
03 0000004a`040ffa00 00007ff8`26031fe4 SyncWaitTest!ChildProcesses+0x133
04 0000004a`040ffb10 00007ff8`263befb1 kernel32!BaseThreadInitThunk+0x14
05 0000004a`040ffb40 00000000`00000000 ntdll!RtlUserThreadStart+0x21

0:004&gt; dq @rdx L2
0000004a`040ffa80  00000000`<span style="color: #99cc00">00000108</span> 00000000`<span style="color: #00ccff">00000094</span>

0:004&gt; !handle <span style="color: #99cc00">108</span> f;!handle <span style="color: #00ccff">94</span> f
Handle 0000000000000108
Type          Process
Attributes    0
GrantedAccess 0x1fffff:
Delete,ReadControl,WriteDac,WriteOwner,Synch
Terminate,CreateThread,,VMOp,VMRead,VMWrite,DupHandle,CreateProcess,SetQuota,SetInfo,QueryInfo,SetPort
HandleCount   8
PointerCount  294752
Name          &lt;none&gt;
Object specific information
<span style="color: #ff00ff"> Process Id  20376</span>
Parent Process  20392
Base Priority 8
Handle 0000000000000094
Type          Process
Attributes    0
GrantedAccess 0x1fffff:
Delete,ReadControl,WriteDac,WriteOwner,Synch
Terminate,CreateThread,,VMOp,VMRead,VMWrite,DupHandle,CreateProcess,SetQuota,SetInfo,QueryInfo,SetPort
HandleCount   8
PointerCount  294634
Name          &lt;none&gt;
Object specific information
<span style="color: #ff00ff">Process Id  24984</span>
Parent Process  20392
Base Priority 8

However, nor “Analyze wait chain” nor WaitChain.exe does not reveal any clue.

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/201.png"></a><a href="https://msdnshared.blob.core.windows.net/media/2018/02/201.png"><img width="606" height="500" class="alignnone wp-image-375 size-full" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/201.png" /></a>

&nbsp;

Process (0x4fa8:0n20392) - SyncWaitTest.exe
----------------------------------
18504: [4fa8:4848:Blocked]-&gt;[End]
31400: [4fa8:7aa8:Running]-&gt;[End]
28240: [4fa8:6e50:Running]-&gt;[End]
8200: [4fa8:2008:Running]-&gt;[End]
18716: [4fa8:491c:Blocked]-&gt;[End]

Relevant Processes: 0x4fa8-&gt;[END]

&nbsp;

Therefore, no reported Wait Chain does not always mean that a process is not waiting on any object.

&nbsp;
<h3>Conclusion</h3>
In case you want a tool that produces a report of all or specific processes' WaitChain lists, generate dump files of the processes showing up in those Wait Chains then feel free to download it from here <a href="https://msdnshared.blob.core.windows.net/media/2018/02/WaitChain.zip">WaitChain</a>

If you are interested in the source code then you are welcome to access it from <a href="https://github.com/fhbilgen/WaitChain">here</a>.

&nbsp;

Enjoy!

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Don't let your thread sleep unless it really has to</title>
      <link>https://docs.microsoft.com/archive/blogs/hmm/dont-let-your-thread-sleep-unless-it-really-has-to</link>
      <pubDate>Thu, 26 Jan 2017 13:40:13 GMT</pubDate>
      <dc:creator><![CDATA[faik hakan bilgen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hmm/?p=165</guid>
      <description><![CDATA[Hello!

I -not so rarely- see a call to the Sleep API for polling purposes. Personally, I don’t...]]></description>
      <content:encoded><![CDATA[Hello!

I -not so rarely- see a call to the Sleep API for polling purposes. Personally, I don’t recommend Sleep for polling. It is not only waste of computing resources but also wrong usage ( or usage without knowing the possible consequences ) can cause unexpected behavior.

Let’s start visiting the MSDN article about <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms686298(v=vs.85).aspx">Sleep</a> . Remarks section is what needs to be understood thoroughly:

<em>“This function causes a thread to relinquish the remainder of its time slice and become unrunnable for an interval based on the value of dwMilliseconds. The system clock "ticks" at a constant rate. If dwMilliseconds is less than the resolution of the system clock, the thread may sleep for less than the specified length of time. If dwMilliseconds is greater than one tick but less than two, the wait can be anywhere between one and two ticks, and so on. To increase the accuracy of the sleep interval, call the timeGetDevCaps function to determine the supported minimum timer resolution and the timeBeginPeriod function to set the timer resolution to its minimum. Use caution when calling timeBeginPeriod, as frequent calls can significantly affect the system clock, system power usage, and the scheduler. If you call timeBeginPeriod, call it one time early in the application and be sure to call the timeEndPeriod function at the very end of the application.</em>

<em>After the sleep interval has passed, the thread is ready to run. If you specify 0 milliseconds, the thread will relinquish the remainder of its time slice but remain ready. Note that a ready thread is not guaranteed to run immediately. Consequently, the thread may not run until some time after the sleep interval elapses.”</em>

&nbsp;

Hence:
<ul>
 	<li>The thread is not guaranteed to resume execution after dwMilliSeconds.</li>
 	<li>Abuse of the request for higher clock resolution might stress the system performance.</li>
</ul>
&nbsp;

Please read the experiences of developers in the discussion parts of the following forum articles:

<a href="http://stackoverflow.com/questions/7614936/can-i-improve-the-resolution-of-thread-sleep">http://stackoverflow.com/questions/7614936/can-i-improve-the-resolution-of-thread-sleep</a>

<a href="https://social.msdn.microsoft.com/Forums/en-US/ed169c61-465a-40c9-a9ef-d5b0c6138fdc/how-to-increase-the-timer-resolution-for-threadsleep?forum=netfxbcl">https://social.msdn.microsoft.com/Forums/en-US/ed169c61-465a-40c9-a9ef-d5b0c6138fdc/how-to-increase-the-timer-resolution-for-threadsleep?forum=netfxbcl</a>

<a href="http://stackoverflow.com/questions/23215970/system-threading-timer-vs-system-threading-thread-sleep-resolution-net-timer">http://stackoverflow.com/questions/23215970/system-threading-timer-vs-system-threading-thread-sleep-resolution-net-timer</a>

&nbsp;

If your solution really requires a timer and you are not going to use it for polling then the following article might help you to understand more accurate timers :

<a href="http://www.codeproject.com/Articles/1236/Timers-Tutorial">http://www.codeproject.com/Articles/1236/Timers-Tutorial</a>

What usually is suggested is to remove the call to the Sleep function and change the logic such that an alertable wait is used. E.g. insteadof waking up every 10 msec and checking a registry key’s some value register to the registry change event. This way the thread won’t waste any CPU cycles.

&nbsp;

I’ve listed some of the blog entries of Raymond Chen about Sleep and Polling. He has already explained them very well. Please have a look before you design a solution around Sleep and Polling.

<strong><a href="https://blogs.msdn.microsoft.com/oldnewthing/20060124-17/?p=32553">Performance consequences of polling</a></strong>

<a href="https://blogs.msdn.microsoft.com/oldnewthing/20051004-09/?p=33923/">Consequences of the scheduling algorithm: Sleeping doesn’t always help</a>

<a href="https://blogs.msdn.microsoft.com/oldnewthing/20090727-00/?p=17353/">Polling by sleeping versus polling by waiting with a timeout</a>

<a href="https://blogs.msdn.microsoft.com/oldnewthing/20060210-00/?p=32323/">The dangers of sleeping on a UI thread</a>

<a href="https://blogs.msdn.microsoft.com/oldnewthing/20160826-00/?p=94185">Spurious wakes, race conditions, and bogus FIFO claims: A peek behind the curtain of WaitOnAddress</a>

<a href="https://blogs.msdn.microsoft.com/oldnewthing/20060503-11/?p=31323/">The alertable wait is the non-GUI analog to pumping messages</a>

<a href="https://blogs.msdn.microsoft.com/oldnewthing/20060313-06/?p=31953/">A thread waiting on a synchronization object could be caught napping</a>

<strong><a href="https://blogs.msdn.microsoft.com/oldnewthing/20040608-00/?p=38983/">When can a thread receive window messages?</a></strong>

<a href="https://blogs.msdn.microsoft.com/oldnewthing/20151202-00/?p=92241">Hidden gotcha in the thread pool sample program on MSDN</a>

&nbsp;

Happy coding!]]></content:encoded>
    </item>
    <item>
      <title>The curious case of a Windows Service consuming 3% of CPU time</title>
      <link>https://docs.microsoft.com/archive/blogs/hmm/the-curious-case-of-a-windows-service-consuming-3-of-cpu-time</link>
      <pubDate>Wed, 09 Nov 2016 13:42:43 GMT</pubDate>
      <dc:creator><![CDATA[faik hakan bilgen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hmm/?p=156</guid>
      <description><![CDATA[Hello,

Recently I had a nice case which I thought I should share. My hope is that the steps might...]]></description>
      <content:encoded><![CDATA[Hello,

Recently I had a nice case which I thought I should share. My hope is that the steps might be useful for the beginner/intermediate level debugging fans out there.

My customer's complaint was that an in-house developed Windows Service was steadily consuming 3% of CPU time. To start troubleshooting we have created a dump file via Task Manager.

To see for how long the process was alive I've used the ".time" command :

0:000&gt; .time
Debug session time: Thu Nov  3 09:54:01.000 2016 (UTC + 3:00)
System Uptime: 140 days 19:23:12.533
Process Uptime: <span style="color: #ff0000">0 days 7:54:01.000</span>
Kernel time: <span style="color: #0000ff">0 days 0:00:35.000</span>
User time: <span style="color: #0000ff">0 days 7:30:28.000</span>

&nbsp;

The output states that the process was running for <span style="color: #ff0000">0 days,</span> <span style="color: #ff0000">7 hours, 54 minutes and 1 second</span>. Also, the process has consumed<span style="color: #0000ff"> 7 hours 31 minutes and 3 second</span> processor time during its lifetime (Kernel Time + User Time).

Let's convert both of the life and CPU-consumption times into seconds. Hence, we have 28441 for Up-Time and 27063 for CPU-Time. CPU-Time divided by Up-Time and multiplied by 100 will result into CPU utilization. This calculates a 95.15 % CPU utilization.

But, in Task Manager each process's CPU usage is displayed as CPU usage with respect to all of the CPUs in the system. Hence, we need to learn the number of cores in this server. We get this information via the "!cupid" command. Let's do it :

0:000&gt; !cpuid
CP  F/M/S  Manufacturer     MHz
0  6,13,7  &lt;unavailable&gt;   2700
1  6,13,7  &lt;unavailable&gt;   2700
2  6,13,7  &lt;unavailable&gt;   2700
3  6,13,7  &lt;unavailable&gt;   2700
4  6,13,7  &lt;unavailable&gt;   2700
5  6,13,7  &lt;unavailable&gt;   2700
6  6,13,7  &lt;unavailable&gt;   2700
7  6,13,7  &lt;unavailable&gt;   2700
8  6,13,7  &lt;unavailable&gt;   2700
9  6,13,7  &lt;unavailable&gt;   2700
10  6,13,7  &lt;unavailable&gt;   2700
11  6,13,7  &lt;unavailable&gt;   2700
12  6,13,7  &lt;unavailable&gt;   2700
13  6,13,7  &lt;unavailable&gt;   2700
14  6,13,7  &lt;unavailable&gt;   2700
15  6,13,7  &lt;unavailable&gt;   2700
16  6,13,7  &lt;unavailable&gt;   2700
17  6,13,7  &lt;unavailable&gt;   2700
18  6,13,7  &lt;unavailable&gt;   2700
19  6,13,7  &lt;unavailable&gt;   2700
20  6,13,7  &lt;unavailable&gt;   2700
21  6,13,7  &lt;unavailable&gt;   2700
22  6,13,7  &lt;unavailable&gt;   2700
23  6,13,7  &lt;unavailable&gt;   2700
24  6,13,7  &lt;unavailable&gt;   2700
25  6,13,7  &lt;unavailable&gt;   2700
26  6,13,7  &lt;unavailable&gt;   2700
27  6,13,7  &lt;unavailable&gt;   2700
28  6,13,7  &lt;unavailable&gt;   2700
29  6,13,7  &lt;unavailable&gt;   2700
30  6,13,7  &lt;unavailable&gt;   2700
31  6,13,7  &lt;unavailable&gt;   2700

There are 32 cores in the computer. A <span style="text-decoration: underline">100% CPU usage of a single core</span> by a process would be showed in the CPU column in Task Manager as 1 / 32 x 100. This equals to 3.125%. However, in this case the service process consumes roughly 95.15% of a single core. Then, we need to find out the 95.15 percent of 3.125. And, this is 3,125 x 0,9515 = 2,9734. Which might be rounded up as 3 % in Task Manager.

This leaves us with the probability of one thread of the process being in a tight loop. Let's verify. The "!runaway" command lists the threads of a process and their CPU usage time. The list contains only the threads those are running at the time when the dump was generated. It does not contain any thread that has executed and exited before the dump was made.

0:000&gt; !runaway
User Mode Time
Thread       Time
<span style="color: #ff0000"><strong>  89:e370      0 days 7:29:37.128</strong></span>
34:3fc0      0 days 0:00:05.304
45:9b20      0 days 0:00:02.636
84:8830      0 days 0:00:00.546
93:21340      0 days 0:00:00.390
91:1b3f4      0 days 0:00:00.265
94:21264      0 days 0:00:00.234
59:179f4      0 days 0:00:00.234
75:1edc4      0 days 0:00:00.218
68:20aec      0 days 0:00:00.218

<em>[Truncated the complete output for brevity]</em>

The top consumer is the thread with Debugger ID 89. It has used 7 hours 29 minutes and 37 seconds of CPU time. This is almost equal to the total CPU usage time of the process. Let's switch to that thread :

0:089&gt; ~89s
XYZ_ABC_PQR!XYZ.ABC.PQR.ResourcePool.PoolManagerFunc()+0xb4:
000007fe`99834b14 85c0            test    eax,eax

and see what it is doing :

0:089&gt; !clrstack -n
OS Thread Id: 0xe370 (89)
Child SP               IP Call Site
0000000023d2e590 000007fe99834b14 XYZ_ABC_PQR!XYZ.ABC.PQR.ResourcePool.PoolManagerFunc()
0000000023d2e5f0 000007fe99543cb5 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
0000000023d2e750 000007fe995408b9 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
0000000023d2e780 000007fe995407ef System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
0000000023d2e7d0 000007fe9953c130 System.Threading.ThreadHelper.ThreadStart()
0000000023d2eb38 000007fef8739e03 [GCFrame: 0000000023d2eb38]
0000000023d2ee68 000007fef8739e03 [DebuggerU2MCatchHandlerFrame: 0000000023d2ee68]
0000000023d2f048 000007fef8739e03 [ContextTransitionFrame: 0000000023d2f048]
0000000023d2f238 000007fef8739e03 [DebuggerU2MCatchHandlerFrame: 0000000023d2f238]

There is no function name that suggests any wait. Hence, the thread should be spinning inside XYZ_ABC_PQR!XYZ.ABC.PQR.ResourcePool.PoolManagerFunc(). We need to understand what this function is doing. Let's find the module information first :

0:089&gt; lm
start             end                 module name
00000000`69370000 00000000`693b0000   XYZ_ABC_PQR C (no symbols)

<em>[Truncated the complete output for brevity]</em>

&nbsp;

And, then write the module into a file.

0:089&gt; !savemodule 00000000`69370000 F:\work\blog\modules\XYZ.ABC.PQR.dll
3 sections in file
section 0 - VA=2000, VASize=38904, FileAddr=200, FileSize=38a00
section 1 - VA=3c000, VASize=3d0, FileAddr=38c00, FileSize=400
section 2 - VA=3e000, VASize=c, FileAddr=39000, FileSize=200

&nbsp;

Finally, open the saved module XYZ.ABC.PQR.dll within ILSpy (or any .NET reflector tool) and browse the PoolManagerFunc :
<p style="padding-left: 30px"><span>private</span> <span>static</span> <span>void</span> <span>PoolManagerFunc</span>()
{
<span>while</span> (ResourcePool.Initialized)
{
<span>if</span> (ResourcePool.availableResources.Count &lt;= ResourcePool.POOL_MIN_SIZE)
{
// Open a resource and add it to the pool. Then, sleep for 50 milliseconds. Removed the actual code!
Thread.<span>Sleep</span>(<span>50</span>);
}
}
}</p>
The code above suggests that if the number of resources in the pool is less than the configured minimum then create a new resource and add it to the pool.

However, if there are at least a minimum number of resources in the pool then the loop <em>"while (ResourcePool.Initialized)"</em> and the control statement <em>"if (ResourcePool.availableResources.Count &lt;= ResourcePool.POOL_MIN_SIZE)" </em>are executed all the time.

To have an idea of the number of resources in that pool we simply need to dump out the ResourcePool class instance. Since, that class instance is declared as static we have to dump it with the  command "!dumpclass".

Before that we have to find out the class address of XYZ.ABC.PQR.ResourcePool. We will first learn the MethodTable value using the XYZ.ABC.PQR.ResourcePool.PoolManagerFunc function. Let's re-visit the following output :

0:089&gt; !clrstack -n
OS Thread Id: 0xe370 (89)
Child SP               IP Call Site
0000000023d2e590 <span style="color: #008000"><strong>000007fe99834b14 </strong></span>XYZ_ABC_PQR!XYZ.ABC.PQR.ResourcePool.PoolManagerFunc()

<em>[Truncated the complete output for brevity]</em>

Asking the SOS extension the MethodDescriptor value of the IP (Instruction Pointer) :

0:089&gt; !ip2md <span style="color: #008000"><strong>000007fe99834b14</strong></span>
MethodDesc:   000007fe998e80c0
Method Name:  XYZ.ABC.PQR.ResourcePool.PoolManagerFunc()
Class:        <strong><span style="color: #ff00ff">000007fe99912808</span></strong>
MethodTable:  000007fe998e8140
mdToken:      00000000060001d3
Module:       000007fe998e2220
IsJitted:     yes
CodeAddr:     000007fe99834a60
Transparency: Critical

So the class address is <span style="color: #ff00ff"><strong>000007fe99912808</strong><span style="color: #000000">.</span></span>

0:089&gt; !dumpclass <span style="color: #ff00ff"><strong>000007fe99912808</strong></span>
Class Name:      XYZ.ABC.PQR.ResourcePool
mdToken:         0000000002000091
File:            C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\www\c2274130\f70100df\assembly\dl3\0d903943\00c83a5a_1060d101\XYZ.ABC.PQR.ResourcePool.dll
Parent Class:    000007fe990f9730
Module:          000007fe998e2220
Method Table:    000007fe998e8140
Vtable Slots:    4
Total Method Slots:  5
Class Attributes:    181  Abstract,
Transparency:        Critical
NumInstanceFields:   0
NumStaticFields:     b
MT    Field   Offset                 Type VT     Attr            Value Name
<em>[Truncated the complete output for brevity]</em>

000007fe998e81d0  400085f      110 XYZ.ABC.PQR]]  0   static <strong><span style="color: #ff0000">00000006bf2e6880 availableResources</span></strong>

000007fe990df9e8  4000862       f4         System.Int32  1   static               <strong><span style="color: #ff0000">20 POOL_MIN_SIZE</span></strong>
000007fe990df9e8  4000863       f8         System.Int32  1   static              500 POOL_MAX_SIZE
000007fe990dc918  4000865      101       System.Boolean  1   static                1 Initialized

&nbsp;

Then dump the "availableResources" member's content :

0:089&gt; !DumpObj <span style="color: #ff0000"><strong>00000006bf2e6880</strong></span>
Name:        System.Collections.Generic.Queue`1[[XYZ.ABC.PQR.CustomResource, XYZ.ABC.PQR]]
MethodTable: 000007fe998e81d0
EEClass:     000007fe9990e458
Size:        48(0x30) bytes
File:        C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll
Fields:
MT    Field   Offset                 Type VT     Attr            Value Name
000007fe990dbd20  40007fa        8      System.Object[]  0 instance 000000083f30bbe0 _array
000007fe990df9e8  40007fb       18         System.Int32  1 instance                1 _head
000007fe990df9e8  40007fc       1c         System.Int32  1 instance               23 _tail
000007fe990df9e8  40007fd       20         System.Int32  1 instance               <span style="color: #ff0000"><strong>22 _size</strong></span>
000007fe990df9e8  40007fe       24         System.Int32  1 instance           108510 _version
000007fe990d63a8  40007ff       10        System.Object  0 instance 0000000000000000 _syncRoot
000007fe990dbd20  4000800        8      System.Object[]  0   static  &lt;no information&gt;

Hence, there are currently 22 resources in the pool. The code fragment that is responsible for new resource creation, pool addition and sleeping will only execute if the number of resources drops below the minimum (which is 20, right now) else the whole time the thread will execute a tight loop. And, that will cause the 3% CPU usage.

To fix the problem the implementation of XYZ.ABC.PQR.ResourcePool.PoolManagerFunc() should be changed such that a new resource is added when the number of resources drops below the lower threshold and not polling the number of resources in a tight loop.

Good luck!

&nbsp;

REFERENCES

<a target="_blank" href="https://msdn.microsoft.com/en-us/library/windows/hardware/ff565458(v=vs.85).aspx">.time (Display System Time)</a>

<a target="_blank" href="https://msdn.microsoft.com/en-us/library/windows/hardware/ff562269(v=vs.85).aspx">!cupid</a>

<a target="_blank" href="https://msdn.microsoft.com/en-us/library/windows/hardware/ff564894(v=vs.85).aspx">!runaway</a>

<a target="_blank" href="https://msdn.microsoft.com/en-us/library/bb190764(v=vs.110).aspx">SOS.dll (SOS Debugging Extension)</a>

<a target="_blank" href="https://support.microsoft.com/en-us/kb/931673">How to create a user-mode process dump file in Windows Vista and in Windows 7</a>

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>General Troubleshooting Reference</title>
      <link>https://docs.microsoft.com/archive/blogs/hmm/general-troubleshooting-reference</link>
      <pubDate>Sat, 08 Oct 2016 16:08:13 GMT</pubDate>
      <dc:creator><![CDATA[faik hakan bilgen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hmm/?p=155</guid>
      <description><![CDATA[Hello,

Within this blog I try to make a list of resources for general troubleshooting on Windows...]]></description>
      <content:encoded><![CDATA[Hello,

Within this blog I try to make a list of resources for general troubleshooting on Windows Operating System. The list is not exhaustive. However, I'll try to keep the list as up-to-date as possible. So please come and visit again :)

This article is broken down into three parts :
<h4>ONLINE KNOWLEDGE RESOURCES
TOOLS
BOOKS</h4>
&nbsp;
<h3>ONLINE KNOWLEDGE RESOURCES</h3>
The following resources are from Mark Russinovich. There are videos, blogs and various online resouces. The topics are around troubleshooting different problems using Mark's tools. Some resources dive deep into the Windows Operating System.

<strong>Sysinternals Learning Resources</strong>

<a href="https://technet.microsoft.com/en-us/sysinternals/bb469930">https://technet.microsoft.com/en-us/sysinternals/bb469930</a>

&nbsp;

<strong>Windows Sysinternals Administrator's Reference</strong>

<a href="https://technet.microsoft.com/en-us/sysinternals/hh290819">https://technet.microsoft.com/en-us/sysinternals/hh290819</a>

&nbsp;

<strong>Mark's Webcasts</strong>

<a href="https://technet.microsoft.com/en-us/sysinternals/bb963887">https://technet.microsoft.com/en-us/sysinternals/bb963887</a>

&nbsp;

<span><strong>Mark's Blog</strong> </span>

<a href="https://blogs.technet.microsoft.com/markrussinovich/">https://blogs.technet.microsoft.com/markrussinovich/</a>

&nbsp;

The following is a very useful set of episodes on Channel 9. Each episode is about a different topic. It is basically around troubleshooting very different scenarios with a wide range of tools. It is highly probable that you encounter an episode that matches your current ongoing issue whatever that might be :)

&nbsp;

<strong>Defrag Tools</strong>

<a href="https://channel9.msdn.com/Shows/Defrag-Tools">https://channel9.msdn.com/Shows/Defrag-Tools</a>
<h5></h5>
<h5><strong>Microsoft Blogs about Windows Technologies and Support</strong></h5>
&nbsp;

<strong>Windows Supportability Team Blog</strong>

<a href="https://blogs.technet.microsoft.com/supportingwindows/">https://blogs.technet.microsoft.com/supportingwindows/</a>

&nbsp;

<strong>Ask the Core Team</strong> / Microsoft Enterprise Platforms Support: Windows Server Core Team

<a href="https://blogs.technet.microsoft.com/askcore/">https://blogs.technet.microsoft.com/askcore/</a>

&nbsp;

<strong>Ask the Directory Services Team</strong> / Microsoft's official enterprise support blog for AD DS and more

<a href="https://blogs.technet.microsoft.com/askds/">https://blogs.technet.microsoft.com/askds/</a>

&nbsp;

<strong>Ask Premier Field Engineering (PFE) Platforms</strong>

<a href="https://blogs.technet.microsoft.com/askpfeplat/">https://blogs.technet.microsoft.com/askpfeplat/</a>

&nbsp;

<strong>Ntdebugging Blog</strong> / Microsoft Advanced Windows Debugging and Troubleshooting

<a href="https://blogs.msdn.microsoft.com/ntdebugging/">https://blogs.msdn.microsoft.com/ntdebugging/</a>

&nbsp;

<strong>Networking Blog </strong>/ Windows Networking support team and Product team blog

<a href="https://blogs.technet.microsoft.com/networking/">https://blogs.technet.microsoft.com/networking/</a>

&nbsp;

<strong>Clustering and High-Availability</strong> / Failover Clustering and Network Load Balancing Team Blog

<a href="https://blogs.msdn.microsoft.com/clustering/">https://blogs.msdn.microsoft.com/clustering/</a>

&nbsp;

<span><strong>Server Storage at Microsoft</strong> </span>/ The official blog of the Windows Server storage engineering teams

<a href="https://blogs.technet.microsoft.com/filecab/">https://blogs.technet.microsoft.com/filecab/</a>

&nbsp;

<strong>The Hot Blog </strong>/ In hot blog, we blog hotfix right!

<a href="https://blogs.technet.microsoft.com/hot/">https://blogs.technet.microsoft.com/hot/</a>

&nbsp;

<strong>Microsoft Edge Developer</strong>

<a href="https://blogs.windows.com/msedgedev">https://blogs.windows.com/msedgedev</a>

&nbsp;

<span><strong>IEBlog</strong> / Internet Explorer Team Blog</span>

<a href="https://blogs.msdn.microsoft.com/ie/">https://blogs.msdn.microsoft.com/ie/</a>

&nbsp;
<h5>Measuring Application Performance</h5>
&nbsp;

<strong>Improving Your App’s Performance with PerfView</strong>

<a href="https://blogs.msdn.microsoft.com/dotnet/2012/10/09/improving-your-apps-performance-with-perfview/">https://blogs.msdn.microsoft.com/dotnet/2012/10/09/improving-your-apps-performance-with-perfview/</a>

&nbsp;

<strong>Vance Morrison's Weblog</strong>

<a href="https://blogs.msdn.microsoft.com/vancem/tag/perfview/">https://blogs.msdn.microsoft.com/vancem/tag/perfview/</a>

&nbsp;

<strong>PerfView Tutorial</strong>

<a href="https://channel9.msdn.com/Series/PerfView-Tutorial">https://channel9.msdn.com/Series/PerfView-Tutorial</a>

&nbsp;

<span><strong>Microsoft/perfview</strong> </span>

<a href="https://github.com/Microsoft/perfview">https://github.com/Microsoft/perfview</a>

&nbsp;

&nbsp;
<h3>TOOLS</h3>
&nbsp;

<strong>Sysinternals Utilities Index</strong>

<a href="https://technet.microsoft.com/en-us/sysinternals/bb545027">https://technet.microsoft.com/en-us/sysinternals/bb545027</a>

&nbsp;

<strong>PerfView</strong>

<a href="https://www.microsoft.com/en-us/download/details.aspx?id=28567">https://www.microsoft.com/en-us/download/details.aspx?id=28567</a>

&nbsp;

PerfView is a performance-analysis tool that helps isolate CPU- and memory-related performance issues.

PerfView Tutorial is a multipart series that can be found at :

<a href="https://channel9.msdn.com/Series/PerfView-Tutorial">https://channel9.msdn.com/Series/PerfView-Tutorial</a>

&nbsp;

The source code can be downloaded from

<strong>Microsoft/perfview</strong>

<a href="https://github.com/Microsoft/perfview">https://github.com/Microsoft/perfview</a>

&nbsp;

<strong>Windows Performance Toolkit</strong>

<a href="https://msdn.microsoft.com/en-us/windows/hardware/commercialize/test/wpt/index">https://msdn.microsoft.com/en-us/windows/hardware/commercialize/test/wpt/index</a>

&nbsp;

<strong>Dependency Walker 2.2</strong>

<a href="http://www.dependencywalker.com/">http://www.dependencywalker.com/</a>

&nbsp;

&nbsp;
<h3>BOOKS</h3>
&nbsp;

<span><strong>Troubleshooting with the Windows Sysinternals Tools (2nd Edition) 2nd Edition</strong> </span>

<a href="https://www.amazon.com/Troubleshooting-Windows-Sysinternals-Tools-2nd/dp/0735684448/ref=pd_bxgy_14_img_2?ie=UTF8&amp;psc=1&amp;refRID=ESPM5ZENR3JX7QBCPZ7Z">https://www.amazon.com/Troubleshooting-Windows-Sysinternals-Tools-2nd/dp/0735684448/ref=pd_bxgy_14_img_2?ie=UTF8&amp;psc=1&amp;refRID=ESPM5ZENR3JX7QBCPZ7Z</a>

&nbsp;

<strong>Windows Performance Analysis Field Guide</strong>

<a href="https://www.amazon.com/gp/product/0124167012/ref=pd_sim_14_4?ie=UTF8&amp;pd_rd_i=0124167012&amp;pd_rd_r=HNRWPWPPXDW1H86RX9CF&amp;pd_rd_w=yQWRM&amp;pd_rd_wg=fXuFA&amp;psc=1&amp;refRID=HNRWPWPPXDW1H86RX9CF">https://www.amazon.com/gp/product/0124167012/ref=pd_sim_14_4?ie=UTF8&amp;pd_rd_i=0124167012&amp;pd_rd_r=HNRWPWPPXDW1H86RX9CF&amp;pd_rd_w=yQWRM&amp;pd_rd_wg=fXuFA&amp;psc=1&amp;refRID=HNRWPWPPXDW1H86RX9CF</a>

&nbsp;

<span><strong>Windows Internals, Part 1 (6th Edition) (Developer Reference) 6th Edition</strong> </span>

<a href="https://www.amazon.com/Windows-Internals-Part-Developer-Reference/dp/0735648735/ref=sr_1_2?ie=UTF8&amp;qid=1475941683&amp;sr=8-2&amp;keywords=windows+internals">https://www.amazon.com/Windows-Internals-Part-Developer-Reference/dp/0735648735/ref=sr_1_2?ie=UTF8&amp;qid=1475941683&amp;sr=8-2&amp;keywords=windows+internals</a>

&nbsp;

<strong>Windows Internals, Part 2 (6th Edition) (Developer Reference) 6th Edition</strong>

<a href="https://www.amazon.com/Windows-Internals-Part-Developer-Reference/dp/0735665877/ref=sr_1_3?ie=UTF8&amp;qid=1475941683&amp;sr=8-3&amp;keywords=windows+internals">https://www.amazon.com/Windows-Internals-Part-Developer-Reference/dp/0735665877/ref=sr_1_3?ie=UTF8&amp;qid=1475941683&amp;sr=8-3&amp;keywords=windows+internals</a>]]></content:encoded>
    </item>
    <item>
      <title>Trace.WriteLine may call OutputDebugString</title>
      <link>https://docs.microsoft.com/archive/blogs/hmm/trace-writeline-may-call-outputdebugstring</link>
      <pubDate>Sun, 17 May 2015 02:52:00 GMT</pubDate>
      <dc:creator><![CDATA[faik hakan bilgen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hmm/2015/05/17/trace-writeline-may-call-outputdebugstring/</guid>
      <description><![CDATA[Recently, I was asked to check a couple of dump files. They were generated when their Biztalk server...]]></description>
      <content:encoded><![CDATA[<p>Recently, I was asked to check a couple of dump files. They were generated when their Biztalk server process was responding slow. I&rsquo;ve listed the callstacks of all the threads. More than 100 threads were waiting to enter a monitor. An example callstack of such waiting threads is as follows :</p>
<p>&nbsp;</p>
<p>System.Threading.Monitor.Enter(System.Object)</p>
<p>System.Diagnostics.TraceInternal.WriteLine(System.String) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>XYZ.BiztalkESB.Utilities.GenericHelper.TraceWrite(System.String, System.String, System.String)</p>
<p>XYZ.BiztalkESB.Utilities.CacheBase.TryGetValue</p>
<p>XYZ.BiztalkESB.Utilities.InterchangeParameterCache.GetParamValue</p>
<p>XYZ.BiztalkESB.Utilities.ParameterHelper.GetInterchangeParameter</p>
<p>XYZ.BiztalkESB.Utilities.LoggerHelper.Log</p>
<p>XYZ.BiztalkESB.Utilities.LoggerHelper.LogHeader</p>
<p>XYZ.SomeIntegration.Biztalk.Resolvers.InterchangeDefinitionResolverOnline.Resolve</p>
<p>XYZ.BiztalkESB.Resolvers.XYZSomeResolveProvider.ResolveItineraryName</p>
<p>XYZ.BiztalkESB.Resolvers.XYZSomeResolveProvider.Resolve</p>
<p>Microsoft.Practices.ESB.Resolver.ResolverMgr.Resolve</p>
<p>Microsoft.Practices.ESB.Itinerary.PipelineComponents.ItinerarySelector.Execute</p>
<p>Microsoft.BizTalk.Internal.ComponentWrapper.Execute</p>
<p>Microsoft.BizTalk.PipelineOM.SimpleStage.Execute</p>
<p>Microsoft.BizTalk.PipelineOM.Pipeline.Execute</p>
<p>Microsoft.BizTalk.PipelineOM.ReceivePipeline.GetNext</p>
<p>&nbsp;</p>
<p>And, the thread that has entered the monitor has the following callstack. This thread is waiting while executing OutputDebugString.</p>
<p>&nbsp;</p>
<p>ntdll!ZwWaitForSingleObject+0xa</p>
<p>KERNELBASE!WaitForSingleObjectEx+0x92</p>
<p>KERNELBASE!WaitForSingleObject+0xd</p>
<p>KERNELBASE!OutputDebugStringA+0x130</p>
<p>KERNELBASE!OutputDebugStringW+0x58</p>
<p>System_ni!DomainNeutralILStubClass.IL_STUB_PInvoke(System.String)+0x82</p>
<p>System_ni!System.Diagnostics.DefaultTraceListener.Write(System.String, Boolean)+0x41</p>
<p>System_ni!System.Diagnostics.DefaultTraceListener.WriteLine(System.String, Boolean)+0x3f</p>
<p>System_ni!System.Diagnostics.TraceInternal.WriteLine(System.String)+0xfb</p>
<p>XYZ_BiztalkESB_Utilities!XYZ.BiztalkESB.Utilities.GenericHelper.TraceWrite(System.String, System.String, System.String)+0x59</p>
<p>XYZ_BiztalkESB_Utilities!XYZ.BiztalkESB.Utilities.CacheBase.TryGetValue</p>
<p>XYZ_BiztalkESB_Utilities!XYZ.BiztalkESB.Utilities.InterchangeParameterCache.GetParamValue</p>
<p>XYZ_BiztalkESB_Utilities!XYZ.BiztalkESB.Utilities.ParameterHelper.GetInterchangeParameter</p>
<p>XYZ_BiztalkESB_Utilities!XYZ.BiztalkESB.Utilities.LoggerHelper.Log</p>
<p>XYZ_BiztalkESB_Utilities!XYZ.BiztalkESB.Utilities.LoggerHelper.LogHeader</p>
<p>XYZ_SomeIntegration_Biztalk_Resolvers!XYZ.XYZSomeIntegration.Biztalk.Resolvers.InterchangeDefinitionResolverOnline.Resolve</p>
<p>XYZ_BiztalkESB_Resolvers!XYZ.BiztalkESB.Resolvers.XYZSomeResolveProvider.ResolveItineraryName</p>
<p>XYZ_BiztalkESB_Resolvers!XYZ.BiztalkESB.Resolvers.XYZSomeResolveProvider.Resolve</p>
<p>Microsoft_Practices_ESB_Resolver!Microsoft.Practices.ESB.Resolver.ResolverMgr.Resolve</p>
<p>&nbsp;</p>
<p>It is time to use <a href="http://referencesource.microsoft.com">http://referencesource.microsoft.com</a>&nbsp;Let&rsquo;s first understand why a monitor is used. In the source of TraceInternal.WriteLine we can clearly see the synchronisation part :</p>
<p>&nbsp;</p>
<table style="width: 330px; height: 355px;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="751">
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">public static void <a href="http://referencesource.microsoft.com/System/R/4214459e068ff703.html" target="n">WriteLine</a>(string message) {</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp;if (<a href="http://referencesource.microsoft.com/System/compmod/system/diagnostics/TraceInternal.cs.html#863a76a3beb90edd">UseGlobalLock</a>)</span><br /><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp; {</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp;&nbsp;lock (<a href="http://referencesource.microsoft.com/System/compmod/system/diagnostics/TraceInternal.cs.html#98190c38929a4cec">critSec</a>)</span><br /><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp; {</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp; &nbsp;foreach (<a href="http://referencesource.microsoft.com/System/compmod/system/diagnostics/TraceListener.cs.html#5825ee1f63c434f9">TraceListener</a> listener in <a href="http://referencesource.microsoft.com/System/compmod/system/diagnostics/TraceInternal.cs.html#99be2096086160eb">Listeners</a>)</span><br /><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp; {</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp;&nbsp; &nbsp;listener.<a href="http://referencesource.microsoft.com/System/compmod/system/diagnostics/TraceListener.cs.html#6c354785ef801807">WriteLine</a>(message);</span></p>
<p><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">&nbsp;&nbsp;&nbsp; if&nbsp;</span><span style="font-family: arial,helvetica,sans-serif;">(<a href="http://referencesource.microsoft.com/System/compmod/system/diagnostics/TraceInternal.cs.html#5e6a26b231cb82f6">AutoFlush</a>)</span></span><br /><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp; listener.<a href="http://referencesource.microsoft.com/System/compmod/system/diagnostics/TraceListener.cs.html#53ad313468574c6f">Flush</a>();}}</span></p>
<p>[The rest is truncated]</p>
<p>&nbsp;The lock is defined as :</p>
<p>&nbsp;<span style="font-family: arial,helvetica,sans-serif; font-size: small;">internal static&nbsp;readonly object <a href="http://referencesource.microsoft.com/System/R/98190c38929a4cec.html" target="n" data-glyph="44,1">critSec</a>&nbsp;= new object();</span></p>
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>Also, we understand that once the monitor is available then a listener&rsquo;s WriteLine method is called. From the callstack of the thread that entered into the monitor we see that the DefaultListener is used. And, an internal version is called :</p>
<p>&nbsp;</p>
<table style="width: 369px; height: 289px;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="751">
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">void <a href="http://referencesource.microsoft.com/System/R/53951338c412b480.html" target="n">internalWrite</a>(string message) {</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp;if&nbsp;(<a href="http://referencesource.microsoft.com/mscorlib/A.html#0652ef6f5bf8d78b">Debugger</a>.<a href="http://referencesource.microsoft.com/mscorlib/A.html#e6eeef90e8f798db">IsLogging</a>())</span><br /><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp; {</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp;&nbsp;<a href="http://referencesource.microsoft.com/mscorlib/A.html#0652ef6f5bf8d78b">Debugger</a>.<a href="http://referencesource.microsoft.com/mscorlib/A.html#80b9f1768e110e70">Log</a>(0,&nbsp;null, message);</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp; }</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp; else</span><br /><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp; {</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if&nbsp;(message == null)</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<a href="http://referencesource.microsoft.com/System/compmod/microsoft/win32/SafeNativeMethods.cs.html#c04a17371ea26756">SafeNativeMethods</a>.<a href="http://referencesource.microsoft.com/System/compmod/microsoft/win32/SafeNativeMethods.cs.html#8c23d39b5ec5edd6">OutputDebugString</a>(<a href="http://referencesource.microsoft.com/mscorlib/A.html#8281103e6f23cb5c">String</a>.<a href="http://referencesource.microsoft.com/mscorlib/A.html#c9f70a27facb27cf">Empty</a>);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</span></p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<a href="http://referencesource.microsoft.com/System/compmod/microsoft/win32/SafeNativeMethods.cs.html#c04a17371ea26756">SafeNativeMethods</a>.<a href="http://referencesource.microsoft.com/System/compmod/microsoft/win32/SafeNativeMethods.cs.html#8c23d39b5ec5edd6">OutputDebugString</a>(message);</span><br /><span style="font-family: arial,helvetica,sans-serif; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } }</span></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>If there is no debugger attached to the process (we knew that there was no debugger attached to Biztalk server) then OutputDebugString is called. This explains the &ldquo;OutputDebugString&rdquo; in callstack of the waiting threads. Next, we need to understand what the OutputDebugString is waiting on. If we examine the parameters of the WaitForSingleObject we will see that an event called DBWIN_BUFFER_READY ( E.g. \Sessions\&lt;SessionNo&gt;\BaseNamedObjects\DBWIN_BUFFER_READY) for 10 seconds. Now, the problem has &nbsp;changed a bit. Why a string sent to OutputDebugString is processed for so long? Well we know that no debuggers are attached to the Biztalk process. Then what happens to the debug string?</p>
<p>We need to find out how OutputDebugString works. If you search on internet for DBWIN_BUFFER_READY you will find many examples. And, if you still have the Visual Studio 6 SDK which has the DBMon sample (<a href="https://msdn.microsoft.com/en-us/library/aa242171(v=vs.60).aspx">https://msdn.microsoft.com/en-us/library/aa242171(v=vs.60).aspx</a>&nbsp;) then you&rsquo;ll see how that string is consumed.</p>
<p>The string is put to a memory mapped file named &ldquo;DBWIN_BUFFER&rdquo;. Once the string is put an event named &ldquo;DBWIN_DATA_READY&rdquo; is signalled. The party that is waiting on that event will consume that memory mapped file&rsquo;s content. That party is another application which does not have to be a debugger at all. E.g. the DBMon sample application is perfectly capable to consume the debug string. Once the memory mapped file&rsquo;s content is consumed then the DBWIN_DATA_READY is set and another event called &ldquo;DBWIN_BUFFER_READY&rdquo; is signalled. Now, the application that calls OutputDebugString can continue. Meanwhile, if the consumer application cannot process the content within 10 seconds then OutputDebugString returns.</p>
<p>If that is the case and a fair lock is used and there are 100 threads waiting on the Trace.WriteLine function&rsquo;s monitor then the last thread would wait for 10x100 seconds. Roughly 16 min. The experience will &nbsp;ofcourse be a slow system. Just like my customer has felt. Let&rsquo;s move on. Which application it was in our case that acted as the consumer of &nbsp;OutputDebugString? The answer is DebugView. So how come DebugView did process the strings so slowly? The answer is &ldquo;History Depth&rdquo;. This option was not set in DebugView. If not set then all of the previous debug strings are kept. This causes the list view to operate considerably slower if there is a chatty environment in terms of OutputDebugStrings. Hence, if you want to use DebugView then you better set the History Depth.</p>
<p>Have a great day!</p>
<p>faik hakan bilgen</p>]]></content:encoded>
    </item>
    <item>
      <title>Unable to read handle information</title>
      <link>https://docs.microsoft.com/archive/blogs/hmm/unable-to-read-handle-information</link>
      <pubDate>Fri, 15 May 2015 23:24:00 GMT</pubDate>
      <dc:creator><![CDATA[faik hakan bilgen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hmm/2015/05/15/unable-to-read-handle-information/</guid>
      <description><![CDATA[&nbsp;
The easiest way to generate a dump file is using Task Manager. All you have to do is to find...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;</p>
<p>The easiest way to generate a dump file is using Task Manager. All you have to do is to find the correct process</p>
<p>and then right click on it and choose the &ldquo;Create dump file&rdquo; menu item. When you start working on a dump file sooner</p>
<p>or later you might want to check the handles. In that case you receive the following response :</p>
<p>0:000&gt;!handle</p>
<p>ERROR:<br />!handle: extension exception 0x80004002.</p>
<p><span style="color: #ff0000; background-color: #ffffff;">&nbsp;&nbsp;&nbsp; "Unable to read handle information"</span></p>
<p>&nbsp;</p>
<p>Not all dump files have the handle information of a process. There is a way to see whether the handle data is included or not in the dump file.</p>
<p>0:000&gt;.dumpdebug</p>
<p>----- User<br />Mini Dump Analysis</p>
<p>&nbsp;</p>
<p>MINIDUMP_HEADER:</p>
<p>Version&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A793 (6380)</p>
<p>NumberOfStreams 11</p>
<p>Flags&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1826</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0002 MiniDumpWithFullMemory</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="background-color: #ffff00;">0004 MiniDumpWithHandleData</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0020 MiniDumpWithUnloadedModules</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0800 MiniDumpWithFullMemoryInfo</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1000 MiniDumpWithThreadInfo</p>
<p>&nbsp;</p>
<p>Voila! The dump file should have the handle information. For details of different dump types you can check the following references.</p>
<p>&nbsp;</p>
<p><strong>MINIDUMP_TYPE enumeration </strong></p>
<p><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms680519(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/windows/desktop/ms680519(v=vs.85).aspx</a></p>
<p>&nbsp;</p>
<p><strong>MiniDumpWithHandleData </strong></p>
<p><em>Include high-level information about the operating system handles that are active when the minidump is made.</em></p>
<p>&nbsp;</p>
<p>So far so good. However, the reason for not having the handle information is an issue with Task Manager.</p>
<p>With current releases of Windows 10 RC and Windows Server RC editions you can see that Task Manager includes the handle data in the dump files.</p>
<p>Until Windows 10 is RTMed and widespread we can generate dump files with usual ways if we are after the handle information.</p>
<p>&nbsp;</p>
<p>HTH</p>
<p>-faik</p>]]></content:encoded>
    </item>
    <item>
      <title>Dump Dosyası İncelemeye Giriş</title>
      <link>https://docs.microsoft.com/archive/blogs/hmm/dump-dosyas-ncelemeye-giri</link>
      <pubDate>Fri, 15 May 2015 03:30:40 GMT</pubDate>
      <dc:creator><![CDATA[faik hakan bilgen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hmm/2015/05/15/dump-dosyas-ncelemeye-giri/</guid>
      <description><![CDATA[Merhaba,Uzun bir aradan sonra debugging ile ilgili serime devam ediyorum. Artık dump dosyalarını...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: times new roman,times; font-size: small;">Merhaba,</span><br /><span style="font-family: times new roman,times; font-size: small;">Uzun bir aradan sonra debugging ile ilgili serime devam ediyorum. Artık dump dosyalarını nasıl inceleyeceğimize ge&ccedil;eceğiz. <a title="Dump Alma ( Hang Mode - I )" href="http://blogs.msdn.com/b/hmm/archive/2015/05/15/dump-alma-hang-mode-i.aspx">Dump Alma ( Hang Mode - I )</a>&nbsp;yazımdaki y&ouml;ntemle yanıt vermeyen bir uygulamanın dump'ını aldığınızı farz ediyorum. </span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Start &ndash;&gt; All Programs &ndash;&gt; Debugging Tools for Windows(x86) &ndash;&gt; WinDbg uygulamasını a&ccedil;ın.<br />File men&uuml;s&uuml;nden &ldquo;Open Crash Dump&rdquo; se&ccedil;eneğini tıklayın. A&ccedil;ılan gezgin penceresinden daha &ouml;nce oluşturduğunuz dmp uzantılı dosyayı bulun ve a&ccedil;ın.<br />&ldquo;Save information for workspace&rdquo; sorusunu her zaman hayır olarak yanıtlayın.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Biraz bekledikten sonra aşağıdaki gibi bir &ccedil;ıktı alacaksınız :</span></p>
<p><span style="font-family: times new roman,times; font-size: small;"><strong>Debugger&rsquo;ın Versiyon bilgisi :</strong><br /><em>Microsoft (R) Windows Debugger Version 6.13.0003.956 X86<br />Copyright (c) Microsoft Corporation. All rights reserved.</em></span></p>
<p><span style="font-family: times new roman,times; font-size: small;"><strong>Y&uuml;klenen dump dosyasının yeri ve adı :</strong><br /><em>Loading Dump File [H:\BLOG\dumps\20101229_112225_Hang_Mode\FULLDUMP_HangMode_UITest.exe__061c_2010-12-29_11-22-28-575_158c.dmp]</em></span></p>
<p><span style="font-family: times new roman,times; font-size: small;"><strong>Dump dosyasının tipi :</strong><br /><em>User Mini Dump File with Full Memory: Only application data is available<br />Comment: 'HangMode'</em></span></p>
<p><span style="font-family: times new roman,times; font-size: small;"><strong>Sembol bilgileri :</strong><br /><em>Symbol search path is: *** Invalid ***<br />****************************************************************************<br />* Symbol loading may be unreliable without a symbol search path.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *<br />* Use .symfix to have the debugger choose a symbol path.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *<br />* After setting your symbol path, use .reload to refresh symbol locations. *<br />****************************************************************************<br />Executable search path is:</em> </span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Debugging, doğru sembol dosyaları olmadan &ccedil;ok zor yapılabilir &ccedil;&uuml;nk&uuml;; nerdeyse herşeyi disassemble edilmiş koddan bulmaya &ccedil;alışırsınız.<br />Aşağıdaki b&ouml;l&uuml;mlerde konuyu daha fazla ele alacağım. Şu kadarını hatırlamanız yeterli : Sembol dosyası olmadan debugging yapılmaz.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;"><strong>Dump&rsquo;ın alındığı makina ve sistem bilgileri :<br /></strong><em>Windows 7 Version 7600 MP (2 procs) Free x86 compatible<br />Product: Server, suite: Enterprise TerminalServer SingleUserTS<br />Built by: 6.1.7600.16385 (win7_rtm.090713-1255)<br />Machine Name:<br />Debug session time: Wed Dec 29 11:22:28.000 2010 (UTC + 2:00)<br />System Uptime: 6 days 18:34:10.924<br />Process Uptime: 0 days 0:40:35.000</em></span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Bu bilgiler işinize yarayabilir. İşletim Sisteminin s&uuml;r&uuml;m&uuml;, makina adı, dump'ın ne zaman alındığı. Bu bilgileri kullanarak Sistem ve Uygulama g&uuml;nl&uuml;klerini kontrol edebilirsiniz. <br />Yakın zamanda herhangi bir problem olup olmadığını denetleyebilirsiniz. Sistem ve Proses'in ne kadar zamandır &ccedil;alıştığı da bir fikir verebilir. Sorunun sıklığına dair fikir edinebilirsiniz.<br /></span></p>
<p><span style="font-family: times new roman,times; font-size: small;"><strong>Sembol uyarıları ve exception bilgisi :</strong></span></p>
<p><span style="font-family: times new roman,times; font-size: small;"><em>*** ERROR: Symbol file could not be found.&nbsp; Defaulted to export symbols for ntdll.dll - <br />This dump file has an exception of interest stored in it.<br />The stored exception information can be accessed via .ecxr.<br />(158c.14f8): Wake debugger - code 80000007 (first/second chance not available)</em></span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Debugger (invasive moddayken) process'te bir thread yaratır ve DebugBreak fonksiyonunu &ccedil;ağırır. Bu da process'in<br />breakpoint exception'ı vermesine sebep olur. Dolayısıyla hang modda alınmış dump dosyalarında 0x80000007 numaralı olayın olması normal.<br /></span></p>
<p><span style="font-family: times new roman,times; font-size: small;"><strong>Şu anda debugger context&rsquo;inin set edildiği thread&rsquo;in register bilgileri :</strong></span></p>
<p><span style="font-family: times new roman,times; font-size: small;"><em>eax=00000000 ebx=0022f2bc ecx=00000000 edx=00000000 esi=00000002 edi=00000000<br />eip=77b300ed esp=0022f26c ebp=0022f308 iopl=0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nv up ei pl nz na po nc<br />cs=0023&nbsp; ss=002b&nbsp; ds=002b&nbsp; es=002b&nbsp; fs=0053&nbsp; gs=002b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; efl=00000202<br />ntdll!NtWaitForMultipleObjects+0x15:<br />77b300ed 83c404&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; add&nbsp;&nbsp;&nbsp;&nbsp; esp,4</em></span></p>
<p><span style="font-family: times new roman,times; font-size: small;">WinDbg ekranının sol alt k&ouml;şesinde "0:000&gt;" ibaresini g&ouml;receksiniz. Aslında bu ProcessID:ThreadID ikilisini g&ouml;sterir. User mode dumplarda ProcessID hep 0 olacaktır.<br />Dolayısıyla g&ouml;rd&uuml;ğ&uuml;n&uuml;z "0:000", bu process'in 0 numaralı thread'inde olduğunuzu ifade eder. Kernel dumplarında Process Context'ini değiştirebilirsiniz. <br />ProcessID:ThreadID metin kutusunun sağında yer alan metin edit&ouml;r kontrol&uuml;n&uuml; kullanarak WinDbg'ye istediğimiz komutları yollayacağız.</span></p>
<p>&nbsp;<img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/05/15/metablogapi/1351.WindbgOverview_4.png" original-url="http://blogs.msdn.com/cfs-filesystemfile.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-05-15-metablogapi/1351.WindbgOverview_5F00_4.png" alt="" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong><span style="font-family: times new roman,times; font-size: medium;">İlk komutlar</span></strong></p>
<p><span style="font-family: times new roman,times; font-size: x-small;"><br /><span style="font-size: small;"><strong>Dumpı alınmış process'in ka&ccedil; tane thread'i olduğuna bakalım. </strong></span><br /><span style="font-size: small;">0:000&gt; yazan kısımın sağ tarfındaki textbox'ı kullanacağız.</span><br /><span style="font-size: small;">~ yazın ve enter'a basın</span><br /><span style="font-size: small;">Aşağıdakine benzer bir &ccedil;ıktı alacaksınız.</span></span></p>
<p><span style="font-family: times new roman,times; font-size: small;">0:000&gt; ~<br />.&nbsp; 0&nbsp; Id: 158c.14f8 Suspend: 1 Teb: 7efdd000 Unfrozen<br />&nbsp;&nbsp; 1&nbsp; Id: 158c.104c Suspend: 1 Teb: 7efda000 Unfrozen<br />&nbsp;&nbsp; 2&nbsp; Id: 158c.a1c Suspend: 1 Teb: 7efd7000 Unfrozen</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Bu &ccedil;ıktı bize process i&ccedil;inde 3 thread olduğunu g&ouml;steriyor : 0, 1 ve 2. threadler. Windbg, thread'leri 0 dan başlayarak numaralandırır. Ayrıca, ger&ccedil;ek numaralarını da g&ouml;sterir.<br />&Ouml;rneğin, 158c.14f8 bize thread'in 158c ProcessID'li process'in 14f8 numaralı thread'i olduğunu anlatıyor. Teb: 7efdd000 ise TEB veri yapısının adresini g&ouml;sterir.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;"><a title="CreateThread Function" href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms682453(v=vs.85).aspx">CreateThread Function</a>&nbsp;, <a title="TEB Structure" href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms686708(v=vs.85).aspx">TEB Structure</a>&nbsp;</span></p>
<p><span style="font-family: times new roman,times; font-size: small;"></span></p>
<p><span style="font-family: times new roman,times; font-size: small;"><strong>Bir thread'in call stack'ini listelemek<br /></strong>Bu kez komut penceresine ( ProcessID:ThreadID metin kutusunun sağında yer alan metin edit&ouml;r kontrol&uuml; ) k komutunu girip enter'a basın.<br />Aşağıdakine benzer bir &ccedil;ıktı ile karşılaşacaksınız.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">0:000&gt; k<br />ChildEBP RetAddr&nbsp; <br /><span style="color: #000000; background-color: #ffff00;">WARNING: Stack unwind information not available. Following frames may be wrong.</span><br />0022f308 7614162d ntdll!NtWaitForMultipleObjects+0x15<br />0022f350 76141921 kernel32!WaitForMultipleObjectsEx+0x8e<br />0022f36c 65aa10e2 kernel32!WaitForMultipleObjects+0x18<br />0022f3b0 00d41b1d Senaryolar!DeadLockDurumuYarat+0x82<br />0022f3bc 61e42c6f UITest+0x1b1d<br />0022f3c8 61e42e51 mfc100u+0x1b2c6f<br />0022f3e4 61e76d36 mfc100u+0x1b2e51<br />0022f408 61ecc444 mfc100u+0x1e6d36<br />0022f458 61d0cceb mfc100u+0x23c444<br />0022f46c 61ecbc47 mfc100u+0x7cceb<br />0022f538 61ecbbba mfc100u+0x23bc47<br />0022f558 61eca019 mfc100u+0x23bbba<br />0022f5d0 61eca2a5 mfc100u+0x23a019<br />0022f5f4 61dc0ddb mfc100u+0x23a2a5<br />0022f63c 774a6238 mfc100u+0x130ddb<br />0022f668 774a68ea user32!gapfnScSendMessage+0x270<br />0022f6e0 774acd1a user32!gapfnScSendMessage+0x922<br />0022f724 774acd81 user32!GetWindow+0x21a<br />0022f748 74354e95 user32!SendMessageW+0x4c<br />0022f768 74354ef7 comctl32!GetEffectiveClientRect+0x306c<br />0022f784 74354d89 comctl32!GetEffectiveClientRect+0x30ce<br />0022f7e4 774a6238 comctl32!GetEffectiveClientRect+0x2f60<br />0022f810 774a68ea user32!gapfnScSendMessage+0x270<br />0022f888 774a7d31 user32!gapfnScSendMessage+0x922<br />0022f8e8 774a7dfa user32!LoadStringW+0x11f<br />0022f8f8 774c2292 user32!DispatchMessageW+0xf<br />0022f924 61ee0ac0 user32!IsDialogMessageW+0x11e<br />0022f938 61eced28 mfc100u+0x250ac0<br />0022f944 61e6c3ad mfc100u+0x23ed28<br />0022f99c 61d0cc9c mfc100u+0x1dc3ad<br />0022f9ac 61eccec5 mfc100u+0x7cc9c<br />0022f9c0 61eb8a28 mfc100u+0x23cec5<br />0022f9d8 61eb922d mfc100u+0x228a28<br />0022f9e4 61eb8a78 mfc100u+0x22922d<br />0022f9f0 61eb895d mfc100u+0x228a78<br />0022fa2c 61e6cae3 mfc100u+0x22895d<br />0022fa78 00d41197 mfc100u+0x1dcae3<br />0022fbfc 61ede3c3 UITest+0x1197<br />0022fc10 00d42425 mfc100u+0x24e3c3<br />0022fca4 76143677 UITest+0x2425<br />0022fcb0 77b49d42 kernel32!BaseThreadInitThunk+0x12<br />0022fcf0 77b49d15 ntdll!RtlInitializeExceptionChain+0x63<br />0022fd08 00000000 ntdll!RtlInitializeExceptionChain+0x36</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Dikkat edilmesi gerekenler :<br />"WARNING: Stack unwind information not available. Following frames may be wrong." mesajı bize debugger'ın sembol dosyalarını bulamadığını o y&uuml;zden <br />callstack'i d&uuml;zg&uuml;n &ccedil;ıkaramadığını s&ouml;yl&uuml;yor.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;"><strong>Sembol dosyalarına erişmek :</strong></span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Debugger'ın, sembol dosyalarına erişimini anlatan temel makaleyi okuyabilirsiniz :<br /><a href="http://support.microsoft.com/kb/311503" target="_blank">Use the Microsoft Symbol Server to obtain debug symbol files</a><br /></span></p>
<p><span style="font-family: times new roman,times; font-size: small;"><strong>Adım adım ayarların yapılması :<br /></strong>#1 Bilgisayarınızda bir dizin a&ccedil;ın. Bu dizin debugger'ın indirdiği sembol dosyalarını tutacaktır.<br />&Ouml;rneğin : <br />H:\BLOG\symbols</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">#2 Windbg'de "File" men&uuml;s&uuml;nden "Symbol File Path" se&ccedil;eneğini tıklayın. A&ccedil;ılan pencere i&ccedil;ine aşağıdakileri girin :<br />SRV*H:\BLOG\symbols*http://msdl.microsoft.com/download/symbols</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Not : Sizin lokal sembol cache dizininiz farklı olabilir. Bu durumda "H:\BLOG\symbols" yerine o dizini girin.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">#3 "Reload" checkbox'ını işaretleyin ve "OK" butonuna basın.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Şimdi k komutunu tekrar &ccedil;alıştırın. Bu kez olduk&ccedil;a farklı bir callstack g&ouml;receksiniz :</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">0:000&gt; k<br />ChildEBP RetAddr&nbsp; <br />0022f26c 75b30962 ntdll!ZwWaitForMultipleObjects+0x15<br />0022f308 7614162d KERNELBASE!WaitForMultipleObjectsEx+0x100<br />0022f350 76141921 kernel32!WaitForMultipleObjectsExImplementation+0xe0<br /><span style="background-color: #ffff00;">*** ERROR: Symbol file could not be found.&nbsp; Defaulted to export symbols for Senaryolar.dll - <br /></span>0022f36c 65aa10e2 kernel32!WaitForMultipleObjects+0x18<br /><span style="background-color: #ffff00;">*** ERROR: Module load completed but symbols could not be loaded for UITest.exe<br />WARNING: Stack unwind information not available. Following frames may be wrong.<br /></span>0022f3b0 00d41b1d Senaryolar!DeadLockDurumuYarat+0x82<br />0022f3bc 61e42c6f UITest+0x1b1d<br />0022f3c8 61e42e51 mfc100u!_AfxDispatchCmdMsg+0x3b [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\cmdtarg.cpp @ 82]<br />0022f3e4 61e76d36 mfc100u!CCmdTarget::OnCmdMsg+0x124 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\cmdtarg.cpp @ 381]<br />0022f408 61ecc444 mfc100u!CPropertySheet::OnCmdMsg+0x1d [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\dlgprop.cpp @ 814]<br />0022f458 61d0cceb mfc100u!CWnd::OnCommand+0x92 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 2675]<br />0022f46c 61ecbc47 mfc100u!CDialogEx::OnCommand+0x2f [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\afxdialogex.cpp @ 290]<br />0022f538 61ecbbba mfc100u!CWnd::OnWndMsg+0x66 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 2081]<br />0022f558 61eca019 mfc100u!CWnd::WindowProc+0x24 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 2067]<br />0022f5d0 61eca2a5 mfc100u!AfxCallWndProc+0xb5 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 248]<br />0022f5f4 61dc0ddb mfc100u!AfxWndProc+0x37 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 410]<br />0022f634 774a6901 mfc100u!AfxWndProcBase+0x56 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\afxstate.cpp @ 420]<br />0022f6e0 774acd1a user32!UserCallWinProcCheckWow+0x120<br />0022f724 774acd81 user32!SendMessageWorker+0x581<br />0022f748 74354e95 user32!SendMessageW+0x7f<br />0022f768 74354ef7 comctl32!Button_NotifyParent+0x3d<br />0022f784 74354d89 comctl32!Button_ReleaseCapture+0x113<br />0022f7e4 774a6238 comctl32!Button_WndProc+0xa18<br />0022f810 774a68ea user32!InternalCallWinProc+0x23<br />0022f888 774a7d31 user32!UserCallWinProcCheckWow+0x109<br />0022f8e8 774a7dfa user32!DispatchMessageWorker+0x3bc<br />0022f8f8 774c2292 user32!DispatchMessageW+0xf<br />0022f924 61ee0ac0 user32!IsDialogMessageW+0x5f6<br />0022f938 61eced28 mfc100u!CWnd::IsDialogMessageW+0x32 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\winocc.cpp @ 197]<br />0022f944 61e6c3ad mfc100u!CWnd::PreTranslateInput+0x2d [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 4659]<br />0022f99c 61d0cc9c mfc100u!CDialog::PreTranslateMessage+0xcf [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\dlgcore.cpp @ 82]<br />0022f9ac 61eccec5 mfc100u!CDialogEx::PreTranslateMessage+0x29 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\afxdialogex.cpp @ 275]<br />0022f9c0 61eb8a28 mfc100u!CWnd::WalkPreTranslateTree+0x23 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 3258]<br />0022f9d8 61eb922d mfc100u!AfxInternalPreTranslateMessage+0x41 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 233]<br />0022f9e4 61eb8a78 mfc100u!CWinThread::PreTranslateMessage+0xd [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 777]<br />0022f9f0 61eb895d mfc100u!AfxPreTranslateMessage+0x19 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 255]<br />0022fa00 61ecedfd mfc100u!AfxInternalPumpMessage+0x2d [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 178]<br />0022fa2c 61e6cae3 mfc100u!CWnd::RunModalLoop+0xc8 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 4714]<br />0022fa78 00d41197 mfc100u!CDialog::DoModal+0x12d [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\dlgcore.cpp @ 638]<br />0022fbfc 61ede3c3 UITest+0x1197<br />0022fc10 00d42425 mfc100u!AfxWinMain+0x49 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\winmain.cpp @ 37]<br />0022fca4 76143677 UITest+0x2425<br />0022fcb0 77b49d42 kernel32!BaseThreadInitThunk+0xe<br />0022fcf0 77b49d15 ntdll!__RtlUserThreadStart+0x70<br />0022fd08 00000000 ntdll!_RtlUserThreadStart+0x1b</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">1. adımda a&ccedil;tığınız dizine bakarsanız bir &ccedil;ok alt dizinle dolduğunu g&ouml;receksiniz.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">H:\BLOG\symbols&gt;dir<br />Volume in drive H is TOSHIBA<br />Volume Serial Number is 4504-0DA4</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Directory of H:\BLOG\symbols</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">29.12.2010&nbsp; 16:50&nbsp;&nbsp;&nbsp; &lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<br />29.12.2010&nbsp; 16:50&nbsp;&nbsp;&nbsp; &lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ..<br />29.12.2010&nbsp; 16:53&nbsp;&nbsp;&nbsp; &lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wntdll.pdb<br />29.12.2010&nbsp; 16:53&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 pingme.txt<br />29.12.2010&nbsp; 16:53&nbsp;&nbsp;&nbsp; &lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wkernelbase.pdb<br />29.12.2010&nbsp; 16:54&nbsp;&nbsp;&nbsp; &lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wkernel32.pdb<br />29.12.2010&nbsp; 16:54&nbsp;&nbsp;&nbsp; &lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mfc100u.i386.pdb<br />29.12.2010&nbsp; 16:54&nbsp;&nbsp;&nbsp; &lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wuser32.pdb<br />29.12.2010&nbsp; 16:54&nbsp;&nbsp;&nbsp; &lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; comctl32.pdb<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 File(s)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 bytes<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8 Dir(s)&nbsp; 11.803.426.816 bytes free</span></p>
<p><span style="font-family: times new roman,times; font-size: small;"><br />Yukarıdaki callstack'e baktığınızda debugger'ın, UITest.exe ve senaryolar.dll mod&uuml;llerinin sembol dosyalarını bulamadığını g&ouml;r&uuml;yoruz. Aslında, işletim sistemi ile gelen ve Microsoft'tan satın alınmış &uuml;r&uuml;nlerin sembol dosyaları indirilecektir. Sizin, debugger'a diğer mod&uuml;llerin sembol dosyalarını nereden bulabileceğini belirtmeniz gerekir. Bunun i&ccedil;in yine Windbg'de, "File" men&uuml;s&uuml;nden "Symbol File Path" se&ccedil;eneğini tıklayın. Varolan ifadenin sonuna noltalı virg&uuml;l ekleyin ve sembol dosyalarının bulunduğu dizini girin. &Ouml;rneğin, benim i&ccedil;in bu :<br />H:\BLOG\DebugSenaryolari\Release dizini. Ve, sembol path ifadem de aşağıdaki gibi olacaktır : SRV*H:\BLOG\symbols*http://msdl.microsoft.com/download/symbols;H:\BLOG\DebugSenaryolari\Release&nbsp;</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">"Reload" checkbox'ını işaretleyin ve "OK" butonuna basın. Bir kez daha k komutunu &ccedil;alıştırın. Bu kez t&uuml;m mod&uuml;llerin sembol dosyasına ulaşılmış olunmalı :</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">0:000&gt; k<br />ChildEBP RetAddr&nbsp; <br />0022f26c 75b30962 ntdll!ZwWaitForMultipleObjects+0x15<br />0022f308 7614162d KERNELBASE!WaitForMultipleObjectsEx+0x100<br />0022f350 76141921 kernel32!WaitForMultipleObjectsExImplementation+0xe0<br />0022f36c 65aa10e2 kernel32!WaitForMultipleObjects+0x18<br />0022f3b0 00d41b1d Senaryolar!DeadLockDurumuYarat+0x82 [d:\work\blog\debugsenaryolari\senaryolar\aski.cpp @ 40]<br />0022f3bc 61e42c6f UITest!CUITestDlg::OnBnClickedButtonDeadlock+0xd [d:\work\blog\debugsenaryolari\uitest\uitestdlg.cpp @ 168]<br />0022f3c8 61e42e51 mfc100u!_AfxDispatchCmdMsg+0x3b [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\cmdtarg.cpp @ 82]<br />0022f3e4 61e76d36 mfc100u!CCmdTarget::OnCmdMsg+0x124 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\cmdtarg.cpp @ 381]<br />0022f408 61ecc444 mfc100u!CPropertySheet::OnCmdMsg+0x1d [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\dlgprop.cpp @ 814]<br />0022f458 61d0cceb mfc100u!CWnd::OnCommand+0x92 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 2675]<br />0022f46c 61ecbc47 mfc100u!CDialogEx::OnCommand+0x2f [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\afxdialogex.cpp @ 290]<br />0022f538 61ecbbba mfc100u!CWnd::OnWndMsg+0x66 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 2081]<br />0022f558 61eca019 mfc100u!CWnd::WindowProc+0x24 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 2067]<br />0022f5d0 61eca2a5 mfc100u!AfxCallWndProc+0xb5 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 248]<br />0022f5f4 61dc0ddb mfc100u!AfxWndProc+0x37 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 410]<br />0022f634 774a6901 mfc100u!AfxWndProcBase+0x56 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\afxstate.cpp @ 420]<br />0022f6e0 774acd1a user32!UserCallWinProcCheckWow+0x120<br />0022f724 774acd81 user32!SendMessageWorker+0x581<br />0022f748 74354e95 user32!SendMessageW+0x7f<br />0022f768 74354ef7 comctl32!Button_NotifyParent+0x3d<br />0022f784 74354d89 comctl32!Button_ReleaseCapture+0x113<br />0022f7e4 774a6238 comctl32!Button_WndProc+0xa18<br />0022f810 774a68ea user32!InternalCallWinProc+0x23<br />0022f888 774a7d31 user32!UserCallWinProcCheckWow+0x109<br />0022f8e8 774a7dfa user32!DispatchMessageWorker+0x3bc<br />0022f8f8 774c2292 user32!DispatchMessageW+0xf<br />0022f924 61ee0ac0 user32!IsDialogMessageW+0x5f6<br />0022f938 61eced28 mfc100u!CWnd::IsDialogMessageW+0x32 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\winocc.cpp @ 197]<br />0022f944 61e6c3ad mfc100u!CWnd::PreTranslateInput+0x2d [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 4659]<br />0022f99c 61d0cc9c mfc100u!CDialog::PreTranslateMessage+0xcf [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\dlgcore.cpp @ 82]<br />0022f9ac 61eccec5 mfc100u!CDialogEx::PreTranslateMessage+0x29 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\afxdialogex.cpp @ 275]<br />0022f9c0 61eb8a28 mfc100u!CWnd::WalkPreTranslateTree+0x23 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 3258]<br />0022f9d8 61eb922d mfc100u!AfxInternalPreTranslateMessage+0x41 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 233]<br />0022f9e4 61eb8a78 mfc100u!CWinThread::PreTranslateMessage+0xd [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 777]<br />0022f9f0 61eb895d mfc100u!AfxPreTranslateMessage+0x19 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 255]<br />0022fa00 61ecedfd mfc100u!AfxInternalPumpMessage+0x2d [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 178]<br />0022fa2c 61e6cae3 mfc100u!CWnd::RunModalLoop+0xc8 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 4714]<br />0022fa78 00d41197 mfc100u!CDialog::DoModal+0x12d [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\dlgcore.cpp @ 638]<br />0022fbfc 61ede3c3 UITest!CUITestApp::InitInstance+0xf7 [d:\work\blog\debugsenaryolari\uitest\uitest.cpp @ 72]<br />0022fc10 00d42425 mfc100u!AfxWinMain+0x49 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\winmain.cpp @ 37]<br />0022fca4 76143677 UITest!__tmainCRTStartup+0x158 [f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c @ 547]<br />0022fcb0 77b49d42 kernel32!BaseThreadInitThunk+0xe<br />0022fcf0 77b49d15 ntdll!__RtlUserThreadStart+0x70<br />0022fd08 00000000 ntdll!_RtlUserThreadStart+0x1b</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Yazıyı fazla uzatmadan tadında bırakalım. Gelecek yazılarımda sembol dosyaları ve sembol ayarları konusunu detaylandıracağım.<br />Bu arada debugging ile ilgili internette bir &ccedil;ok kaynak mevcut. Ancak, en temel ve yaralı kaynak "Debugging Tools for Windows"un help uygulamasıdır.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Hoş&ccedil;akalın<br />-faik<br /></span></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Ani Ölümler ve IFEO</title>
      <link>https://docs.microsoft.com/archive/blogs/hmm/ani-lmler-ve-ifeo</link>
      <pubDate>Fri, 15 May 2015 03:02:47 GMT</pubDate>
      <dc:creator><![CDATA[faik hakan bilgen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hmm/2015/05/15/ani-lmler-ve-ifeo/</guid>
      <description><![CDATA[Merhaba,Bug&uuml;n uygulamaların ani &ouml;l&uuml;mleri ile ilgileneceğiz. İngilizcesi,...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: times new roman,times; font-size: small;">Merhaba,</span><br /><span style="font-family: times new roman,times; font-size: small;">Bug&uuml;n uygulamaların ani &ouml;l&uuml;mleri ile ilgileneceğiz. İngilizcesi, &ldquo;Sudden death&rdquo;. Uygulamanın &ccedil;alışmaya başlar başlamaz kapanması anlamına geliyor. </span><span style="font-family: times new roman,times; font-size: small;">Bug&uuml;ne kadar karşılaşmış olabilirsiniz. Uygulamaya &ccedil;ift tıklarsınız ancak uygulama a&ccedil;ılmaz veya &ccedil;ok kısa bir s&uuml;re g&ouml;r&uuml;n&uuml;r ve kapanır </span><br /><span style="font-family: times new roman,times; font-size: small;">veya SCM (Service Control Manager) i&ccedil;inden bir servisi başlatırsınız ancak &ldquo;service terminated unexpectedly&rdquo; gibi bir hata alıyorsunuz </span><span style="font-family: times new roman,times; font-size: small;">veya servisin hi&ccedil; başlamadığını g&ouml;r&uuml;yorsunuz. Uygulama loglarına baktığınızda aşağıdaki gibi kayıtlarla karşılaşabilirsiniz :</span></p>
<p>&nbsp;</p>
<table style="width: 502px; height: 222px;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="438"><span style="font-family: times new roman,times; font-size: small;">Log Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Application<br />Source:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Application Error<br />Date:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 13.05.2010 17:14:09<br />Event ID:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1000<br />Task Category: (100)<br />Level:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Error<br />Keywords:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Classic<br />User:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N/A<br />Computer:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bilgisayar_adı<br />Description:<br />Faulting application name: Ani&Ouml;l&uuml;m.exe, version: 1.0.0.1, time stamp: 0x4bebdf34<br />Faulting module name: Ani&Ouml;l&uuml;m.exe, version: 1.0.0.1, time stamp: 0x4bebdf34<br />Exception code: 0xc0000005</span></td>
</tr>
</tbody>
</table>
<p><span><span style="font-size: x-small;">&nbsp;</span></span></p>
<table style="width: 503px; height: 207px;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="441"><span style="font-family: times new roman,times; font-size: small;">Log Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Application<br />Source:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Windows Error Reporting<br />Date:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 13.05.2010 17:14:13<br />Event ID:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1001<br />Task Category: None<br />Level:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Information<br />Keywords:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Classic<br />User:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N/A<br />Computer:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bilgisayar_adı<br />Description:<br />Fault bucket 1859722586, type 1<br />Event Name: APPCRASH<br />Response: Not available</span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;">&ldquo;Ani &ouml;l&uuml;m&rdquo; durumundaki sorun da tam olarak bu esasında. Uygulama &ccedil;alışmaya başladıktan bir s&uuml;re sonra hata alıp kapansaydı ge&ccedil;en yazıdaki adımları uygulayabilirdik. Ancak, <span style="text-decoration: underline;">&ldquo;ani &ouml;l&uuml;mlerde&rdquo; debugger&rsquo;ı uygulamaya bağlayacak kadar dahi zaman olmaz</span>. </span></p>
<p><span style="font-family: times new roman,times; font-size: small;">&Ccedil;&ouml;z&uuml;m : <strong>IFEO ( Image File Execution Options )</strong>, <br />HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">İşletim Sistemi, bir uygulamayı &ccedil;alıştırırken bu <strong>Kayıt Defteri Anahtarını (KDA = registry key)</strong> muhakkak okur ve &ccedil;alıştıracağı uygulama ile aynı adlı bir subkey olup olmadığını kontrol eder. Varsa eğer bu key&rsquo;e ait kayıt defteri değerlerini (registry values) sorgular ve ona g&ouml;re aksiyon alır. &Ouml;rneğin, debugger değeri i&ccedil;inde yer alan uygulama &ccedil;alıştırılır.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;"></span></p>
<table style="width: 738px;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="736"><span style="font-family: times new roman,times; font-size: small;"><em>Meraklısına Not :<br />İşletim Sistemi&rsquo;nin bir programı &ccedil;alıştırırken hangi KDA&rsquo;ları okuduğunu g&ouml;zlemleyebilirsiniz. ProcessMonitor (ProcMon) adlı ara&ccedil; sistemdeki faaliyetlerin bir kısmını takip eder (dosya, network, kayıt defteri erişimi, process/thread faaliyetleri). ProcMon&rsquo;u aşağıdaki adresten indirip kurabilirsiniz :<br /></em><a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx"><em>http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx</em></a></span><br /><span style="font-family: times new roman,times; font-size: small;"><em>#1 ProcMon&rsquo;u &ccedil;alıştırın<br />#2 Herhangi bir uygulamayı &ccedil;alıştırın, &ouml;rneğin notepad.exe<br />#3 Notepad.exe &ccedil;alışmaya başladıktan sonra ProcMon&rsquo;un trace almasını durdurun.<br />#4 Sonu&ccedil;ları a&ccedil;tığınız uygulamaya g&ouml;re filtreleyin ( ProcessName is equal Notepad.exe )<br />#5 Filtrelenmiş sonu&ccedil;ta erişilen dosya ve kayıt defteri kaynaklarını g&ouml;rebelirsiniz.</em> </span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;">Yazının sonunda test i&ccedil;in kullanabileceğiniz k&uuml;&ccedil;&uuml;k bir uygulama var : &ldquo;Ani&Ouml;l&uuml;m.exe&rdquo;yi Ani&Ouml;l&uuml;m.zip adlı sıkıştırılmış dosyanın i&ccedil;inde bulabilirsiniz. VC &Ccedil;alışma Zamanı K&uuml;t&uuml;phaneleri ile ilgili bir sorunla karşılaşırsanız <a href="http://blogs.msdn.com/b/hmm/archive/2015/05/15/dump-alma-hang-mode-i.aspx">http://blogs.msdn.com/b/hmm/archive/2015/05/15/dump-alma-hang-mode-i.aspx</a>&nbsp;<br />adresindeki yazıma g&ouml;z atabilirsiniz. </span><span style="font-family: times new roman,times; font-size: small;"><span style="font-family: Tahoma; font-size: x-small;"><br /><br /></span></span><span style="font-family: times new roman,times; font-size: small;"><strong>Deneme </strong><br />#1 Uygulamayı bir dizine kopyalayın ve &uuml;zerine &ccedil;ift tıklayın. <br />#2 Explorer i&ccedil;indeyken imle&ccedil; beklemeyi g&ouml;steren animasyonu başlatacak, sonra imle&ccedil; normale d&ouml;necek. Bu arada uygulama a&ccedil;ılmayacak. <br />#3 G&ouml;rev Y&ouml;neticisini a&ccedil;ın, processes sekmesine gelin, ve isme g&ouml;re uygulamaları sıralatın. <br />#4 Ani&Ouml;l&uuml;m.exe&rsquo;yi tekrar &ccedil;alıştırın, kısa bir s&uuml;reliğine G&ouml;rev Y&ouml;neticisinde Ani&Ouml;l&uuml;m.exe&rsquo;yi g&ouml;rebilirsiniz. Veya, yukarıda bahsettiğim ProcMon <br />aracıyla Ani&Ouml;l&uuml;m.exe&rsquo;ye ait işlemleri g&ouml;rebilirsiniz.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;"><strong>Image File Execution Options ve dump almayı hazırlanma</strong></span></p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;">#1 &ldquo;C:\Program Files\Debugging Tools for Windows (x86)&rdquo; dizinine DumpAO.bat isimli bir dosya a&ccedil;ın.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">#2 Dosyanın i&ccedil;ine aşağıdaki satırı kopyalayın :</span><br /><span style="font-family: times new roman,times; font-size: small;">cscript.exe "C:\Program Files\Debugging Tools for Windows (x86)\adplus.vbs" -crash -o c:\dumps -quiet -sc %1 </span></p>
<p><span style="font-family: times new roman,times; font-size: small;">#3 Registry Editor&rsquo;&uuml; a&ccedil;ın (regedt32.exe)</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">#4 Aşağıdaki KDA&rsquo;yı bulun :</span><br /><span style="font-family: times new roman,times; font-size: small;">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">#5 Bu anahtarın altına adı &ldquo;Ani&Ouml;l&uuml;m.exe&rdquo; olan yeni bir alt anahtar yaratın.</span><br /><span style="font-family: times new roman,times; font-size: small;">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Ani&Ouml;l&uuml;m.exe</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">#6 Ani&Ouml;l&uuml;m.exe adlı anahtarın altına yeni bir kayıt defteri değeri tanımlayın. Bu yeni değerin adı debugger, tipi string, i&ccedil;eriği de </span><br /><span style="font-family: times new roman,times; font-size: small;">"C:\Program Files\Debugging Tools for Windows (x86)\DumpAO.bat" olacak. &Ccedil;ift tırnaklar dahil.</span><br /><br /><span style="font-family: times new roman,times; font-size: small;">Key Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Ani&Ouml;l&uuml;m.exe</span><br /><span style="font-family: times new roman,times; font-size: small;">&nbsp; Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; debugger</span><br /><span style="font-family: times new roman,times; font-size: small;">&nbsp; Type:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; REG_SZ</span><br /><span style="font-family: times new roman,times; font-size: small;">&nbsp; Data:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "C:\Program Files\Debugging Tools for Windows (x86)\DumpAO.bat"</span></p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;">Artık Ani&Ouml;l&uuml;m.exe uygulamasını her &ccedil;alıştırdığınızda cdb.exe de &ccedil;alışacak ve Ani&Ouml;l&uuml;m.exe her exception &uuml;rettiğinde c:\dumps dizini altına dump dosyası &uuml;retecek. Şimdi bunun denemesini yapalım. Ani&Ouml;l&uuml;m.exe uygulamasını &ccedil;alıştırın ve c:\dumps dizininin i&ccedil;ine bakın. Aşağıdaki dosyaları g&ouml;rmeniz gerekir (sizde dosya isimleri farklı ama aynı formatta olacaktır).</span></p>
<p>&nbsp;</p>
<table style="width: 647px;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="645">
<p><span style="font-family: times new roman,times; font-size: small;">C:\dumps&gt;dir /s<br /> Volume in drive C has no label.<br /> Volume Serial Number is 2073-7A27</span></p>
<p><span style="font-family: times new roman,times; font-size: small;"> Directory of C:\dumps</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">13.05.2010&nbsp; 15:25&nbsp;&nbsp;&nbsp; &lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<br />13.05.2010&nbsp; 15:25&nbsp;&nbsp;&nbsp; &lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ..<br />13.05.2010&nbsp; 15:25&nbsp;&nbsp;&nbsp; &lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Crash_Mode__Date_05-13-2010__Time_15-25-1212<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 File(s)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 bytes</span></p>
<p><span style="font-family: times new roman,times; font-size: small;"> Directory of C:\dumps\Crash_Mode__Date_05-13-2010__Time_15-25-1212</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">13.05.2010&nbsp; 15:25&nbsp;&nbsp;&nbsp; &lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<br />13.05.2010&nbsp; 15:25&nbsp;&nbsp;&nbsp; &lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ..<br />13.05.2010&nbsp; 15:25&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4.809 ADPlus_report.txt<br />13.05.2010&nbsp; 15:25&nbsp;&nbsp;&nbsp; &lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDBScripts<br />13.05.2010&nbsp; 15:25&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 314.078 PID-0__Spawned0__1st_chance_AccessViolation__mini_1090_2010-05-13_15-25-17-462_1adc.dmp<br />13.05.2010&nbsp; 15:25&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 37.625.208 PID-0__Spawned0__1st_chance_Process_Shut_Down__full_1090_2010-05-13_15-25-24-053_1adc.dmp<br />13.05.2010&nbsp; 15:25&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 44.724.812 PID-0__Spawned0__2nd_chance_AccessViolation__full_1090_2010-05-13_15-25-18-041_1adc.dmp<br />13.05.2010&nbsp; 15:25&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 43.164 PID-0__Spawned0__Date_05-13-2010__Time_15-25-1212.log<br />13.05.2010&nbsp; 15:25&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 13.866 Process_List.txt<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6 File(s)&nbsp;&nbsp;&nbsp;&nbsp; 82.725.937 bytes</span></p>
<p><span style="font-family: times new roman,times; font-size: small;"> Directory of C:\dumps\Crash_Mode__Date_05-13-2010__Time_15-25-1212\CDBScripts</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">13.05.2010&nbsp; 15:25&nbsp;&nbsp;&nbsp; &lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<br />13.05.2010&nbsp; 15:25&nbsp;&nbsp;&nbsp; &lt;DIR&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ..<br />13.05.2010&nbsp; 15:25&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 28.637 PID-0__Spawned0.cfg<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 File(s)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 28.637 bytes</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp; Total Files Listed:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7 File(s)&nbsp;&nbsp;&nbsp;&nbsp; 82.754.574 bytes<br />&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;">Hoş&ccedil;akalın</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">-faik</span></p>
<p><span style="font-family: times new roman,times; font-size: small;"></span></p>
<p><span style="font-family: times new roman,times; font-size: small;"></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Crash Mode, 1st/2nd chance exception, mini/full</title>
      <link>https://docs.microsoft.com/archive/blogs/hmm/crash-mode-1st2nd-chance-exception-minifull</link>
      <pubDate>Fri, 15 May 2015 02:02:36 GMT</pubDate>
      <dc:creator><![CDATA[faik hakan bilgen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hmm/2015/05/15/crash-mode-1st2nd-chance-exception-minifull/</guid>
      <description><![CDATA[Merhaba,Artık dump alma ile ilgili temel adımlara alıştığınızı umuyorum. Bu kez exception oluşturan...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: times new roman,times; font-size: small;">Merhaba,</span><br /><span style="font-family: times new roman,times; font-size: small;">Artık dump alma ile ilgili temel adımlara alıştığınızı umuyorum. Bu kez exception oluşturan uygulamaların dump&rsquo;larının nasıl alınabileceğine değineceğim. "Dump Alma ( Hang Mode - I )" makalesindeki UITest.exe&rsquo;yi kullanacağız. Uygulamayı &ccedil;alıştıralım ve &ldquo;AccessViolation&rdquo; butonuna basalım. İşletim sistemi, versiyonuna bağlı olarak bir takım kurtarma girişimlerinde bulunabilir, size se&ccedil;enekler sunabilir. Ama, sonu&ccedil;ta uygulama kapanacaktır :</span></p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/29/5417.UITestCrash.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-29/5417.UITestCrash.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/29/5417.UITestCrash.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-29/5417.UITestCrash.jpg" alt="" border="0" /></a></span></p>
<p>&nbsp;</p>
<p><strong><span style="font-family: times new roman,times; font-size: small;">1st/2nd Chance Exception</span></strong></p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;">Olanları ş&ouml;yle &ouml;zetleyebiliriz :</span></p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;">#1 Exception throw edilir ve İşletim Sistemi uygulamaya exception&rsquo;ı handle edip edemeyeceğini sorar. Bu durumu &ldquo;1st chance exception&rdquo; olarak da adlandırıyoruz. Eğer uygulamaya bir debugger bağlı ise o zaman debugger bir dump alabilir. Eğer debugger adplus ile &ccedil;alıştırılmışsa cdb.exe, bir minidump (aşağıda anlatacağım) </span>dosyası &uuml;retir. Exception durumlarında debugger&rsquo;ların ne yapabileceklerini &ouml;zelleştirebilirsiniz. Dolayısıyla, debugger istediğiniz başka bir eylemi de ger&ccedil;ekleştirebilir. &Ouml;rneğin, aslında adplus, cdb.exe&rsquo;nin sadece minidump oluşturmasını değil aynı zamanda log dosyasına da exception&rsquo;la ilgili bilgiler yazmasını sağlar.</p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;">#2 Uygulama exception&rsquo;ı handle edebiliyorsa kontrol uygulamada kalır ve uygulamaya &ccedil;alışmaya devam eder.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;">#3 Eğer uygulama exception&rsquo;ı handle edemezse o zaman işletim sistemi uygulamayı kapatmaya karar verir. Bu duruma da &ldquo;2nd chance exception&rdquo; denir. Aynı şekilde, eğer bir debugger uygulamaya bağlı ise debugger istenen eylemi ger&ccedil;ekleştirecektir. &Ouml;rneğin, adplus ile &ccedil;alıştırılmış cdb.exe bu durumda bir fulldump dosyası &uuml;retecektir. Sonra da uygulama kapanır. Aslında, bu aşamada bir dump daha yazılır. O da &ldquo;1st chance process shutdown&rdquo; exception&rsquo;ından kaynaklanan dumptır.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times;"><strong><span style="font-size: small;">Adım adım crash dump alma</span></strong></span></p>
<p><span style="font-family: times new roman,times; font-size: small;">#1 UITest.exe uygulamasını &ccedil;alıştırın.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">#2 Elevated ( Run as Administrator ) bir komut satırı a&ccedil;alım.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">#3 &ldquo;C:\Program Files\Debugging Tools for Windows (x86)&rdquo; dizinine ge&ccedil;elim.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">#4 Aşağıdaki komutu yazıp &ccedil;alıştıralım :</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Adplus -crash -pn UITest.exe -o c:\dumps -quiet</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Komut &ccedil;alışınca aşağıdaki gibi bir yazı g&ouml;rebilirsiniz. &ldquo;quiet&rdquo; modda &ccedil;alıştırdığımız i&ccedil;in sembol dizini uyarısı komut satırına yazılıyor. Sonra da debugger&rsquo;ın uygulamaya başarıyla bağlandığı belirtiliyor.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;"></span></p>
<p>&nbsp;</p>
<table style="width: 467px;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="465">
<p><span style="font-family: times new roman,times; font-size: small;">C:\Program Files\Debugging Tools for Windows (x86)&gt;Adplus -crash -pn UITest.exe</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">-o c:\dumps -quiet</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">WARNING!&nbsp; An '_NT_SYMBOL_PATH' environment variable is not set.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Please check the application event log or the ADPlus-report.txt</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">for more details.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;">Attaching the debugger to: UITEST.EXE</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Process ID: 4376)</span></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;">#5 Taskbar&rsquo;da minimized olarak cdb.exe&rsquo;nin &ccedil;alışmaya başladığını g&ouml;receksiniz. Hatırlarsanız hang mod dump alırken bu uygulama kısa bir s&uuml;re g&ouml;z&uuml;k&uuml;yordu sonra da kapanıyordu. Artık uygulama kapanana kadar cdb.exe de a&ccedil;ık kalacak. Cdb.exe&rsquo;yi maximize ederseniz aşağıdaki gibi yazıların olduğu bir komut satırı g&ouml;receksiniz :</span></p>
<p>&nbsp;</p>
<table style="width: 510px;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="508">
<p><span style="font-family: times new roman,times; font-size: small;">mps\Crash_Mode__Date_05-12-2010__Time_15-26-0505; GN" isc</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">0:001&gt; sxe -c @".echo ---;.echo --- 1st chance Stack_buffer_overflow exception -</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">---;.echo ---------------------------------------------------------------;.echo;</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">.echo Occurrence happened at: ;.time;.echo;.echo Faulting stack below ---;~#kvn2</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">50;.echo;.dump -u /mdi /c 1st_chance_Stack_buffer_overflow_exception_in_UITEST.E</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">XE_running_on_FHBEFES c:\dumps\Crash_Mode__Date_05-12-2010__Time_15-26-0505\PID-</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">4376__UITEST.EXE__1st_chance_Stack_buffer_overflow__mini.dmp; GN" -c2 @".echo --</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">-;.echo --- 2nd chance Stack_buffer_overflow exception ----;.echo --------------</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">-------------------------------------------------;.echo;.echo Occurrence happene</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">d at: ;.time;.echo;.echo Faulting stack below ---;~#kvn250;.echo;.dump -u /ma /c</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">&nbsp;2nd_chance_Stack_buffer_overflow_exception_in_UITEST.EXE_running_on_FHBEFES c:\</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">dumps\Crash_Mode__Date_05-12-2010__Time_15-26-0505\PID-4376__UITEST.EXE__2nd_cha</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">nce_Stack_buffer_overflow__full.dmp;!elog_str ADPlus detected a 2nd chance Stack</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">_buffer_overflow exception in process UITEST.EXE and has taken the following act</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">ions at the time of the crash: Log Time Stack FullDump EventLog. The output dire</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">ctory is c:\dumps\Crash_Mode__Date_05-12-2010__Time_15-26-0505; GN" sbo</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">0:001&gt; *</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">0:001&gt; * ADPlus is monitoring: UITEST.EXE</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">0:001&gt; * for&nbsp; 1st chance and 2nd chance exceptions as configured above.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">0:001&gt; * To change ADPlus configuration please refer to ADPlus.Doc. This file ca</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">n be found</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">0:001&gt; * in the same folder as ADPlus.vbs</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">0:001&gt; *</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">0:001&gt; g</span></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;&nbsp;<span style="font-family: times new roman,times; font-size: small;"></span></p>
<p><span style="font-family: times new roman,times; font-size: small;">#6 Şimdi &ldquo;AccessViolation&rdquo; butonuna basın. Cdb.exe ve UITest.exe uygulamalarının kapanmasını bekleyin.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;">#7 c:\dumps dizinine bakın. İ&ccedil;inde adı &ldquo;Crash_Mode__Date_05-12-2010__Time_15-26-0505&rdquo; e benzer bir dizin oluştuğunu g&ouml;receksiniz. Bu dizinlerin debugger tarafından a&ccedil;ıldığını biliyoruz. Hang mod dump alırken de benzer formatlı isimlerin olduğu dizinlerin yaratıldığını g&ouml;rm&uuml;şt&uuml;k. </span><span style="font-family: times new roman,times; font-size: small;">Şimdi bu dizinin i&ccedil;ine bakalım. Aynı tipte log dosyalarının olduğunu g&ouml;receksiniz. Ancak hang moddan farklı olarak 3 tane &ldquo;dmp&rdquo; uzantılı dosya olduğunu g&ouml;receksiniz.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;">PID-4376__UITEST.EXE__1st_chance_AccessViolation__mini_1760_2010-05-12_15-31-56-867_1118.dmp</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">PID-4376__UITEST.EXE__2nd_chance_AccessViolation__full_1760_2010-05-12_15-31-57-101_1118.dmp</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">PID-4376__UITEST.EXE__1st_chance_Process_Shut_Down__full_1760_2010-05-12_15-32-06-054_1118.dmp</span></p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;">İsimlere dikkat ederseniz, &ldquo;1st chance&rdquo; &ldquo;2nd chance&rdquo; ve &ldquo;full&rdquo;/&rdquo;mini&rdquo; s&ouml;zc&uuml;klerinin kullanıldığını g&ouml;receksiniz. 1st/2nd chance&rsquo;ten sonra exception&rsquo;nın tipi de yazılacaktır. Bizim &ouml;rneğimiz &ldquo;AccessViolation&rdquo; exception&rsquo;ı olduğu i&ccedil;in &ldquo;_AccessViolation_&rdquo; s&ouml;zc&uuml;ğ&uuml; eklenmiş.</span></p>
<p><span style="font-family: times new roman,times;"><em><span style="font-size: small;">Meraklısına not : Hen&uuml;z dmp dosyalarını incelemeye başlamadık. Ancak, nelerle uğraşacağımızı merak ediyorsanız &ldquo;PID-XXXX__UITEST.EXE__Date_MM-DD-YYYY__Time_HH-MM-SEC.log&rdquo; dosyasını inceleyebilirsiniz.</span></em></span></p>
<p><span style="font-family: times new roman,times; font-size: small;">&nbsp;</span></p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times;"><strong><span style="font-size: small;">Exception &uuml;reten ancak kapanmayan uygulamalar </span></strong></span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Aslında neredeyse t&uuml;m uygulamalar bu sınıfa girer &ccedil;&uuml;nk&uuml;; b&uuml;y&uuml;k olasılıkla &ccedil;alıştıkları s��re zarfında bir exception&rsquo;la karşılaşabilirler. Exception handle edilebiliyorsa sorun yok. Uygulama &ccedil;alışmaya devam eder. Duruma g&ouml;re throw edilen bu exception&rsquo;nın &ouml;nemi olabilir ve biz de bu anda bir dump almak isteyebiliriz. </span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Bir deneme yapmak i&ccedil;in yukarıdaki t&uuml;m adımları tekrarlayın. Sadece 6. adımda &ldquo;AccessViolation Handled&rdquo; butonuna basın. Sadece bir &ldquo;1st chance access violation&rdquo; minidump dosyası oluştuğunu g&ouml;receksiniz.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times;"><strong><span style="font-size: small;">Minidump/FullDump dosyaları</span></strong></span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Fulldump : Uygulamanın kullandığı t&uuml;m sanal bellek alanı, y&uuml;klenmiş t&uuml;m mod&uuml;lleri, handle tablosunu i&ccedil;erir.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Minidump : Bu kadar &ccedil;ok bilgiyi i&ccedil;ermez, sadece threadlerin callstack&rsquo;lerini ve y&uuml;klenmiş mod&uuml;llerle ilgili bir takım bilgileri barındırır.</span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;">Hoş&ccedil;akalın</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">-faik</span></p>
<p><span style="font-family: times new roman,times; font-size: small;"></span></p>
<p><span style="font-family: times new roman,times; font-size: small;"></span></p>
<p><span style="font-family: times new roman,times; font-size: small;"></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Dump Alma ( Hang Mode - II )</title>
      <link>https://docs.microsoft.com/archive/blogs/hmm/dump-alma-hang-mode-ii</link>
      <pubDate>Fri, 15 May 2015 01:46:14 GMT</pubDate>
      <dc:creator><![CDATA[faik hakan bilgen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hmm/2015/05/15/dump-alma-hang-mode-ii/</guid>
      <description><![CDATA[Merhaba,
Ge&ccedil;en sefer yanıt vermeyen ve işlemci zamanını az kullanan uygulamadan nasıl dump...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: times new roman,times; font-size: small;">Merhaba,</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Ge&ccedil;en sefer yanıt vermeyen ve işlemci zamanını az kullanan uygulamadan nasıl dump alınacağına değinmiştim. Bu kez yanıt vermeyen ancak işlemci zamanını &ccedil;ok kullanan bir uygulamadan nasıl dump alınabileceğini anlatacağım.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">İlk yazımda belirttiğim gibi uygulama yanıt vermez durumu gelince yapmamız gereken ne kadar işlemci zamanı kullandığına g&ouml;z atmak olmalı. </span><span style="font-family: times new roman,times; font-size: small;">Ge&ccedil;en yazıda yayınladığım UITest.exe uygulamasını a&ccedil;ın ve &ldquo;Y&uuml;ksek İşlemci&rdquo; butonuna basın. </span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Sonra, UITest.exe uygulamasını tutup &ccedil;ekmeye &ccedil;alışın. Bir kez daha UITest.exe&rsquo;nin başlığına &ldquo;Not Responding&rdquo; a&ccedil;ıklamasının eklendiğini g&ouml;receğiz.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">G&ouml;rev Y&ouml;neticisini a&ccedil;ın ve &ldquo;Processes (işlemler)&rdquo; sekmesinden &ldquo;UITest.exe&rdquo; uygulamasını bulun ve CPU kolonundaki değeri kontrol edin. G&ouml;rmenizi beklediğim değer en az 100 / İşlemciSayısı dır. </span></p>
<p><span style="font-family: times new roman,times; font-size: small;">&Ouml;rneğin, bir işlemciniz varsa 100, ikiyse 50, gibi. İleride dump analizini tartıştığımızda nedenlerini daha ayrıntılı g&ouml;receğiz. </span></p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/29/5415.HighCPU2.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-29/5415.HighCPU2.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/29/5415.HighCPU2.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-29/5415.HighCPU2.jpg" alt="" border="0" /></a></span></p>
<p><span style="font-family: times new roman,times; font-size: small;"></span></p>
<p><span style="font-family: times new roman,times; font-size: small;">UITest.exe uygulamasını sonlandırmadığınız s&uuml;rece bu seviyedeki işlemci kullanımı devam edecektir. </span><span style="font-family: times new roman,times; font-size: small;">Bu tip durumlarda uyguladığımız bir y&ouml;ntem var : Birden fazla defa hang mode dump almak. Bu y&ouml;ntemin arkasında yatan d&uuml;ş&uuml;nce alınan dump dosyalarını karşılaştırıp hangi fonksiyonun bu soruna neden olduğunu g&ouml;rebilmek. Bu y&ouml;ntemin başarısı, işlemci kullanımının y&uuml;ksek olduğu s&uuml;re ve alınan dump sayısı ile bağlantılıdır. </span><span style="font-family: times new roman,times; font-size: small;">Eğer işlemci kullanımı -UITest.exe &ouml;rneğinde olduğu gibi- uygulama kapanana kadar y&uuml;ksek devam ediyorsa bu durumda peşpeşe alınacak 4 dump yararlı olacaktır. &Ccedil;&uuml;nk&uuml;; genellikle sebep sonsuz d&ouml;ng&uuml;d&uuml;r. Dumplarda callstack&rsquo;lerin ortak fonksiyonlarını inceleyeceğiz. </span><span style="font-family: times new roman,times; font-size: small;">&Ouml;te yandan, yanıt vermeme durumu belli bir s&uuml;re devam ediyorsa ve sonra uygulama normal &ccedil;alışmasına devam ediyorsa bu y&ouml;netimin başarı şansı d&uuml;şecektir. &Ccedil;&uuml;nk&uuml;; bu tip y&uuml;ksek işlemci sı&ccedil;ramalarının sebebi &ccedil;oğunlukla artan istek sayısıdır. Bu durumda alacağımız dumplar arasında ortak callstack&rsquo;ler bulamayabiliriz bile.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">&nbsp;</span><span style="font-family: times new roman,times; font-size: small;">Şimdi adımları bir kez birlikte g&ouml;zden ge&ccedil;irelim :</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">#1 Uygulamanın tepkisiz ve &ccedil;ok işlemci zamanı kullandığından emin olalım.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">#2 Elevated ( Run as Administrator ) bir komut satırı a&ccedil;alım.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">#3 &ldquo;C:\Program Files\Debugging Tools for Windows (x86)&rdquo; dizinine ge&ccedil;elim.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">#4 Aşağıdaki komutu yazıp &ccedil;alıştıralım :</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">adplus -hang -pn UITest.exe -o c:\dumps -quiet</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Komut &ccedil;alışınca aşağıdaki gibi bir yazı g&ouml;rebilirsiniz. &ldquo;quiet&rdquo; modda &ccedil;alıştırdığımız i&ccedil;in sembol dizini uyarısı komut satırına yazılıyor. Sonra da debugger&rsquo;ın uygulamaya başarıyla bağlandığı belirtiliyor.</span></p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;</p>
<table style="width: 666px; height: 192px;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="476">
<p><span style="font-family: times new roman,times; font-size: small;">C:\Program Files\Debugging Tools for Windows (x86)&gt;Adplus -hang -pn UITest.exe -</span><span style="font-family: times new roman,times; font-size: small;">o c:\dumps -quiet</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">WARNING!&nbsp; An '_NT_SYMBOL_PATH' environment variable is not set.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Please check the application event log or the ADPlus-report.txt </span><span style="font-family: times new roman,times; font-size: small;">for more details.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">&nbsp;</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">Attaching the debugger to: UITEST.EXE</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Process ID: 7520)</span></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;">#5 Komutu &ccedil;alıştırdığınız anda taskbar&rsquo;da kısa s&uuml;reliğine &ldquo;cdb.exe&ldquo; adlı bir programın a&ccedil;ılıp kapandığını g&ouml;receksiniz. Cdb.exe kapandıktan sonra 4. Adımı tekrarlayın. Bu y&ouml;ntemle 4 kez dump oluşturun.</span></p>
<p><span style="font-family: times new roman,times; font-size: small;">#6 İşlem bittikten sonra c:\dump dizinine gidin. 4 yeni dizin oluşturulduğunu g&ouml;receksiniz. Hatırlarsanız her dizinin i&ccedil;eriğini ge&ccedil;en yazıda g&ouml;zden ge&ccedil;irmiştik.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;">Gelecek yazımda crash mod dump almaktan bahsedeceğim.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: times new roman,times; font-size: small;">Hoş&ccedil;akalın</span></p>
<p><span style="font-family: times new roman,times;"><span style="font-size: small;">-faik</span></span></p>
<p><span style="font-family: times new roman,times; font-size: small;"></span></p>
<p><span style="font-family: times new roman,times; font-size: small;"></span></p>]]></content:encoded>
    </item>
  </channel>
</rss>