System.NullReferenceException at FirebirdSql.Data.FirebirdClient.FbConnectionPool.get_Count() ---------------------------------------------------------------------------------------------
Key: DNET-366 URL: http://tracker.firebirdsql.org/browse/DNET-366 Project: .NET Data provider Issue Type: Bug Components: ADO.NET Provider Affects Versions: 2.6 Environment: .NET 3.5 with the 2.6.0 provider Reporter: Fernando Nájera Assignee: Jiri Cincura Priority: Critical I just got the following exception while my application was running: System.NullReferenceException: Object reference not set to an instance of an object. at FirebirdSql.Data.FirebirdClient.FbConnectionPool.get_Count() in C:\Users\Jiri\Desktop\NETProvider\source\FirebirdSql\Data\FirebirdClient\FbConnectionPool.cs:line 82 at FirebirdSql.Data.FirebirdClient.FbConnectionPool.CleanupWorker(Object state) in C:\Users\Jiri\Desktop\NETProvider\source\FirebirdSql\Data\FirebirdClient\FbConnectionPool.cs:line 303 at System.Threading._TimerCallback.TimerCallback_Context(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading._TimerCallback.PerformTimerCallback(Object state) Unfortunately I cannot replicate it -- which is probably because this might be a timing issue (I can see threads in the stacktrace... so probably I hit a race condition). Having a look at the source code of FbConnectionPool, I guess the problem might be that one thread is disposing the object while another one is asking for .Count. I can see that .Count is calling "lock (this.unlocked.SyncRoot)", but during the disposal that variable might be already null... -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider