Run CMD
Run CMD

Reputation: 3035

App busy but not responding : how to check what it's doing?

We have a .NET app. On some specific machines, the application doesn't respond anymore. However, in task manager, the app is listed as 'active' (instead of 'not responding'). We can also see in task manager that the process keeps using 10% of the processor. We don't have a clue however what it is doing?

Is there a way we can see what what code is being called or what the process is currently doing (call stack?)

EDIT: Apparently we can't use remote debugger because the machine is not connected over a network, debugging over the internet isn't supported. The CPU-analyzer.exe program seems great, but we can't get it to work ? We've created a dump file and analyzed it with windb, this is the output :

.................................................WARNING: rsaenh overlaps cryptsp

.WARNING: RpcRtRemote overlaps rsaenh ......WARNING: WindowsCodecs overlaps System_Drawing_ni ........ .......WARNING: msdart overlaps shfolder ...WARNING: comsvcs overlaps oledb32 ...............WARNING: dhcpcsvc6 overlaps dhcpcsvc ................WARNING: apphelp overlaps GdiPlus .........WARNING: winhttp overlaps Faultrep .WARNING: webio overlaps comctl32_71bf0000 ............. ...... wow64win!NtUserPeekMessage+0xa: 00000000`732efdea c3 ret 0:000> !analyze -v


* WARNING: Unable to verify checksum for AppName.exe ERROR: Module load completed but symbols could not be loaded for AppName.exe WARNING: symbols timestamp is wrong 0x4ce7c496 0x4f9235ab for GdiPlus.dll * WARNING: symbols timestamp is wrong 0x4a5bdf81 0x4a5bda2e for comsvcs.dll

FAULTING_IP: +a7d01d0 00000000`00000000 ?? ???

EXCEPTION_RECORD: ffffffffffffffff -- (.exr 0xffffffffffffffff) ExceptionAddress: 0000000000000000 ExceptionCode: 80000003 (Break instruction exception) ExceptionFlags: 00000000 NumberParameters: 0

FAULTING_THREAD: 0000000000001678

PROCESS_NAME: AppName.exe

OVERLAPPED_MODULE: Address regions for 'msdart' and 'shfolder' overlap

ERROR_CODE: (NTSTATUS) 0x80000003 - {EXCEPTION} Breakpoint A breakpoint has been reached.

EXCEPTION_CODE: (HRESULT) 0x80000003 (2147483651) - One or more arguments are invalid

MOD_LIST:

NTGLOBALFLAG: 0

APPLICATION_VERIFIER_FLAGS: 0

MANAGED_STACK: !dumpstack -EE No export dumpstack found

ADDITIONAL_DEBUG_TEXT: Followup set based on attribute [Is_ChosenCrashFollowupThread] from Frame:[0] on thread:[PSEUDO_THREAD]

LAST_CONTROL_TRANSFER: from 00000000732cadb3 to 00000000732efdea

BUGCHECK_STR: APPLICATION_FAULT_STACKIMMUNE_NOSOS

PRIMARY_PROBLEM_CLASS: STACKIMMUNE

DEFAULT_BUCKET_ID: STACKIMMUNE

STACK_TEXT:
0000000000000000 0000000000000000 unknown!AppName.exe+0x0

SYMBOL_NAME: unknown!AppName.exe

FOLLOWUP_NAME: MachineOwner

MODULE_NAME: unknown

IMAGE_NAME: unknown

DEBUG_FLR_IMAGE_TIMESTAMP: 0

STACK_COMMAND: ** Pseudo Context ** ; kb

FAILURE_BUCKET_ID: STACKIMMUNE_80000003_unknown!Unloaded

BUCKET_ID: X64_APPLICATION_FAULT_STACKIMMUNE_NOSOS_unknown!AppName.exe

Followup: MachineOwner

Could this be the culprit : Address regions for 'msdart' and 'shfolder' overlap ??

Upvotes: 1

Views: 1664

Answers (4)

Run CMD
Run CMD

Reputation: 3035

The problem was a multithreaded deadlock. An error was shown, underneath our main window. Because we couldn't click OK on the error, and our main window was waiting for the error window to be closed, our app hung ...

We identified the actual error by screen recording, while we shut down the app with task manager. For less than a second, we could see the error window, and by playing back the recording we could see what exactly the error was and fix it.

Upvotes: 0

xwlan
xwlan

Reputation: 564

you can capture a dump and open it in windbg, type !analyze -v let windbg do analysis for you. for hang/non-responsive issues, !analyze -v is not as effective as for crash. I usually ~*kb200 to list all threads' stack trace, that's very helpful to get an initial overview of what the threads are doing, then, !locks can tell me whether there's any critical section issue, sometimes, I will examine whether there's any exception appearing on stack

Upvotes: 1

Carlos Landeras
Carlos Landeras

Reputation: 11063

Install visual studio remote debugger on the host is running the application, and then attach to the running process. You will need to have the same pdb files and source code so you can insert breakpoints and debug.

Check this link:

http://msdn.microsoft.com/en-us/library/vstudio/bt727f1t.aspx

You can also configure debug to remote start the application in other machine instead of connecting to the running process.

Upvotes: 1

JeffRSon
JeffRSon

Reputation: 11206

Either connect to this process with Visual Studio or WinDbg to look at the callstack and debug, and/or include logging in your application. Such you can write to a log file what your app is doing.

It sounds like you're blocking your GUI, but background threads are still working.

Upvotes: 1

Related Questions