Hi,
I am trying to query an LDAP server to fetch user password
expiration details. We want to show a warning message if this user's
password is about to expire. The application works fine for some time (varying from 5 - 6 login attempts to 25 -30 login attempts) and then w3wp
starts consuming 25% of CPU and eventually stops responding to any request. In
my code (C#), I am disposing all LDAP related objects in finally block. I have also added some
timeouts (LDAP client and server timeouts) to make sure that application won’t
wait if the LDAP server is not responding in a reasonable time. I also tried to
run iisstate to see what all threads are running but couldn’t identify anything
significant from that information ( I don’t have good knowledge of how to debug
stack trace information generated by the iisstate). So, right now I
have no clue about what is going wrong.
I checked the threads that were running in w3wp process when
it started consuming 25% CPU time. There was one thread msvcrt.dll!endthread
that was eating up 25% CPU time.
I am not sure what this thread does. I also saw couple of
other threads like ntdll.dll! RtlOpenCurrentUser and I am not sure how/whether they are
related.
I wonder if anyone can help to understand what are msvcrt.dll
ntdll.dll and w3tp.dl processes and how they are used by w3wp( if they are used by w3wp
process). What is RtlOpenCurrentUser in ntdll.dll
I am sending the stack trace generated by iisstate. Please
let me know if you figured out something from this trace.
***********************
Symbol search path is:
SRV*C:\iisstate\symbols*http://msdl.microsoft.com/download/symbols
Microsoft (R) Windows Debugger Version 6.2.0013.1
Copyright (c) Microsoft Corporation. All rights reserved.
*** wait with pending attach
Symbol search path is: SRV*C:\iisstate\symbols*http://msdl.microsoft.com/download/symbols
Executable search path is:
WARNING: Process 4532 is not attached as a debuggee
The process
can be examined but debug events will not be received
.........................................................................................................................................
The call to LoadLibrary(exts) failed, Win32 error 2
"The system
cannot find the file specified."
Please check your debugger configuration and/or network
access.
(11b4.774): Wake debugger - code 80000007 (first chance)
Opened log file 'C:\iisstate\output\IISState-4532.log'
***********************
Starting new log output
IISState version 3.3.1
Tue Oct 09 11:47:14 2007
OS = Windows 2003 Server
Executable: w3wp.exe
PID = 4532
Note: Thread times are formatted as HH:MM:SS.ms
***********************
Thread ID: 0
System Thread ID: 774
Kernel Time: 0:0:0.31
User Time: 0:0:0.109
Thread Status: Thread is in a WAIT state.
Thread Type: HTTP Compression Thread
# ChildEBP
RetAddr
00 0006fc08 7c827d0b ntdll!KiFastSystemCallRet
01 0006fc0c 77e61d1e ntdll!NtWaitForSingleObject+0xc
02 0006fc7c 77e61c8d kernel32!WaitForSingleObjectEx+0xac
03 0006fc90 5a364662 kernel32!WaitForSingleObject+0x12
04 0006fca0 5a366e3f w3dt!WP_CONTEXT::RunMainThreadLoop+0x10
05 0006fca8 5a3af42d w3dt!UlAtqStartListen+0x2d
06 0006fcb8 5a3bc335 w3core!W3_SERVER::StartListen+0xbd
07 0006ff0c 0100187c w3core!UlW3Start+0x26e
08 0006ff44 01001a27 w3wp!wmain+0x22a
09 0006ffc0 77e6f23b w3wp!wmainCRTStartup+0x12f
0a 0006fff0 00000000 kernel32!BaseProcessStart+0x23
Thread ID: 1
System Thread ID: 3a4
Kernel Time: 0:0:0.0
User Time: 0:0:0.0
Thread Type: Other
# ChildEBP
RetAddr
00 00ccff9c 7c826f4b ntdll!KiFastSystemCallRet
01 00ccffa0 7c83d424 ntdll!NtDelayExecution+0xc
02 00ccffb8 77e64829 ntdll!RtlpTimerThread+0x47
03 00ccffec 00000000 kernel32!BaseThreadStart+0x34
Thread ID: 2
System Thread ID: 17f4
Kernel Time: 0:0:0.0
User Time: 0:0:0.0
Thread Type: Other
# ChildEBP
RetAddr
00 00d0ff70 7c8277db ntdll!KiFastSystemCallRet
01 00d0ff74 7c839f38 ntdll!ZwRemoveIoCompletion+0xc
02 00d0ffb8 77e64829 ntdll!RtlpWorkerThread+0x3d
03 00d0ffec 00000000 kernel32!BaseThreadStart+0x34
Thread ID: 3
System Thread ID: 1ab8
Kernel Time: 0:0:0.0
User Time: 0:0:0.0
Thread Type: Possible ASP page. Possible DCOM activity
Executing Page: Unable to locate ASP page
No remote call being made
# ChildEBP
RetAddr
00 00d7fe18 7c82783b ntdll!KiFastSystemCallRet
01 00d7fe1c 77c885ac ntdll!NtReplyWaitReceivePortEx+0xc
02 00d7ff84 77c88792
RPCRT4!LRPC_ADDRESS::ReceiveLotsaCalls+0x198
03 00d7ff8c 77c8872d RPCRT4!RecvLotsaCallsWrapper+0xd
04 00d7ffac 77c7b110 RPCRT4!BaseCachedThreadRoutine+0x9d
05 00d7ffb8 77e64829 RPCRT4!ThreadStartRoutine+0x1b
06 00d7ffec 00000000 kernel32!BaseThreadStart+0x34
Thread ID: 4
System Thread ID: 1aa0
Kernel Time: 0:0:0.0
User Time: 0:0:0.0
Thread Type: HTTP Listener
# ChildEBP
RetAddr
00 00f7ff24 7c8277db ntdll!KiFastSystemCallRet
01 00f7ff28 77e5bea2 ntdll!ZwRemoveIoCompletion+0xc
02 00f7ff54 5a30248e kernel32!GetQueuedCompletionStatus+0x29
03 00f7ff8c 5a3026ac
W3TP!THREAD_POOL_DATA::ThreadPoolThread+0x33
04 00f7ffa0 5a301da9
W3TP!THREAD_POOL_DATA::ThreadPoolThread+0x24
05 00f7ffb8 77e64829 W3TP!THREAD_MANAGER::ThreadManagerThread+0x39
06 00f7ffec 00000000 kernel32!BaseThreadStart+0x34
Thread ID: 5
System Thread ID: b30
Kernel Time: 0:0:0.0
User Time: 0:0:0.0
Thread Type: HTTP Listener
# ChildEBP
RetAddr
00 00fbff24 7c8277db ntdll!KiFastSystemCallRet
01 00fbff28 77e5bea2 ntdll!ZwRemoveIoCompletion+0xc
02 00fbff54 5a30248e kernel32!GetQueuedCompletionStatus+0x29
03 00fbff8c 5a3026ac
W3TP!THREAD_POOL_DATA::ThreadPoolThread+0x33
04 00fbffa0 5a301da9
W3TP!THREAD_POOL_DATA::ThreadPoolThread+0x24
05 00fbffb8 77e64829 W3TP!THREAD_MANAGER::ThreadManagerThread+0x39
06 00fbffec 00000000 kernel32!BaseThreadStart+0x34
Thread ID: 6
System Thread ID: 1760
Kernel Time: 0:0:0.0
User Time: 0:0:0.15
Thread Type: HTTP Listener
# ChildEBP
RetAddr
00 00ffff24 7c8277db ntdll!KiFastSystemCallRet
01 00ffff28 77e5bea2 ntdll!ZwRemoveIoCompletion+0xc
02 00ffff54 5a30248e kernel32!GetQueuedCompletionStatus+0x29
03 00ffff8c 5a3026ac
W3TP!THREAD_POOL_DATA::ThreadPoolThread+0x33
04 00ffffa0 5a301da9
W3TP!THREAD_POOL_DATA::ThreadPoolThread+0x24
05 00ffffb8 77e64829
W3TP!THREAD_MANAGER::ThreadManagerThread+0x39
06 00ffffec 00000000 kernel32!BaseThreadStart+0x34
Thread ID: 7
System Thread ID: 520
Kernel Time: 0:0:0.46
User Time: 0:0:0.0
Thread Type: HTTP Listener
# ChildEBP
RetAddr
00 0104ff24 7c8277db ntdll!KiFastSystemCallRet
01 0104ff28 77e5bea2 ntdll!ZwRemoveIoCompletion+0xc
02 0104ff54 5a30248e kernel32!GetQueuedCompletionStatus+0x29
03 0104ff8c 5a3026ac
W3TP!THREAD_POOL_DATA::ThreadPoolThread+0x33
04 0104ffa0 5a301da9 W3TP!THREAD_POOL_DATA::ThreadPoolThread+0x24
05 0104ffb8 77e64829
W3TP!THREAD_MANAGER::ThreadManagerThread+0x39
06 0104ffec 00000000 kernel32!BaseThreadStart+0x34
Thread ID: 8
System Thread ID: b68
Kernel Time: 0:0:0.0
User Time: 0:0:0.0
Thread Status: Thread is in a WAIT state.
Thread Type: Other
# ChildEBP
RetAddr
00 0110fcec 7c827cfb ntdll!KiFastSystemCallRet
01 0110fcf0 7c83c78e ntdll!NtWaitForMultipleObjects+0xc
02 0110ffb8 77e64829 ntdll!RtlpWaitThread+0x161
03 0110ffec 00000000 kernel32!BaseThreadStart+0x34
Thread ID: 9
System Thread ID: 220
Kernel Time: 0:0:0.0
User Time: 0:0:0.0
Thread Status: Thread is in a WAIT state.
Thread Type: HTTP Compression Thread
# ChildEBP
RetAddr
00 01adfa84 7c827d0b ntdll!KiFastSystemCallRet
01 01adfa88 77e61d1e ntdll!NtWaitForSingleObject+0xc
02 01adfaf8 77e61c8d kernel32!WaitForSingleObjectEx+0xac
03 01adfb0c 5a3b820f kernel32!WaitForSingleObject+0x12
04 01adffb8 77e64829
w3core!HTTP_COMPRESSION::CompressionThread+0x126
05 01adffec 00000000 kernel32!BaseThreadStart+0x34
Thread ID: 10
System Thread ID: 1054
Kernel Time: 0:0:0.0
User Time: 0:0:0.0
Thread Type: Possible ASP page. Possible DCOM activity
Executing Page: Unable to locate ASP page
No remote call being made
# ChildEBP
RetAddr
00 01b1fe18 7c82783b ntdll!KiFastSystemCallRet
01 01b1fe1c 77c885ac ntdll!NtReplyWaitReceivePortEx+0xc
02 01b1ff84 77c88792
RPCRT4!LRPC_ADDRESS::ReceiveLotsaCalls+0x198
03 01b1ff8c 77c8872d RPCRT4!RecvLotsaCallsWrapper+0xd
04 01b1ffac 77c7b110 RPCRT4!BaseCachedThreadRoutine+0x9d
05 01b1ffb8 77e64829 RPCRT4!ThreadStartRoutine+0x1b
06 01b1ffec 00000000 kernel32!BaseThreadStart+0x34
Thread ID: 11
System Thread ID: 19ac
Kernel Time: 0:0:0.0
User Time: 0:0:0.0
Thread Type: Other
# ChildEBP
RetAddr
00 01b5ff8c 7c826f4b ntdll!KiFastSystemCallRet
01 01b5ff90 7c81943a ntdll!NtDelayExecution+0xc
02 01b5ffb8 77e64829 ntdll!RtlpIOWorkerThread+0x3f
03 01b5ffec 00000000 kernel32!BaseThreadStart+0x34
Thread ID: 12
System Thread ID: b24
Kernel Time: 0:0:0.0
User Time: 0:0:0.0
Thread Status: Thread is in a WAIT state.
Thread Type: ASP
Executing Page: Unable to locate ASP page
# ChildEBP
RetAddr
00 0275ff0c 7c827d0b ntdll!KiFastSystemCallRet
01 0275ff10 77e61d1e ntdll!NtWaitForSingleObject+0xc
02 0275ff80 77e61c8d kernel32!WaitForSingleObjectEx+0xac
03 0275ff94 709fc803 kernel32!WaitForSingleObject+0x12
04 0275ffb4 709fc7db
asp!CApplnCleanupMgr::ApplnCleanupDoWork+0x1e
05 0275ffb8 77e64829
asp!CApplnCleanupMgr::ApplnCleanupThread+0xa
06 0275ffec 00000000 kernel32!BaseThreadStart+0x34
Thread ID: 13
System Thread ID: 1d64
Kernel Time: 0:0:0.0
User Time: 0:0:0.0
Thread Status: Thread is in a WAIT state.
Thread Type: ASP
Executing Page: Unable to locate ASP page
# ChildEBP
RetAddr
00 02a1fe1c 7c827cfb ntdll!KiFastSystemCallRet
01 02a1fe20 77e6202c ntdll!NtWaitForMultipleObjects+0xc
02 02a1fec8 7739bbd1 kernel32!WaitForMultipleObjectsEx+0x11a
03 02a1ff24 7739ce36
USER32!RealMsgWaitForMultipleObjectsEx+0x141
04 02a1ff40 709fb8be USER32!MsgWaitForMultipleObjects+0x1f
05 02a1ff84 77bcb530 asp!CMTACallbackThread::Thread+0x4f
06 02a1ffb8 77e64829 msvcrt!_endthreadex+0xa3
07 02a1ffec 00000000 kernel32!BaseThreadStart+0x34
Thread ID: 14
System Thread ID: ba4
Kernel Time: 0:0:0.0
User Time: 0:0:0.0
Thread Status: Thread is in a WAIT state.
Thread Type: ASP
Executing Page: Unable to locate ASP page
# ChildEBP
RetAddr
00 0318fef4 7c827d0b ntdll!KiFastSystemCallRet
01 0318fef8 77e61d1e ntdll!NtWaitForSingleObject+0xc
02 0318ff68 77e61c8d kernel32!WaitForSingleObjectEx+0xac
03 0318ff7c 709fe8ef kernel32!WaitForSingleObject+0x12
04 0318ffb8 77e64829 asp!CViperReqManager::WatchThread+0x68
05 0318ffec 00000000 kernel32!BaseThreadStart+0x34
Thread ID: 15
System Thread ID: 15e0
Kernel Time: 0:0:0.0
User Time: 0:0:0.0
Thread Status: Thread is in a WAIT state.
Thread Type: Idle ASP thread
# ChildEBP
RetAddr
00 0321fee8 7c827d0b ntdll!KiFastSystemCallRet
01 0321feec 77e61d1e ntdll!NtWaitForSingleObject+0xc
02 0321ff5c 77e61c8d kernel32!WaitForSingleObjectEx+0xac
03 0321ff70 4a77921b kernel32!WaitForSingleObject+0x12
04 0321ff84 77bcb530
comsvcs!CSTAThreadPool::LoadBalanceThreadControlLoop+0x29
05 0321ffb8 77e64829 msvcrt!_endthreadex+0xa3
06 0321ffec 00000000 kernel32!BaseThreadStart+0x34
Thread ID: 16
System Thread ID: 156c
Kernel Time: 0:0:0.0
User Time: 0:0:0.0
Thread Status: Thread is in a WAIT state.
Thread Type: Idle ASP thread
# ChildEBP
RetAddr
00 0325fee0 7c827d0b ntdll!KiFastSystemCallRet
01 0325fee4 77e61d1e ntdll!NtWaitForSingleObject+0xc
02 0325ff54 77e61c8d kernel32!WaitForSingleObjectEx+0xac
03 0325ff68 4a778cb6 kernel32!WaitForSingleObject+0x12
04 0325ff84 77bcb530
comsvcs!CSTAThreadPool::KillThreadControlLoop+0x25
05 0325ffb8 77e64829 msvcrt!_endthreadex+0xa3
06 0325ffec 00000000 kernel32!BaseThreadStart+0x34
Thread ID: 17
System Thread ID: f2c
Kernel Time: 0:0:0.78
User Time: 0:0:0.328
Thread Status: Thread is in a WAIT state.
Thread Type: Idle ASP thread
# ChildEBP
RetAddr
00 0329fdcc 7c827cfb ntdll!KiFastSystemCallRet
01 0329fdd0 77e6202c ntdll!NtWaitForMultipleObjects+0xc
02 0329fe78 7739bbd1 kernel32!WaitForMultipleObjectsEx+0x11a
03 0329fed4 7739ce36
USER32!RealMsgWaitForMultipleObjectsEx+0x141
04 0329fef0 4a77cb28 USER32!MsgWaitForMultipleObjects+0x1f
05 0329ff84 77bcb530 comsvcs!CSTAThread::WorkerLoop+0x1f9
06 0329ffb8 77e64829 msvcrt!_endthreadex+0xa3
07 0329ffec 00000000 kernel32!BaseThreadStart+0x34
Thread ID: 18
System Thread ID: 1ab0
Kernel Time: 0:0:3.406
User Time: 0:0:25.843
*** WARNING: Unable to verify checksum for
C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.DirectorySer#\54bf4abd12c4a168968605947cbd7006\System.DirectoryServices.ni.dll
Thread Type: Other
# ChildEBP
RetAddr
00 0336c430 76f17bbc WLDAP32!DrainWinsock+0x116
01 0336c47c 76f19f1c WLDAP32!LdapWaitForResponseFromServer+0x2e0
02 0336c804 76f19cf5 WLDAP32!LdapExchangeOpaqueToken+0x363
03 0336c8bc 76f1993f WLDAP32!LdapSspiBind+0x372
04 0336cc6c 76f1a5cc WLDAP32!LdapBind+0x3a2
05 0336cc94 76dc467d WLDAP32!ldap_bind_sW+0x2c
06 0336cce0 76dc4410 adsldpc!LdapBindS+0xe4
07 0336cd0c 76dc42fe
adsldpc!LdapOpenBindWithDefaultCredentials+0x18d
08 0336d174 76dc379f adsldpc!LdapOpenObject2+0x128
09 0336d194 712d3e32 adsldpc!LdapOpenObject+0x1b
0a 0336d1c4 712d3d6d adsldp!CLDAPRootDSE::CreateRootDSE+0x97
0b 0336d1f4 712d4828 adsldp!GetRootDSEObject+0x51
0c 0336d468 712d284c adsldp!GetServerBasedObject+0x11b
0d 0336d8c0 712d52f3 adsldp!GetObjectW+0x69
0e 0336d8ec 76df1bbb
adsldp!CLDAPNamespace::OpenDSObject+0x34
0f 0336d944 03c5bf9c activeds!ADsOpenObject+0xb2
WARNING: Frame IP not in any known module. Following frames
may be wrong.
10 0336d9e4 67170d73 0x3c5bf9c
11 0336da40 671663ae System_DirectoryServices_ni+0x10d73
12 0336daa8 67166245 System_DirectoryServices_ni+0x63ae
13 0336dab8 67165870 System_DirectoryServices_ni+0x6245
14 0336dac8 6716d0fa System_DirectoryServices_ni+0x5870
15 04d1101c 03dba1d8 System_DirectoryServices_ni+0xd0fa
16 03dcb004 00000001 0x3dba1d8
Thread ID: 19
System Thread ID: 12d4
Kernel Time: 0:0:0.78
User Time: 0:0:0.234
Thread Status: Thread is in a WAIT
***********************
More information about my system
Machine: windows 2003 SP2
IIS: IIS 6
Application: classical ASP application using C# COM object
to query the LDAP server. C# code is using System.DirectoryServices
library and is running under .Net 2.0 framework.
I will really appreciate your help.
Thanks,
Sushil