IBM Support

MUSTGATHER: Windows .NET/CLI/ODBC application hang

Troubleshooting


Problem

List of diagnostics to gather for an application hang

Diagnosing The Problem

A) Windows userdump
When application hangs:
1) Start Task Manager
2) Processes tab
3) Right click on the process name used by your application and select “Create Dump File”

Note: On older versions of Windows this may not be available. In those cases please follow alternate directions below for running AdPlus.

4) Once the dump is created a message will pop-up. It will create a <name of process>.DMP file in C:\Users\<userid>\AppData\Local\Temp\

5) Wait a few seconds and create a second dump file as per step #3 above, the new file will automatically have a number appended to the process name.

Notes:
You would need at least a few hundred MBs in C:\Users\<userid>\AppData\Local\Temp\ for the dump file. If your application consumes several GB in memory, at minimum it would require this much space.

If unable to change the path of the userdump. Use the "mklink" command in Windows to create a symbolic link pointing to another location which has sufficient space.

Alternative: Debug Diagnostic Tool

"The Debug Diagnostic Tool (DebugDiag) is designed to assist in troubleshooting issues such as hangs, slow performance, memory leaks or memory fragmentation, and crashes in any user-mode process."

https://www.microsoft.com/en-us/download/details.aspx?id=49924

Alternative: AdPlus

Install the Windows Debugger. It is available as a stand-alone program or part of the Windows Driver Development Kit.

WDK and WinDbg downloads
https://msdn.microsoft.com/en-us/windows/hardware/hh852365

Direct link here: https://www.microsoft.com/click/services/Redirect2.ashx?CR_EAC=300135395

After it has been installed follow the example below. This example creates a dump for PID 4456 and writes to d:\crashdumps. A different path may be specified, but it must exist.

C:\Program Files\Debugging Tools for Windows (x64)>adplus -hang -p 4456 -o d:\crashdumps
Starting ADPlus
********************************************************
* *
* ADPLus Flash V 7.01.002 02/27/2009 *
* *
* For ADPlus documentation see ADPlus.doc *
* New command line options: *
* -pmn <procname> - process monitor *
* waits for a process to start *
* -po <procname> - optional process *
* won't fail if this process isn't running *
* -mss <LocalCachePath> *
* Sets Microsoft's symbol server *
* -r <quantity> <interval in seconds> *
* Runs -hang multiple times *
* *
* ADPlusManager - an additional tool to facilitate *
* the use of ADPlus in distributed environments like *
* computer clusters. *
* Learn about ADPlusManager in ADPlus.doc *
* *
********************************************************

Attaching to 4456 - notepad in Hang mode 03/25/2015 14:19:43
Logs and memory dumps will be placed in d:\crashdumps\20150325_141943_Hang_Mode



B) DB2 trace mask on CLI and DRDA components


Trace to 1 GB memory buffer and enable trace masks to reduce the impact of the trace and amount of unnecessary data collected. The trace overwrites itself from the beginning once the buffer is full.

Preparation:

1) db2set DB2TRC_DEF_BUFFSIZE=1024M
2) Restart DB2 instance for setting to take effect. Otherwise the "-l" option specified in db2trc may default to 32 MB.

Collecting Trace
1) db2trc on -Madd SQLCC -Madd SQLJR -Madd SQLJC -Madd SQLJS -Madd SQLO -Madd NMP -Madd CLI -l 1024m
2) Wait for application to hang
3) db2trc dmp trace.dmp
4) db2trc off
5) db2trc flw -t -wc trace.dmp trace.flw
6) db2trc fmt trace.dmp trace.fmt
7) db2trc fmt -cli trace.dmp trace.cli
8) db2trc fmt -c trace.dmp trace_drda.fmt

C) DB2 Server side (optional)
Create a statement monitor if possible to track whether the statement reached the server during the hang. May generate lots of data if there is plenty of activity on the system.

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Programming Interface - .NET\/.NET ADO","Platform":[{"code":"PF033","label":"Windows"}],"Version":"9.8;9.7;10.1;10.5","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21700488