Discussion:
Huge number of unmanaged threads in managed .NET WinForm app
(too old to reply)
Dave Black
2010-08-30 20:17:03 UTC
Permalink
Raw Message
Hi all,

I'm hoping someone can help provide any clues on what is going on with a
crash dump I have.

When I use !threads I get:
ThreadCount: 39
UnstartedThread: 0
BackgroundThread: 22
PendingThread: 0
DeadThread: 16
Hosted Runtime: no

When I run ~ I get a total of 385 threads!!!! All of which are listed as
"Suspend", "Unfrozen". Clearly, there looks to be a thread leak here. We
are using P/Invoke for some Win32 stuff but nothing related to threads.
Every use of Threads in our app is thru .NET.

Any ideas what is going on? Where could all of these native threads be
coming from?
--
2b || !2b
Dave Black
2010-11-02 14:24:00 UTC
Permalink
Raw Message
Solution found:
I found thru further digging in the dump file that the problem was related to a Citrix .dll - rsintcor32.

There were 3 different callstacks that would enter 'rsintcor32' and apparently cause the native threads to never be released:

Following call stack occurred 344 times:
12 Id: 2dd4.511c Suspend: 0 Teb: 7ef74000 Unfrozen
ChildEBP RetAddr
0dd3fdf4 74d976bc ntdll_771c0000!NtRemoveIoCompletion+0x15
0dd3fe20 6ad7187b KERNELBASE!GetQueuedCompletionStatus+0x29
WARNING: Stack unwind information not available. Following frames may be wrong.
0dd3fe6c 650142b0 rsintcor32+0x187b
0dd3fea0 75263677 System_Data!SNIAsyncWait+0x6c [f:\dd\ndp\fx\src\data\sni\src\sni.cpp @ 3554]
0dd3feac 771f9d42 kernel32!BaseThreadInitThunk+0xe
0dd3feec 771f9d15 ntdll_771c0000!__RtlUserThreadStart+0x70
0dd3ff04 00000000 ntdll_771c0000!_RtlUserThreadStart+0x1b


Following call stack occurred 1 time:
14 Id: 2dd4.3620 Suspend: 0 Teb: 7ef71000 Unfrozen
ChildEBP RetAddr
10bcfd90 75758165 user32!NtUserGetMessage+0x15
10bcfdb0 6ad716c9 user32!GetMessageA+0xa1
WARNING: Stack unwind information not available. Following frames may be wrong.
10bcfde8 6dc027b2 rsintcor32+0x16c9
10bcfe20 75263677 winmm!mciwindow+0x102
10bcfe2c 771f9d42 kernel32!BaseThreadInitThunk+0xe
10bcfe6c 771f9d15 ntdll_771c0000!__RtlUserThreadStart+0x70
10bcfe84 00000000 ntdll_771c0000!_RtlUserThreadStart+0x1b


Following call stack occurred 1 time:
16 Id: 2dd4.595c Suspend: 0 Teb: 7ef5a000 Unfrozen
ChildEBP RetAddr
13b2f810 735e17cd ntdll_771c0000!ZwWaitForSingleObject+0x15
WARNING: Frame IP not in any known module. Following frames may be wrong.
13b2f850 735e678c mswsock+0x17cd
13b2f93c 76c54a20 mswsock+0x678c
13b2f9bc 6ad7fa2d ws2_32!select+0x494
13b2fa08 76ccb654 rsintcor32!RslLoadedTerm+0x7c55
13b2fd60 76cba48b wininet!ICAsyncThread::SelectThread+0x25a
13b2fd68 75263677 wininet!ICAsyncThread::SelectThreadWrapper+0xd
13b2fd74 771f9d42 kernel32!BaseThreadInitThunk+0xe
13b2fdb4 771f9d15 ntdll_771c0000!__RtlUserThreadStart+0x70
13b2fdcc 00000000 ntdll_771c0000!_RtlUserThreadStart+0x1b
Post by Dave Black
Hi all,
I am hoping someone can help provide any clues on what is going on with a
crash dump I have.
ThreadCount: 39
UnstartedThread: 0
BackgroundThread: 22
PendingThread: 0
DeadThread: 16
Hosted Runtime: no
When I run ~ I get a total of 385 threads!!!! All of which are listed as
"Suspend", "Unfrozen". Clearly, there looks to be a thread leak here. We
are using P/Invoke for some Win32 stuff but nothing related to threads.
Every use of Threads in our app is thru .NET.
Any ideas what is going on? Where could all of these native threads be
coming from?
--
2b || !2b
Submitted via EggHeadCafe - Software Developer Portal of Choice
Visual Studio Async CTP Overview
http://www.eggheadcafe.com/tutorials/aspnet/e78665f9-b949-4cc7-a024-654eb3bbad6d/visual-studio-async-ctp-overview.aspx
Dave Black
2010-11-02 14:25:01 UTC
Permalink
Raw Message
Solution found:
I found thru further digging in the dump file that the problem was related to a Citrix .dll - rsintcor32.

There were 3 different callstacks that would enter 'rsintcor32' and apparently cause the native threads to never be released:

Following call stack occurred 344 times:
12 Id: 2dd4.511c Suspend: 0 Teb: 7ef74000 Unfrozen
ChildEBP RetAddr
0dd3fdf4 74d976bc ntdll_771c0000!NtRemoveIoCompletion+0x15
0dd3fe20 6ad7187b KERNELBASE!GetQueuedCompletionStatus+0x29
WARNING: Stack unwind information not available. Following frames may be wrong.
0dd3fe6c 650142b0 rsintcor32+0x187b
0dd3fea0 75263677 System_Data!SNIAsyncWait+0x6c [f:\dd\ndp\fx\src\data\sni\src\sni.cpp @ 3554]
0dd3feac 771f9d42 kernel32!BaseThreadInitThunk+0xe
0dd3feec 771f9d15 ntdll_771c0000!__RtlUserThreadStart+0x70
0dd3ff04 00000000 ntdll_771c0000!_RtlUserThreadStart+0x1b


Following call stack occurred 1 time:
14 Id: 2dd4.3620 Suspend: 0 Teb: 7ef71000 Unfrozen
ChildEBP RetAddr
10bcfd90 75758165 user32!NtUserGetMessage+0x15
10bcfdb0 6ad716c9 user32!GetMessageA+0xa1
WARNING: Stack unwind information not available. Following frames may be wrong.
10bcfde8 6dc027b2 rsintcor32+0x16c9
10bcfe20 75263677 winmm!mciwindow+0x102
10bcfe2c 771f9d42 kernel32!BaseThreadInitThunk+0xe
10bcfe6c 771f9d15 ntdll_771c0000!__RtlUserThreadStart+0x70
10bcfe84 00000000 ntdll_771c0000!_RtlUserThreadStart+0x1b


Following call stack occurred 1 time:
16 Id: 2dd4.595c Suspend: 0 Teb: 7ef5a000 Unfrozen
ChildEBP RetAddr
13b2f810 735e17cd ntdll_771c0000!ZwWaitForSingleObject+0x15
WARNING: Frame IP not in any known module. Following frames may be wrong.
13b2f850 735e678c mswsock+0x17cd
13b2f93c 76c54a20 mswsock+0x678c
13b2f9bc 6ad7fa2d ws2_32!select+0x494
13b2fa08 76ccb654 rsintcor32!RslLoadedTerm+0x7c55
13b2fd60 76cba48b wininet!ICAsyncThread::SelectThread+0x25a
13b2fd68 75263677 wininet!ICAsyncThread::SelectThreadWrapper+0xd
13b2fd74 771f9d42 kernel32!BaseThreadInitThunk+0xe
13b2fdb4 771f9d15 ntdll_771c0000!__RtlUserThreadStart+0x70
13b2fdcc 00000000 ntdll_771c0000!_RtlUserThreadStart+0x1b
Post by Dave Black
Hi all,
I am hoping someone can help provide any clues on what is going on with a
crash dump I have.
ThreadCount: 39
UnstartedThread: 0
BackgroundThread: 22
PendingThread: 0
DeadThread: 16
Hosted Runtime: no
When I run ~ I get a total of 385 threads!!!! All of which are listed as
"Suspend", "Unfrozen". Clearly, there looks to be a thread leak here. We
are using P/Invoke for some Win32 stuff but nothing related to threads.
Every use of Threads in our app is thru .NET.
Any ideas what is going on? Where could all of these native threads be
coming from?
--
2b || !2b
Post by Dave Black
I found thru further digging in the dump file that the problem was related to a Citrix .dll - rsintcor32.
12 Id: 2dd4.511c Suspend: 0 Teb: 7ef74000 Unfrozen
ChildEBP RetAddr
0dd3fdf4 74d976bc ntdll_771c0000!NtRemoveIoCompletion+0x15
0dd3fe20 6ad7187b KERNELBASE!GetQueuedCompletionStatus+0x29
WARNING: Stack unwind information not available. Following frames may be wrong.
0dd3fe6c 650142b0 rsintcor32+0x187b
0dd3feac 771f9d42 kernel32!BaseThreadInitThunk+0xe
0dd3feec 771f9d15 ntdll_771c0000!__RtlUserThreadStart+0x70
0dd3ff04 00000000 ntdll_771c0000!_RtlUserThreadStart+0x1b
14 Id: 2dd4.3620 Suspend: 0 Teb: 7ef71000 Unfrozen
ChildEBP RetAddr
10bcfd90 75758165 user32!NtUserGetMessage+0x15
10bcfdb0 6ad716c9 user32!GetMessageA+0xa1
WARNING: Stack unwind information not available. Following frames may be wrong.
10bcfde8 6dc027b2 rsintcor32+0x16c9
10bcfe20 75263677 winmm!mciwindow+0x102
10bcfe2c 771f9d42 kernel32!BaseThreadInitThunk+0xe
10bcfe6c 771f9d15 ntdll_771c0000!__RtlUserThreadStart+0x70
10bcfe84 00000000 ntdll_771c0000!_RtlUserThreadStart+0x1b
16 Id: 2dd4.595c Suspend: 0 Teb: 7ef5a000 Unfrozen
ChildEBP RetAddr
13b2f810 735e17cd ntdll_771c0000!ZwWaitForSingleObject+0x15
WARNING: Frame IP not in any known module. Following frames may be wrong.
13b2f850 735e678c mswsock+0x17cd
13b2f93c 76c54a20 mswsock+0x678c
13b2f9bc 6ad7fa2d ws2_32!select+0x494
13b2fa08 76ccb654 rsintcor32!RslLoadedTerm+0x7c55
13b2fd60 76cba48b wininet!ICAsyncThread::SelectThread+0x25a
13b2fd68 75263677 wininet!ICAsyncThread::SelectThreadWrapper+0xd
13b2fd74 771f9d42 kernel32!BaseThreadInitThunk+0xe
13b2fdb4 771f9d15 ntdll_771c0000!__RtlUserThreadStart+0x70
13b2fdcc 00000000 ntdll_771c0000!_RtlUserThreadStart+0x1b
Submitted via EggHeadCafe - Software Developer Portal of Choice
Visual Studio Async CTP Overview
http://www.eggheadcafe.com/tutorials/aspnet/e78665f9-b949-4cc7-a024-654eb3bbad6d/visual-studio-async-ctp-overview.aspx
Dave Black
2010-11-02 14:25:26 UTC
Permalink
Raw Message
Solution found:
I found thru further digging in the dump file that the problem was related to a Citrix .dll - rsintcor32.

There were 3 different callstacks that would enter 'rsintcor32' and apparently cause the native threads to never be released:

Following call stack occurred 344 times:
12 Id: 2dd4.511c Suspend: 0 Teb: 7ef74000 Unfrozen
ChildEBP RetAddr
0dd3fdf4 74d976bc ntdll_771c0000!NtRemoveIoCompletion+0x15
0dd3fe20 6ad7187b KERNELBASE!GetQueuedCompletionStatus+0x29
WARNING: Stack unwind information not available. Following frames may be wrong.
0dd3fe6c 650142b0 rsintcor32+0x187b
0dd3fea0 75263677 System_Data!SNIAsyncWait+0x6c [f:\dd\ndp\fx\src\data\sni\src\sni.cpp @ 3554]
0dd3feac 771f9d42 kernel32!BaseThreadInitThunk+0xe
0dd3feec 771f9d15 ntdll_771c0000!__RtlUserThreadStart+0x70
0dd3ff04 00000000 ntdll_771c0000!_RtlUserThreadStart+0x1b


