You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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...
Submitted by: Fernando Nájera (fernandonajera)
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...
Commits: 7d3c894
The text was updated successfully, but these errors were encountered: