-
Notifications
You must be signed in to change notification settings - Fork 39
Memory leak in WebListener when using NTLM #317
Comments
After further investigation (rel/1.1.0 and also dev branch), we found two problems that were causing leaks. Following fixes are for rel/1.1.0 branch.
After successful NTLM challenge an access token is created but never disposed. According to Http Server API version 2.0 documentation, section AccessToken (link), handle should always be closed when it is no longer required. We fixed that by adding
|
Conceptually this makes sense, but I haven't been able to reproduce the leak on Win10 Insiders branch. What OS version are you using? I would expect Http.Sys to close the AccessToken handle at the end of the request. "This token is valid only for the lifetime of the request." |
Leaks are happening only when server and client are on different machines. We were not able to reproduce it when both were on localhost. |
I was using different machines. |
Are you trying to reproduce bug on example provided? If not, please configure HttpClient, so that NTLM negotiation occurs on every request:
|
That made a difference. Over lunch lsass.exe leaked about 165,000 handles and 75mb. |
Preview builds of this patch fix should be available on the following feeds:
If you have a chance, please try out these preview builds and let us know if you have any feedback! |
Memory leak occurs in lsass.exe process when using WebListener (.NET Core 1.1). Authentication scheme must be set to
AuthenticationSchemes.NTLM
.Client is sending requests using
System.Net.HttpClient
(.NET 4.6) with credentials set toCredentialCache.DefaultCredentials
.Client and server must be on different machines.
Server:
Client:
Sample solution attached:
WebListenerNtlmLsassMemoryLeak.zip
The text was updated successfully, but these errors were encountered: