Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random bug in finalizing DbCommands [DNET582] #551

Closed
firebird-automations opened this issue Dec 19, 2014 · 9 comments
Closed

Random bug in finalizing DbCommands [DNET582] #551

firebird-automations opened this issue Dec 19, 2014 · 9 comments

Comments

@firebird-automations
Copy link

Submitted by: Hennadii Zabula (zabulus)

Is related to DNET684
Is related to DNET698

Several times I've experienced randomly reproduced bug. It has some different symptoms: OOM, unhandled crash and so on.
But all this times I had the same stack:
000000001b56edb0 00000000773a186a [FaultingExceptionFrame: 000000001b56edb0]
000000001b56f300 000007fe9a9920b0 FirebirdSql.Data.FirebirdClient.FbCommand.Release() [*\FirebirdSql.Data.FirebirdClient\FirebirdClient\FbCommand.cs @ 821]
000000001b56f340 000007fe9a9a47f5 FirebirdSql.Data.FirebirdClient.FbCommand.Dispose(Boolean) [*\FirebirdSql.Data.FirebirdClient\FirebirdClient\FbCommand.cs @ 384]
000000001b56f3a0 000007fef71cc8da System.ComponentModel.Component.Finalize()
000000001b56f798 000007fef9479d56 [DebuggerU2MCatchHandlerFrame: 000000001b56f798]

It is locally built library so I'll provide lines referred above:
FbCommand.cs @ 821
if (this.connection != null && this.connection.State == ConnectionState.Open)
{
this.connection.InnerConnection.RemovePreparedCommand(this);
}
FbCommand.cs @ 384
try
{
// Release any unmanaged resources
this.Release();

I've added crutch to the FbCommand.Release method as in other places, just handle exception without any code. But I think it is not the best way to fix it.

               try
                \{
                    // old code
                \}
                catch // added
                \{
                \}
                finally
                \{
                    base\.Dispose\(disposing\);
                \}

Don't you think that catching swallowing exceptions in dispose methods is a bad way to handle errors?

@firebird-automations
Copy link
Author

Commented by: Hennadii Zabula (zabulus)

Forgot to mention the exception, that occurs

Exception object: 00000000039081f0
Exception type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
InnerException: <none>
StackTrace (generated):
SP IP Function
000000001B56F300 000007FE9A9920B0 FirebirdSql_Data_FirebirdClient!FirebirdSql.Data.FirebirdClient.FbCommand.Release()+0x40
000000001B56F340 000007FE9A9A47F5 FirebirdSql_Data_FirebirdClient!FirebirdSql.Data.FirebirdClient.FbCommand.Dispose(Boolean)+0x65
000000001B56F3A0 000007FEF71CC8DA System_ni!System.ComponentModel.Component.Finalize()+0x2a

StackTraceString: <none>
HResult: 80004003

@firebird-automations
Copy link
Author

Commented by: Hennadii Zabula (zabulus)

my suggestion, that connection.InnerConnection is null or/and disposed when finalization performs.
I think that the lifetime of the FbCommand is longer than it should be.

@firebird-automations
Copy link
Author

Commented by: Hennadii Zabula (zabulus)

Reproduced again in our production environment after several days working.
Version: 4.8.1.1

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => In Progress [ 3 ]

@firebird-automations
Copy link
Author

Commented by: @cincuranet

Does this only happen in embedded or also when running against server?

@firebird-automations
Copy link
Author

Modified by: @cincuranet

Link: This issue is related to DNET684 [ DNET684 ]

@firebird-automations
Copy link
Author

Modified by: @cincuranet

Link: This issue is related to DNET698 [ DNET698 ]

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: In Progress [ 3 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: vNext - Finalizers [ 10807 ]

@firebird-automations
Copy link
Author

Modified by: @cincuranet

Fix Version: vNext [ 10804 ]

Fix Version: vNext - Finalizers [ 10807 ] =>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants