The processor is 100% stuck on the client PC, any debugging suggestions?

I have a deadlock with one of the clients using my software. Of the approximately 40 copies of the product sold (an application programmed in .NET 2.0 using VB.NET 2005), about 2 do not respond to 1 core of dual-core processors that are 100% stuck (the program uses only 1 core)

The most logical guess is an infinite loop that causes this behavior, but it's thousands of lines of code with many, many loops. That is all I have; Now, how do you suggest me approach debugging this problem?

EDIT: Basically, the software is responsible for calculating the amount of credit spent using other devices such as PCs, etc. This is a Cybercafe management program and is interrupted intermittently, that is, it subtracts a loan when it fails. It also does other things in the background, for example, checks to see if it is time to back up the database, including.

EDIT: Solvable. This was the most unlikely problem. The access database mechanism that I used as the DBMS is actually part of my application, which is problematic. In one of the tables it is difficult to work with a row - JUST ONE FRIGGIN ROW. I cannot delete it or otherwise add the record associated with this row in any other table; Even MS Access 2007 makes the processor work up to 100% when I try to work with this line!

A simple "Compact and Repair" command fixed everything. I think I will call this command every time my application starts. This will prevent a recurrence of this event.

Thanks to WinDbg, I could find where the problem is. I recommend everyone to learn how to use it, because it is a real-time screensaver.

+3
8

windbg ( Windows) . , , , . ,

!

, . , .

:

0:015> !runaway

 0: 1074 0 0: 00: 21,637 11:137c 0 0: 00: 02,792  4: 12c8 0 0: 00: 00.530  9: 1374 0 0: 00: 00.046 15: 13d0 0 0: 00: 00.000 14: 1204 0 0: 00: 00.000 13: 154c 0 0: 00: 00.000 12: 144c 0 0: 00: 00.000 10: 1378 0 0: 00: 00 000  8: 1340 0 0: 00: 00.000  7: 12f0 0 0: 00: 00.000  6: 12d4 0 0: 00: 00.000  5: 12d0 0 0: 00: 00.000  3: 12c4 0 0: 00: 00.000  2: 12c0 0 0: 00: 00.000  1:12b4 0 0: 00: 00.000

, , 11, 11. , ~ 11s.

0:015> ~11s

eax = 03fbb270 ebx = ffffffff ecx = 00000002 edx = 00000060 esi = 00000000 edi = 00000000 eip = 77475e74 esp = 0572f60c ebp = 0572f67c iopl = 0 nv up ei pl zr na pe nc cs = 001b ss = 0023 ds = 0023 es = 0023 fs = 003b gs = 0000 efl = 00000246 Ntdll KiFastSystemCallRet: 77475e74 c3 ret

, kp:

0:011> kp
ChildEBP RetAddr  
0572f608 77475620 ntdll!KiFastSystemCallRet
0572f60c 75b09884 ntdll!NtWaitForSingleObject+0xc
0572f67c 75b097f2 kernel32!WaitForSingleObjectEx+0xbe
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Program Files\Mozilla Firefox 3.1 Beta 1\nspr4.dll - 
0572f690 10019a0b kernel32!WaitForSingleObject+0x12
WARNING: Stack unwind information not available. Following frames may be wrong.
0572f6ac 10015979 nspr4!PR_MD_WAIT_CV+0x8b
0572f6c4 10015763 nspr4!PR_GetPrimordialCPU+0x79
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Program Files\Mozilla Firefox 3.1 Beta 1\xul.dll - 
0572f6e0 64d44d6a nspr4!PR_Wait+0x33
0572f708 64dbe67e xul!NS_CycleCollectorForget2_P+0x698a
0572f72c 10019b3f xul!gfxWindowsPlatform::FontEnumProc+0xfd4e
0572f734 10015d32 nspr4!PR_MD_UNLOCK+0x1f
0572f738 1001624b nspr4!PR_Unlock+0x22
0572f754 1001838d nspr4!PRP_TryLock+0x4cb
00000000 00000000 nspr4!PR_Now+0x109d

kp . dv.

sysinternals.

, , userdump, , . , userdump . Userdump - Microsoft, -.

+7

, .
, VS/WinDbg SOS (Son of Strike). .

+4

, . WinDbg .

, , . , , .

:)

+4

, , . ? ?

, , , .

+2

, log4net, postsharp. - . , .

, vb.net, . , .

+2

. , .

( AutoFlush).

, - ...

+2

, -, , .

( , , , , . , SetProcessAffinity, )

, , 100% - CPU , SetProcessAffinity . , , .

+1

? " " . / , , /DCOM/? , , ?

, ASSERT. ASSERT , XML-RPC, :

"<?xml " 

ASSERT . - . , โ€‹โ€‹ ASSERT ( , ).

This is not very specific or oriented advice, but mine should then add ASSERT in places that may have affected the threading issue.

Note that triggering an ASSERT does not necessarily mean interrupting a program or throwing a message box. ACTS can be instead redirected to a log file, including a full stack of trace during ASSERT firing.

0
source

Source: https://habr.com/ru/post/1714119/


All Articles