Following call stack occurred 1 time:
14 Id: 2dd4.3620 Suspend: 0 Teb: 7ef71000 Unfrozen
ChildEBP RetAddr
10bcfd90 75758165 user32!NtUserGetMessage+0x15
10bcfdb0 6ad716c9 user32!GetMessageA+0xa1
WARNING: Stack unwind information not available. Following frames may be wrong.
10bcfde8 6dc027b2 rsintcor32+0x16c9
10bcfe20 75263677 winmm!mciwindow+0x102
10bcfe2c 771f9d42 kernel32!BaseThreadInitThunk+0xe
10bcfe6c 771f9d15 ntdll_771c0000!__RtlUserThreadStart+0x70
10bcfe84 00000000 ntdll_771c0000!_RtlUserThreadStart+0x1b


Following call stack occurred 1 time:
16 Id: 2dd4.595c Suspend: 0 Teb: 7ef5a000 Unfrozen
ChildEBP RetAddr
13b2f810 735e17cd ntdll_771c0000!ZwWaitForSingleObject+0x15
WARNING: Frame IP not in any known module. Following frames may be wrong.
13b2f850 735e678c mswsock+0x17cd
13b2f93c 76c54a20 mswsock+0x678c
13b2f9bc 6ad7fa2d ws2_32!select+0x494
13b2fa08 76ccb654 rsintcor32!RslLoadedTerm+0x7c55
13b2fd60 76cba48b wininet!ICAsyncThread::SelectThread+0x25a
13b2fd68 75263677 wininet!ICAsyncThread::SelectThreadWrapper+0xd
13b2fd74 771f9d42 kernel32!BaseThreadInitThunk+0xe
13b2fdb4 771f9d15 ntdll_771c0000!__RtlUserThreadStart+0x70
13b2fdcc 00000000 ntdll_771c0000!_RtlUserThreadStart+0x1b
Post by Dave Black
Hi all,
I am hoping someone can help provide any clues on what is going on with a
crash dump I have.
ThreadCount: 39
UnstartedThread: 0
BackgroundThread: 22
PendingThread: 0
DeadThread: 16
Hosted Runtime: no
When I run ~ I get a total of 385 threads!!!! All of which are listed as
"Suspend", "Unfrozen". Clearly, there looks to be a thread leak here. We
are using P/Invoke for some Win32 stuff but nothing related to threads.
Every use of Threads in our app is thru .NET.
Any ideas what is going on? Where could all of these native threads be
coming from?
--
2b || !2b
Post by Dave Black
I found thru further digging in the dump file that the problem was related to a Citrix .dll - rsintcor32.
12 Id: 2dd4.511c Suspend: 0 Teb: 7ef74000 Unfrozen
ChildEBP RetAddr
0dd3fdf4 74d976bc ntdll_771c0000!NtRemoveIoCompletion+0x15
0dd3fe20 6ad7187b KERNELBASE!GetQueuedCompletionStatus+0x29
WARNING: Stack unwind information not available. Following frames may be wrong.
0dd3fe6c 650142b0 rsintcor32+0x187b
0dd3feac 771f9d42 kernel32!BaseThreadInitThunk+0xe
0dd3feec 771f9d15 ntdll_771c0000!__RtlUserThreadStart+0x70
0dd3ff04 00000000 ntdll_771c0000!_RtlUserThreadStart+0x1b
14 Id: 2dd4.3620 Suspend: 0 Teb: 7ef71000 Unfrozen
ChildEBP RetAddr
10bcfd90 75758165 user32!NtUserGetMessage+0x15
10bcfdb0 6ad716c9 user32!GetMessageA+0xa1
WARNING: Stack unwind information not available. Following frames may be wrong.
10bcfde8 6dc027b2 rsintcor32+0x16c9
10bcfe20 75263677 winmm!mciwindow+0x102
10bcfe2c 771f9d42 kernel32!BaseThreadInitThunk+0xe
10bcfe6c 771f9d15 ntdll_771c0000!__RtlUserThreadStart+0x70
10bcfe84 00000000 ntdll_771c0000!_RtlUserThreadStart+0x1b
16 Id: 2dd4.595c Suspend: 0 Teb: 7ef5a000 Unfrozen
ChildEBP RetAddr
13b2f810 735e17cd ntdll_771c0000!ZwWaitForSingleObject+0x15
WARNING: Frame IP not in any known module. Following frames may be wrong.
13b2f850 735e678c mswsock+0x17cd
13b2f93c 76c54a20 mswsock+0x678c
13b2f9bc 6ad7fa2d ws2_32!select+0x494
13b2fa08 76ccb654 rsintcor32!RslLoadedTerm+0x7c55
13b2fd60 76cba48b wininet!ICAsyncThread::SelectThread+0x25a
13b2fd68 75263677 wininet!ICAsyncThread::SelectThreadWrapper+0xd
13b2fd74 771f9d42 kernel32!BaseThreadInitThunk+0xe
13b2fdb4 771f9d15 ntdll_771c0000!__RtlUserThreadStart+0x70
13b2fdcc 00000000 ntdll_771c0000!_RtlUserThreadStart+0x1b
Post by Dave Black
I found thru further digging in the dump file that the problem was related to a Citrix .dll - rsintcor32.
12 Id: 2dd4.511c Suspend: 0 Teb: 7ef74000 Unfrozen
ChildEBP RetAddr
0dd3fdf4 74d976bc ntdll_771c0000!NtRemoveIoCompletion+0x15
0dd3fe20 6ad7187b KERNELBASE!GetQueuedCompletionStatus+0x29
WARNING: Stack unwind information not available. Following frames may be wrong.
0dd3fe6c 650142b0 rsintcor32+0x187b
0dd3feac 771f9d42 kernel32!BaseThreadInitThunk+0xe
0dd3feec 771f9d15 ntdll_771c0000!__RtlUserThreadStart+0x70
0dd3ff04 00000000 ntdll_771c0000!_RtlUserThreadStart+0x1b
14 Id: 2dd4.3620 Suspend: 0 Teb: 7ef71000 Unfrozen
ChildEBP RetAddr
10bcfd90 75758165 user32!NtUserGetMessage+0x15
10bcfdb0 6ad716c9 user32!GetMessageA+0xa1
WARNING: Stack unwind information not available. Following frames may be wrong.
10bcfde8 6dc027b2 rsintcor32+0x16c9
10bcfe20 75263677 winmm!mciwindow+0x102
10bcfe2c 771f9d42 kernel32!BaseThreadInitThunk+0xe
10bcfe6c 771f9d15 ntdll_771c0000!__RtlUserThreadStart+0x70
10bcfe84 00000000 ntdll_771c0000!_RtlUserThreadStart+0x1b
16 Id: 2dd4.595c Suspend: 0 Teb: 7ef5a000 Unfrozen
ChildEBP RetAddr
13b2f810 735e17cd ntdll_771c0000!ZwWaitForSingleObject+0x15
WARNING: Frame IP not in any known module. Following frames may be wrong.
13b2f850 735e678c mswsock+0x17cd
13b2f93c 76c54a20 mswsock+0x678c
13b2f9bc 6ad7fa2d ws2_32!select+0x494
13b2fa08 76ccb654 rsintcor32!RslLoadedTerm+0x7c55
13b2fd60 76cba48b wininet!ICAsyncThread::SelectThread+0x25a
13b2fd68 75263677 wininet!ICAsyncThread::SelectThreadWrapper+0xd
13b2fd74 771f9d42 kernel32!BaseThreadInitThunk+0xe
13b2fdb4 771f9d15 ntdll_771c0000!__RtlUserThreadStart+0x70
13b2fdcc 00000000 ntdll_771c0000!_RtlUserThreadStart+0x1b
Submitted via EggHeadCafe - Software Developer Portal of Choice
Composing WCF applications
http://www.eggheadcafe.com/tutorials/aspnet/b428fb65-08b4-45c8-97cd-47ee1a1eaf41/composing-wcf-applications.aspx
Loading...