Bug 19822 - NullReferenceException in ServicePoint.CheckAvailableForRecycling
Summary: NullReferenceException in ServicePoint.CheckAvailableForRecycling
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System (show other bugs)
Version: 3.4.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Martin Baulig
URL:
Depends on:
Blocks:
 
Reported: 2014-05-15 12:11 UTC by Tom Philpot
Modified: 2014-08-25 12:26 UTC (History)
2 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Tom Philpot 2014-05-15 12:11:40 UTC
Reported here: https://github.com/mono/mono/commit/c6a70a9586971d9d2561933fab47e30cca997e76#commitcomment-6218256

NullReferenceException: Object reference not set to an instance of an object in System.Net.ServicePoint.CheckAvailableForRecycling(DateTime& outIdleSince)
System.Net.ServicePoint.CheckAvailableForRecycling(DateTime& outIdleSince):0
System.Net.ServicePointManager.RecycleServicePoints():0
System.Net.ServicePointManager.FindServicePoint(Uri address, IWebProxy proxy):0
System.Net.HttpWebRequest.GetServicePoint():0
System.Net.HttpWebRequest.get_ServicePoint():0

It appears that in the 3.4.0 code if a WebConnection is reused, the idleTimer might not get initialized when the request is sent, so when that ServicePoint is recycled, the null idleTimer is Disposed().

See https://github.com/mono/mono/commit/c6a70a9586971d9d2561933fab47e30cca997e76#diff-19d89ff61d1fe3649353c6d22d3a7803R422
Comment 1 Tom Philpot 2014-05-15 12:12:15 UTC
If I can create a small repro, I'll attach it to this case.

Note You need to log in before you can comment on or make changes to this bug.