In our CI I've experienced access violation while running firebird.sqlclient.tests with following managed stack:
at FB_965910463_Class.isc_dsql_free_statement(IntPtr, Int32 ByRef, Int16)
at FB_965910463_Class.IFbClient.isc_dsql_free_statement(IntPtr, Int32 ByRef, Int16)
I don't have a native stack for this, but I look forward get it.
My suggestion bases on this:
function is similar to the isc_dsql_alloc_statement() function except that
statement handles allocated using isc_dsql_allocate_statement2() are
automatically reset to NULL when the database under which they are allocated
is detached" (taken from ib6.0 beta docs)
I think a database was already deallocated before finalization of statement got to the queue. I think it needs somehow propagate deallocation of the database in managed statement objects.