I have a multi-thread windows console application. In the application, some threads' priority are set to THREAD_PRIORITY_LOWEST (-2) and the rest are set to THREAD_PRIORITY_NORMAL (0). Sometimes, the application hangs when outputting logs to console. I use Windbg to debug the application and found the hang was caused by the printf fucntion in C run-time library, as shown below. The thread 0 ,1 and 2 have priority 0 and the others have priority -2. Thread 2 is the main startup thread and the thread 1 is created by Symantec Endpoint Protection (UMEngx86.dll).
0:015> !locks
CritSec MSVCR120D!lclcritsects+120 at 0f3ead80
WaiterWoken No
LockCount 0
RecursionCount 1
OwningThread 2fe8
EntryCount 0
ContentionCount 0
*** Locked
CritSec MSVCR120D!lclcritsects + 138 at 0f3ead98
WaiterWoken No
LockCount 1
RecursionCount 1
OwningThread 21c4
EntryCount 0
ContentionCount 6
* ** Locked
CritSec + 435da4 at 00435da4
WaiterWoken No
LockCount 0
RecursionCount 1
OwningThread 2fe8
EntryCount 0
ContentionCount 0
* ** Locked
CritSec + 435de4 at 00435de4
WaiterWoken No
LockCount 0
RecursionCount 1
OwningThread 21c4
EntryCount 0
ContentionCount 0
* ** Locked
Scanned 186 critical sections
0:015> !cs 0f3ead98
-----------------------------------------
Critical section = 0x0f3ead98 (MSVCR120D!lclcritsects+0x138)
DebugInfo = 0x00439878
LOCKED
LockCount = 0x1
WaiterWoken = No
OwningThread = 0x000021c4
RecursionCount = 0x1
LockSemaphore = 0xA4
SpinCount = 0x00000fa0
0:015> ~* kb
0 Id: 2af8.e9c Suspend: 1 Teb: 7efdd000 Unfrozen
ChildEBP RetAddr Args to Child
002bf460 74e715ce 0000004c 00000000 00000000
ntdll!ZwWaitForSingleObject+0x15
002bf4cc 76631194 0000004c ffffffff 00000000
KERNELBASE!WaitForSingleObjectEx+0x98
002bf4e4 76631148 0000004c ffffffff 00000000
kernel32!WaitForSingleObjectExImplementation+0x75
002bf4f8 011c533d 0000004c ffffffff 002bf6a8
kernel32!WaitForSingleObject+0x12
002bf5d4 011c024a 002bf6ac 002bf6b0 7efde000
demo_threadx!_tx_thread_schedule+0x16d [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_schedule.c @ 180]
002bf6a8 010e10ee 002bf850 00000000 7efde000
demo_threadx!_tx_initialize_kernel_enter+0x6a [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_initialize_kernel_enter.c
@ 186]
002bf77c 010e1023 00000000 00000000 7efde000 demo_threadx!optimus_main+0xae
[c:\cc-views\optimus_r11_ti\optimus\src\sys\main_os.c @ 218]
002bf850 011b87c9 00000001 00437c78 00438c40 demo_threadx!main+0x23 [c:\cc-
views\optimus_r11_ti\optimus\src\win32\demo_optimus.c @ 67]
002bf8a0 011b890d 002bf8b4 7663336a 7efde000
demo_threadx!__tmainCRTStartup+0x199
[f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c @ 626]
002bf8a8 7663336a 7efde000 002bf8f4 77269902 demo_threadx!mainCRTStartup+0xd
[f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c @ 466]
002bf8b4 77269902 7efde000 6218bd9d 00000000
kernel32!BaseThreadInitThunk+0xe
002bf8f4 772698d5 011b8900 7efde000 00000000 ntdll!__RtlUserThreadStart+0x70
002bf90c 00000000 011b8900 7efde000 00000000 ntdll!_RtlUserThreadStart+0x1b
1 Id: 2af8.2934 Suspend: 1 Teb: 7efda000 Unfrozen
ChildEBP RetAddr Args to Child
WARNING: Frame IP not in any known module. Following frames may be wrong.
00b0f7e8 7663336a 00130000 00b0f834 77269902 0x903a3
00b0f7f4 77269902 00130000 6283bd5d 00000000
kernel32!BaseThreadInitThunk+0xe
00b0f834 772698d5 00130064 00130000 00000000 ntdll!__RtlUserThreadStart+0x70
00b0f84c 00000000 00130064 00130000 00000000 ntdll!_RtlUserThreadStart+0x1b
2 Id: 2af8.2e44 Suspend: 1 Teb: 7efd7000 Unfrozen
ChildEBP RetAddr Args to Child
WARNING: Frame IP not in any known module. Following frames may be wrong.
00e0f5fc 69663fd2 80006043 00e0f640 00000010 0x90154
00e0f674 696640d5 69665ef3 00e0f6e0 00e0f6d4 UMEngx86+0x3fd2
00e0f6d8 74e73c8f 00000068 00e0f6f0 00e0f7cc UMEngx86+0x40d5
00e0f6e8 011c7609 00000068 00e0f8a0 00e0f7d4 KERNELBASE!SuspendThread+0x12
00e0f7cc 011c4c2d 00000000 00000000 00437d08
demo_threadx!_tx_thread_context_save+0x79 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_context_save.c @
133]
00e0f8a0 0f2a3651 00000000 164b464c 00000000
demo_threadx!_tx_win32_timer_interrupt+0x3d [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_initialize_low_level.c @
439]
00e0f8dc 0f2a3861 00475d00 00e0f8f4 7663336a
MSVCR120D!_callthreadstartex+0x51
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 376]
00e0f8e8 7663336a 00475d00 00e0f934 77269902 MSVCR120D!_threadstartex+0xb1
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 359]
00e0f8f4 77269902 00437d08 62d3bc5d 00000000
kernel32!BaseThreadInitThunk+0xe
00e0f934 772698d5 0f2a37b0 00437d08 00000000 ntdll!__RtlUserThreadStart+0x70
00e0f94c 00000000 0f2a37b0 00437d08 00000000 ntdll!_RtlUserThreadStart+0x1b
3 Id: 2af8.2fe8 Suspend: 1 Teb: 7efaf000 Unfrozen
ChildEBP RetAddr Args to Child
00c9f3ac 766d7b49 00000003 0f3ec700 00001000
kernel32!ReadConsoleInternal+0x15
00c9f434 7665f1f2 00000003 0f3ec700 00001000 kernel32!ReadConsoleA+0x40
00c9f47c 0f370cad 00000003 0f3ec700 00001000
kernel32!ReadFileImplementation+0x75
00c9f530 0f370473 00000000 0f3ec700 00001000 MSVCR120D!_read_nolock+0x7bd
[f:\dd\vctools\crt\crtw32\lowio\read.c @ 256]
00c9f588 0f2b62f6 00000000 0f3ec700 00001000 MSVCR120D!_read+0x253
[f:\dd\vctools\crt\crtw32\lowio\read.c @ 92]
00c9f5b8 0f32aef9 0f3e72f0 00000000 ffffffff MSVCR120D!_filbuf+0x126
[f:\dd\vctools\crt\crtw32\stdio\_filbuf.c @ 158]
00c9f5cc 0f32cc3a 0f3e72f0 00000064 00c9f864 MSVCR120D!_inc+0x49
[f:\dd\vctools\crt\crtw32\stdio\input.c @ 1421]
00c9f5dc 0f32b67e 00c9f6d4 0f3e72f0 00c9f5f8 MSVCR120D!_whiteout+0x1a
[f:\dd\vctools\crt\crtw32\stdio\input.c @ 1438]
00c9f864 0f2bdb7d 0f3e72f0 011c83b9 00000000 MSVCR120D!_input_l+0x76e
[f:\dd\vctools\crt\crtw32\stdio\input.c @ 609]
00c9f8b0 0f2bda2e 0f32af10 011c83b8 00000000 MSVCR120D!vscanf_fn+0xed
[f:\dd\vctools\crt\crtw32\stdio\scanf.c @ 54]
00c9f8cc 010e11af 011c83b8 00c9f9bc 00000000 MSVCR120D!scanf+0x1e
[f:\dd\vctools\crt\crtw32\stdio\scanf.c @ 88]
00c9f9d0 0f2a3651 00000000 1662449c 00000000
demo_threadx!thread_user_input+0x9f [c:\cc-
views\optimus_r11_ti\optimus\src\sys\main_os.c @ 541]
00c9fa0c 0f2a3861 00475918 00c9fa24 7663336a
MSVCR120D!_callthreadstartex+0x51
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 376]
00c9fa18 7663336a 00475918 00c9fa64 77269902 MSVCR120D!_threadstartex+0xb1
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 359]
00c9fa24 77269902 004380f0 62fabf0d 00000000
kernel32!BaseThreadInitThunk+0xe
00c9fa64 772698d5 0f2a37b0 004380f0 00000000 ntdll!__RtlUserThreadStart+0x70
00c9fa7c 00000000 0f2a37b0 004380f0 00000000 ntdll!_RtlUserThreadStart+0x1b
4 Id: 2af8.2d84 Suspend: 1 Teb: 7efac000 Unfrozen
ChildEBP RetAddr Args to Child
0102f1e8 74e715ce 0000005c 00000000 00000000
ntdll!ZwWaitForSingleObject+0x15
0102f254 76631194 0000005c ffffffff 00000000
KERNELBASE!WaitForSingleObjectEx+0x98
0102f26c 76631148 0000005c ffffffff 00000000
kernel32!WaitForSingleObjectExImplementation+0x75
0102f280 011c67a8 0000005c ffffffff 0102f4f0
kernel32!WaitForSingleObject+0x12
0102f3a4 011c5a65 0102f634 0102f4fc 004384d8
demo_threadx!_tx_thread_system_return+0x168 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_system_return.c @
201]
0102f4f0 011c79ec 01230580 0102f730 0102f640
demo_threadx!_tx_thread_system_suspend+0x5a5 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_system_suspend.c @
615]
0102f634 011c5ee2 4154494d 0102f810 0102f738
demo_threadx!_tx_timer_thread_entry+0x23c [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_timer_thread_entry.c @
496]
0102f730 011c6121 00000000 00000000 004384d8
demo_threadx!_tx_thread_shell_entry+0x72 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_shell_entry.c @
164]
0102f810 0f2a3651 01230580 17a946dc 00000000
demo_threadx!_tx_win32_thread_entry+0x41 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_stack_build.c @
186]
0102f84c 0f2a3861 004725e0 0102f864 7663336a
MSVCR120D!_callthreadstartex+0x51
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 376]
0102f858 7663336a 004725e0 0102f8a4 77269902 MSVCR120D!_threadstartex+0xb1
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 359]
0102f864 77269902 004384d8 6331bdcd 00000000
kernel32!BaseThreadInitThunk+0xe
0102f8a4 772698d5 0f2a37b0 004384d8 00000000 ntdll!__RtlUserThreadStart+0x70
0102f8bc 00000000 0f2a37b0 004384d8 00000000 ntdll!_RtlUserThreadStart+0x1b
5 Id: 2af8.2e18 Suspend: 1 Teb: 7efa9000 Unfrozen
ChildEBP RetAddr Args to Child
013df4e4 74e715ce 00000064 00000000 00000000
ntdll!ZwWaitForSingleObject+0x15
013df550 76631194 00000064 ffffffff 00000000
KERNELBASE!WaitForSingleObjectEx+0x98
013df568 76631148 00000064 ffffffff 00000000
kernel32!WaitForSingleObjectExImplementation+0x75
013df57c 011c67a8 00000064 ffffffff 013df7ec
kernel32!WaitForSingleObject+0x12
013df6a0 011c5a65 013df954 013df970 00471fe8
demo_threadx!_tx_thread_system_return+0x168 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_system_return.c @
201]
013df7ec 011c0de5 01262e20 013dfa4c 013df970
demo_threadx!_tx_thread_system_suspend+0x5a5 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_system_suspend.c @
615]
013df954 010e5b54 01262a80 00000018 00000001
demo_threadx!_tx_event_flags_get+0x205 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_event_flags_get.c @ 402]
013dfa4c 011c5ee2 00000000 013dfc28 013dfb50 demo_threadx!ERR_Task+0x64
[c:\cc-views\optimus_r11_ti\optimus\src\err\errmanager.c @ 482]
013dfb48 011c6121 00000000 00000000 00471fe8
demo_threadx!_tx_thread_shell_entry+0x72 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_shell_entry.c @
164]
013dfc28 0f2a3651 01262e20 179642f4 00000000
demo_threadx!_tx_win32_thread_entry+0x41 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_stack_build.c @
186]
013dfc64 0f2a3861 004729c8 013dfc7c 7663336a
MSVCR120D!_callthreadstartex+0x51
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 376]
013dfc70 7663336a 004729c8 013dfcbc 77269902 MSVCR120D!_threadstartex+0xb1
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 359]
013dfc7c 77269902 00471fe8 630eb9d5 00000000
kernel32!BaseThreadInitThunk+0xe
013dfcbc 772698d5 0f2a37b0 00471fe8 00000000 ntdll!__RtlUserThreadStart+0x70
013dfcd4 00000000 0f2a37b0 00471fe8 00000000 ntdll!_RtlUserThreadStart+0x1b
6 Id: 2af8.1b28 Suspend: 1 Teb: 7efa6000 Unfrozen
ChildEBP RetAddr Args to Child
0167f028 7727ebae 000000a4 00000000 00000000
ntdll!ZwWaitForSingleObject+0x15
0167f08c 7727ea92 00000000 00000000 00471fe8
ntdll!RtlpWaitOnCriticalSection+0x13e
0167f0b4 0f29f4db 0f3ead98 0167f0cc 0f2b68a5
ntdll!RtlEnterCriticalSection+0x150
0167f0c0 0f2b68a5 00000011 0167f118 0f2bcf3d MSVCR120D!_lock+0x3b
[f:\dd\vctools\crt\crtw32\startup\mlock.c @ 341]
0167f0cc 0f2bcf3d 00000001 0f3e7310 17cc4f88 MSVCR120D!_lock_file2+0x15
[f:\dd\vctools\crt\crtw32\stdio\_file.c @ 256]
0167f118 01160eda 011d2968 0167f2d0 0167f3c8 MSVCR120D!printf+0xcd
[f:\dd\vctools\crt\crtw32\stdio\printf.c @ 58]
0167f1f4 01134cb8 012396c0 0167f3b4 0167f3c8
demo_threadx!dsysIsaProcessNewMode+0x4aa [c:\cc-
views\optimus_r11_ti\optimus\src\isa\isasys\dsys0isa.c @ 386]
0167f2d0 011344a5 0167f4e8 0167f3c8 00471fe8
demo_threadx!kerHookNoCycExec+0x28 [c:\cc-
views\optimus_r11_ti\optimus\src\isa\isasys\dsys0uhk.c @ 460]
0167f3b4 01120ebb 0167f4a7 0167f4b3 0167f4bc
demo_threadx!kerHookBegScan+0x195 [c:\cc-
views\optimus_r11_ti\optimus\src\isa\isasys\dsys0uhk.c @ 617]
0167f4e8 010e5e2e 00000000 00000000 0167f6c0 demo_threadx!dkerMain+0x1db
[c:\cc-views\optimus_r11_ti\optimus\src\isa\isaker\dker0mai.c @ 1087]
0167f5c4 011c5ee2 00000000 0167f7a0 0167f6c8 demo_threadx!ISA_Task+0x5e
[c:\cc-views\optimus_r11_ti\optimus\src\isa\isamanager.c @ 192]
0167f6c0 011c6121 00000000 00000000 00471fe8
demo_threadx!_tx_thread_shell_entry+0x72 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_shell_entry.c @
164]
0167f7a0 0f2a3651 01263078 17cc494c 00000000
demo_threadx!_tx_win32_thread_entry+0x41 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_stack_build.c @
186]
0167f7dc 0f2a3861 00473198 0167f7f4 7663336a
MSVCR120D!_callthreadstartex+0x51
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 376]
0167f7e8 7663336a 00473198 0167f834 77269902 MSVCR120D!_threadstartex+0xb1
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 359]
0167f7f4 77269902 00471fe8 6354bd5d 00000000
kernel32!BaseThreadInitThunk+0xe
0167f834 772698d5 0f2a37b0 00471fe8 00000000 ntdll!__RtlUserThreadStart+0x70
0167f84c 00000000 0f2a37b0 00471fe8 00000000 ntdll!_RtlUserThreadStart+0x1b
7 Id: 2af8.2f74 Suspend: 1 Teb: 7efa3000 Unfrozen
ChildEBP RetAddr Args to Child
0187f6c0 74e715ce 00000074 00000000 00000000
ntdll!ZwWaitForSingleObject+0x15
0187f72c 76631194 00000074 ffffffff 00000000
KERNELBASE!WaitForSingleObjectEx+0x98
0187f744 76631148 00000074 ffffffff 00000000
kernel32!WaitForSingleObjectExImplementation+0x75
0187f758 011c67a8 00000074 ffffffff 0187f9c8
kernel32!WaitForSingleObject+0x12
0187f87c 011c5a65 0187fb30 0187fb4c 00472db0
demo_threadx!_tx_thread_system_return+0x168 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_system_return.c @
201]
0187f9c8 011c0de5 01262bc8 0187fc24 0187fb4c
demo_threadx!_tx_thread_system_suspend+0x5a5 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_system_suspend.c @
615]
0187fb30 010e396a 011d7688 00000005 00000001
demo_threadx!_tx_event_flags_get+0x205 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_event_flags_get.c @ 402]
0187fc24 011c5ee2 00446ba0 0187fe00 0187fd28 demo_threadx!COM_Task+0xba
[c:\cc-views\optimus_r11_ti\optimus\src\com\commanager.c @ 1677]
0187fd20 011c6121 00000000 00000000 00472db0
demo_threadx!_tx_thread_shell_entry+0x72 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_shell_entry.c @
164]
0187fe00 0f2a3651 01262bc8 172c40ac 00000000
demo_threadx!_tx_win32_thread_entry+0x41 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_stack_build.c @
186]
0187fe3c 0f2a3861 00473790 0187fe54 7663336a
MSVCR120D!_callthreadstartex+0x51
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 376]
0187fe48 7663336a 00473790 0187fe94 77269902 MSVCR120D!_threadstartex+0xb1
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 359]
0187fe54 77269902 00472db0 63b4bbfd 00000000
kernel32!BaseThreadInitThunk+0xe
0187fe94 772698d5 0f2a37b0 00472db0 00000000 ntdll!__RtlUserThreadStart+0x70
0187feac 00000000 0f2a37b0 00472db0 00000000 ntdll!_RtlUserThreadStart+0x1b
8 Id: 2af8.1edc Suspend: 1 Teb: 7efa0000 Unfrozen
ChildEBP RetAddr Args to Child
01a7f280 74e715ce 0000007c 00000000 00000000
ntdll!ZwWaitForSingleObject+0x15
01a7f2ec 76631194 0000007c ffffffff 00000000
KERNELBASE!WaitForSingleObjectEx+0x98
01a7f304 76631148 0000007c ffffffff 00000000
kernel32!WaitForSingleObjectExImplementation+0x75
01a7f318 011c67a8 0000007c ffffffff 01a7f588
kernel32!WaitForSingleObject+0x12
01a7f43c 011c5a65 01a7f6f0 01a7f70c 00471fe8
demo_threadx!_tx_thread_system_return+0x168 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_system_return.c @
201]
01a7f588 011c0de5 01262c90 01a7f7e4 01a7f70c
demo_threadx!_tx_thread_system_suspend+0x5a5 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_system_suspend.c @
615]
01a7f6f0 010e4338 011d76b0 00000001 00000003
demo_threadx!_tx_event_flags_get+0x205 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_event_flags_get.c @ 402]
01a7f7e4 011c5ee2 0044a3a8 01a7f9c0 01a7f8e8 demo_threadx!COM_TimerTask+0x98
[c:\cc-views\optimus_r11_ti\optimus\src\com\commanager.c @ 1739]
01a7f8e0 011c6121 00000000 00000000 00471fe8
demo_threadx!_tx_thread_shell_entry+0x72 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_shell_entry.c @
164]
01a7f9c0 0f2a3651 01262c90 170c476c 00000000
demo_threadx!_tx_win32_thread_entry+0x41 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_stack_build.c @
186]
01a7f9fc 0f2a3861 00473b78 01a7fa14 7663336a
MSVCR120D!_callthreadstartex+0x51
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 376]
01a7fa08 7663336a 00473b78 01a7fa54 77269902 MSVCR120D!_threadstartex+0xb1
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 359]
01a7fa14 77269902 00471fe8 6394bf3d 00000000
kernel32!BaseThreadInitThunk+0xe
01a7fa54 772698d5 0f2a37b0 00471fe8 00000000 ntdll!__RtlUserThreadStart+0x70
01a7fa6c 00000000 0f2a37b0 00471fe8 00000000 ntdll!_RtlUserThreadStart+0x1b
9 Id: 2af8.29c8 Suspend: 1 Teb: 7ef9d000 Unfrozen
ChildEBP RetAddr Args to Child
014ef6a8 74e715ce 00000084 00000000 00000000
ntdll!ZwWaitForSingleObject+0x15
014ef714 76631194 00000084 ffffffff 00000000
KERNELBASE!WaitForSingleObjectEx+0x98
014ef72c 76631148 00000084 ffffffff 00000000
kernel32!WaitForSingleObjectExImplementation+0x75
014ef740 011c67a8 00000084 ffffffff 014ef9b0
kernel32!WaitForSingleObject+0x12
014ef864 011c5a65 014efaf4 014efb08 00471fe8
demo_threadx!_tx_thread_system_return+0x168 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_system_return.c @
201]
014ef9b0 011c261b 01262d58 014efbf4 014efb08
demo_threadx!_tx_thread_system_suspend+0x5a5 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_system_suspend.c @
615]
014efaf4 010e6077 011d76f0 014efbd8 ffffffff
demo_threadx!_tx_queue_receive+0x4db [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_queue_receive.c @ 499]
014efbf4 011c5ee2 0044adb0 014efdd0 014efcf8
demo_threadx!ComDeferred_Task+0x97 [c:\cc-
views\optimus_r11_ti\optimus\src\com\cip\cipapp.c @ 90]
014efcf0 011c6121 00000000 00000000 00471fe8
demo_threadx!_tx_thread_shell_entry+0x72 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_shell_entry.c @
164]
014efdd0 0f2a3651 01262d58 17e5409c 00000000
demo_threadx!_tx_win32_thread_entry+0x41 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_stack_build.c @
186]
014efe0c 0f2a3861 00474170 014efe24 7663336a
MSVCR120D!_callthreadstartex+0x51
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 376]
014efe18 7663336a 00474170 014efe64 77269902 MSVCR120D!_threadstartex+0xb1
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 359]
014efe24 77269902 00471fe8 637dbb0d 00000000
kernel32!BaseThreadInitThunk+0xe
014efe64 772698d5 0f2a37b0 00471fe8 00000000 ntdll!__RtlUserThreadStart+0x70
014efe7c 00000000 0f2a37b0 00471fe8 00000000 ntdll!_RtlUserThreadStart+0x1b
10 Id: 2af8.21c4 Suspend: 2 Teb: 7ef9a000 Unfrozen
ChildEBP RetAddr Args to Child
01bbb8f0 76631314 00000007 01bbcdc8 00000002
kernel32!WriteConsoleInternal+0x15
01bbb90c 766312f5 00000007 01bbcdc8 00000002 kernel32!WriteConsoleA+0x18
01bbb928 0f37234c 00000007 01bbcdc8 00000002
kernel32!WriteFileImplementation+0x6f
01bbf5d8 0f3719bc 00000001 01bbf660 00000001 MSVCR120D!_write_nolock+0x90c
[f:\dd\vctools\crt\crtw32\lowio\write.c @ 334]
01bbf628 0f2b6c12 00000001 01bbf660 00000001 MSVCR120D!_write+0x1cc
[f:\dd\vctools\crt\crtw32\lowio\write.c @ 73]
01bbf658 0f330718 0000000a 0f3e7310 01bbf9bc MSVCR120D!_flsbuf+0x2a2
[f:\dd\vctools\crt\crtw32\stdio\_flsbuf.c @ 188]
01bbf670 0f32f54a 0000000a 0f3e7310 01bbf798 MSVCR120D!write_char+0x78
[f:\dd\vctools\crt\crtw32\stdio\output.c @ 2430]
01bbf9bc 0f2bcf81 0f3e7310 011c86d4 00000000 MSVCR120D!_output_l+0x57a
[f:\dd\vctools\crt\crtw32\stdio\output.c @ 1166]
01bbfa10 010e24e4 011c86ac fffffffe 01bbfc00 MSVCR120D!printf+0x111
[f:\dd\vctools\crt\crtw32\stdio\printf.c @ 62]
01bbfb04 011c5ee2 0044e1b8 01bbfce0 01bbfc08 demo_threadx!SYS_Task+0x74
[c:\cc-views\optimus_r11_ti\optimus\src\sys\sysmanager.c @ 1501]
01bbfc00 011c6121 00000000 00000000 00474558
demo_threadx!_tx_thread_shell_entry+0x72 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_shell_entry.c @
164]
01bbfce0 0f2a3651 01262b00 1710438c 00000000
demo_threadx!_tx_win32_thread_entry+0x41 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_stack_build.c @
186]
01bbfd1c 0f2a3861 00474b50 01bbfd34 7663336a
MSVCR120D!_callthreadstartex+0x51
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 376]
01bbfd28 7663336a 00474b50 01bbfd74 77269902 MSVCR120D!_threadstartex+0xb1
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 359]
01bbfd34 77269902 00474558 6388b81d 00000000
kernel32!BaseThreadInitThunk+0xe
01bbfd74 772698d5 0f2a37b0 00474558 00000000 ntdll!__RtlUserThreadStart+0x70
01bbfd8c 00000000 0f2a37b0 00474558 00000000 ntdll!_RtlUserThreadStart+0x1b
11 Id: 2af8.296c Suspend: 1 Teb: 7ef97000 Unfrozen
ChildEBP RetAddr Args to Child
01d0f4f8 74e715ce 00000094 00000000 00000000
ntdll!ZwWaitForSingleObject+0x15
01d0f564 76631194 00000094 ffffffff 00000000
KERNELBASE!WaitForSingleObjectEx+0x98
01d0f57c 76631148 00000094 ffffffff 00000000
kernel32!WaitForSingleObjectExImplementation+0x75
01d0f590 011c67a8 00000094 ffffffff 01d0f800
kernel32!WaitForSingleObject+0x12
01d0f6b4 011c5a65 01d0f8fc 01d0f9e0 00471fe8
demo_threadx!_tx_thread_system_return+0x168 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_system_return.c @
201]
01d0f800 011c3e12 01263398 01d0f9d4 01d0f9e0
demo_threadx!_tx_thread_system_suspend+0x5a5 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_system_suspend.c @
615]
01d0f8fc 010e7dbf 0000000a 01d0fad0 01d0f9e0
demo_threadx!_tx_thread_sleep+0xf2 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_sleep.c @ 215]
01d0f9d4 011c5ee2 004521c0 01d0fbb0 01d0fad8
demo_threadx!win_ethernet_task_entry+0x3f [c:\cc-
views\optimus_r11_ti\optimus\src\com\ethernet\enroottask.c @ 2414]
01d0fad0 011c6121 00000000 00000000 00471fe8
demo_threadx!_tx_thread_shell_entry+0x72 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_shell_entry.c @
164]
01d0fbb0 0f2a3651 01263398 177b457c 00000000
demo_threadx!_tx_win32_thread_entry+0x41 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_stack_build.c @
186]
01d0fbec 0f2a3861 00475148 01d0fc04 7663336a
MSVCR120D!_callthreadstartex+0x51
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 376]
01d0fbf8 7663336a 00475148 01d0fc44 77269902 MSVCR120D!_threadstartex+0xb1
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 359]
01d0fc04 77269902 00471fe8 63e3b92d 00000000
kernel32!BaseThreadInitThunk+0xe
01d0fc44 772698d5 0f2a37b0 00471fe8 00000000 ntdll!__RtlUserThreadStart+0x70
01d0fc5c 00000000 0f2a37b0 00471fe8 00000000 ntdll!_RtlUserThreadStart+0x1b
12 Id: 2af8.29d8 Suspend: 1 Teb: 7ef94000 Unfrozen
ChildEBP RetAddr Args to Child
01f6f3f8 74e715ce 0000009c 00000000 00000000
ntdll!ZwWaitForSingleObject+0x15
01f6f464 76631194 0000009c ffffffff 00000000
KERNELBASE!WaitForSingleObjectEx+0x98
01f6f47c 76631148 0000009c ffffffff 00000000
kernel32!WaitForSingleObjectExImplementation+0x75
01f6f490 011c67a8 0000009c ffffffff 01f6f700
kernel32!WaitForSingleObject+0x12
01f6f5b4 011c5a65 01f6f868 01f6fb70 00474558
demo_threadx!_tx_thread_system_return+0x168 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_system_return.c @
201]
01f6f700 011c0de5 01263208 01f6f95c 01f6fb70
demo_threadx!_tx_thread_system_suspend+0x5a5 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_system_suspend.c @
615]
01f6f868 010e6d19 012629a0 00000001 00000003
demo_threadx!_tx_event_flags_get+0x205 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_event_flags_get.c @ 402]
01f6f95c 01122943 01f6fb64 01f6fb70 00474558
demo_threadx!ENroot_Event_GetEndOfScan_Event+0x39 [c:\cc-
views\optimus_r11_ti\optimus\src\com\ethernet\enroottask.c @ 2378]
01f6fa30 010e7938 01262800 01f6fc60 01f6fb70
demo_threadx!EN_Start_EthernetApplication+0x23 [c:\cc-
views\optimus_r11_ti\optimus\src\com\ethernet\enapplicationmanger.c @ 133]
01f6fb64 011c5ee2 004529c8 01f6fd40 01f6fc68 demo_threadx!ENroot_Task+0x6e8
[c:\cc-views\optimus_r11_ti\optimus\src\com\ethernet\enroottask.c @ 2157]
01f6fc60 011c6121 00000000 00000000 00474558
demo_threadx!_tx_thread_shell_entry+0x72 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_shell_entry.c @
164]
01f6fd40 0f2a3651 01263208 175d43ec 00000000
demo_threadx!_tx_win32_thread_entry+0x41 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_stack_build.c @
186]
01f6fd7c 0f2a3861 00475530 01f6fd94 7663336a
MSVCR120D!_callthreadstartex+0x51
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 376]
01f6fd88 7663336a 00475530 01f6fdd4 77269902 MSVCR120D!_threadstartex+0xb1
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 359]
01f6fd94 77269902 00474558 63c5b8bd 00000000
kernel32!BaseThreadInitThunk+0xe
01f6fdd4 772698d5 0f2a37b0 00474558 00000000 ntdll!__RtlUserThreadStart+0x70
01f6fdec 00000000 0f2a37b0 00474558 00000000 ntdll!_RtlUserThreadStart+0x1b
14 Id: 2af8.2978 Suspend: 1 Teb: 7ef8e000 Unfrozen
ChildEBP RetAddr Args to Child
0197f57c 74e715ce 000000d0 00000000 00000000
ntdll!ZwWaitForSingleObject+0x15
0197f5e8 76631194 000000d0 ffffffff 00000000
KERNELBASE!WaitForSingleObjectEx+0x98
0197f600 76631148 000000d0 ffffffff 00000000
kernel32!WaitForSingleObjectExImplementation+0x75
0197f614 011c67a8 000000d0 ffffffff 0197f884
kernel32!WaitForSingleObject+0x12
0197f738 011c5a65 0197f980 0197fa70 004a1a88
demo_threadx!_tx_thread_system_return+0x168 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_system_return.c @
201]
0197f884 011c3e12 01262888 0197fa64 0197fa70
demo_threadx!_tx_thread_system_suspend+0x5a5 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_system_suspend.c @
615]
0197f980 0111e6a9 0000000a 0197fb60 0197fa70
demo_threadx!_tx_thread_sleep+0xf2 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_sleep.c @ 215]
0197fa64 011c5ee2 01262800 0197fc40 0197fb68
demo_threadx!win_ip_thread_entry+0x39 [c:\cc-
views\optimus_r11_ti\optimus\src\win32\tcp_ip\src\opt_win_netx_wrapper.c @
648]
0197fb60 011c6121 00000000 00000000 004a1a88
demo_threadx!_tx_thread_shell_entry+0x72 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_shell_entry.c @
164]
0197fc40 0f2a3651 01262888 173c42ec 00000000
demo_threadx!_tx_win32_thread_entry+0x41 [c:\cc-
views\optimus_r11_ti\optimus\ext\threadx_win32\tx_thread_stack_build.c @
186]
0197fc7c 0f2a3861 0049fd78 0197fc94 7663336a
MSVCR120D!_callthreadstartex+0x51
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 376]
0197fc88 7663336a 0049fd78 0197fcd4 77269902 MSVCR120D!_threadstartex+0xb1
[f:\dd\vctools\crt\crtw32\startup\threadex.c @ 359]
0197fc94 77269902 004a1a88 63a4b9bd 00000000
kernel32!BaseThreadInitThunk+0xe
0197fcd4 772698d5 0f2a37b0 004a1a88 00000000 ntdll!__RtlUserThreadStart+0x70
0197fcec 00000000 0f2a37b0 004a1a88 00000000 ntdll!_RtlUserThreadStart+0x1b
The problem isn't in printf
. Only threads 6 and 10 are making calls to printf
; thread 10 is suspended, and thread 6 is waiting on thread 10 to release the CRT lock.
The most likely cause is a logic error in your program causing it to leave thread 10 suspended, although it is also possible that Symantec Endpoint Protection is causing your program to malfunction. It is also possible that you are deadlocking due to the inherent risks of suspending threads in-process, although I can find no obvious signs of this problem in this particular case.
If you find you are still unable to resolve the problem yourself and want assistance, please post a new question including a Minimal, Complete, and Verifiable Example.
See also:
User contributions licensed under CC BY-SA 3.0