Page 1 of 1

FB random Invalid BLOB ID

Posted: 03.07.2018, 11:21
by DPStano
Firebird 3.4(nightly), ZeosLib 7.2.4 / 7.2 patches branch, Delphi 10.2 Tokyo

im getting some kind of random error invalid BLOB ID after switching to 7.2.4 (D10.2, D2009) from 7.1 (D2009) when switching between grids

Other, Error: invalid BLOB ID, Code: -901 (Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements)

Code: Select all

TLog.LogEvent - U_Log:497 [015569BD]
TSafeDriverManager.LogEvent - DBDriverManager:291 [00751D8A]
TSafeDriverManager.LogError - DBDriverManager:263 [00751CB9]
CheckInterbase6Error$qqrx70System.%DelphiInterface$43Zplainfirebirddriver.IZInterbasePlainDriver%rx28System.%StaticArray$ii$i21$%xp28Zcompatibility.TZConSettingsx29Zdbclogging.TZLoggingCategoryx31System.%AnsiStringT$us$i65535$% - ZDbcInterbase6Utils:905 [00858267]
ReadBlobBufer$qqrx70System.%DelphiInterface$43Zplainfirebirddriver.IZInterbasePlainDriver%pxuit2rx42Zplainfirebirdinterbaseconstants.TGDS_QUADrirpvxoxp28Zcompatibility.TZConSettings - ZDbcInterbase6Utils:1529 [00859C7C]
TZInterbase6UnCachedClob.ReadLob - ZDbcInterbase6ResultSet:1810 [00864CAE]
TZAbstractUnCachedCLob.IsEmpty - ZDbcResultSet:4901 [00762FC3]
TZAbstractRODataset.GetFieldData - ZAbstractRODataset:3001 [008F6B94]
Db.TDataSet.GetFieldData - Data.DB:13135 [006CE5F3]
TZAbstractRODataset.GetFieldData - ZAbstractRODataset:2920 [008F6662]
Db.TField.GetData - Data.DB:5201 [006BBE1E]
Db.TBlobField.GetIsNull - Data.DB:8915 [006C4294]
Db.TBlobField.GetClassDesc - Data.DB:8887 [006C41C5]
Db.TField.GetAsString - Data.DB:5129 [006BBA68]
Db.TField.GetEditText - Data.DB:5265 [006BBF90]
TDPDBGrid.DrawDataCell - DPGrids:502 [00D260A9]
Controls.TCustomControl.PaintWindow - Vcl.Controls:14142 [0057294B]
Controls.TWinControl.PaintHandler - Vcl.Controls:10281 [0056C785]
TDPDBGrid.WMPaint - DPGrids:1129 [00D27C22]
Controls.TControl.WndProc - Vcl.Controls:7326 [005679D6]
Controls.TWinControl.WndProc - Vcl.Controls:10197 [0056C5BB]
Controls.TWinControl.MainWndProc - Vcl.Controls:9896 [0056BB88]
Classes.StdWndProc$qqsp6HWND__uiuiui - System.Classes:17405 [004DBFE8]
i cant show queries but here are ics calls that leads to error

Code: Select all

Focus changed: CheckBoxFilterSqlError
[DB] isc_dsql_prepare(stmt: 54, tran: 4)
[DB] isc_dsql_execute(stmt: 54, tran: 4)
[DB] isc_dsql_fetch(stmt: 54)
[DB] isc_dsql_fetch(stmt: 54) - 99x
[DB] isc_dsql_prepare(stmt: 55, tran: 4)
[DB] isc_dsql_execute(stmt: 55, tran: 4)
[DB] isc_dsql_fetch(stmt: 55)
[DB] isc_dsql_fetch(stmt: 55)
[DB] isc_dsql_prepare(stmt: 56, tran: 4)
[DB] isc_dsql_prepare(stmt: 57, tran: 4)
[DB] isc_dsql_execute(stmt: 57, tran: 4)
[DB] isc_dsql_fetch(stmt: 57)
[DB] isc_commit_transaction(tran: 0)
[DB] isc_start_multiple(tran: 8)
[DB] isc_dsql_prepare(stmt: 58, tran: 8)
[DB] isc_dsql_execute(stmt: 58, tran: 8)
[DB] isc_dsql_fetch(stmt: 58) - 2x
[DB] isc_dsql_prepare(stmt: 59, tran: 8)
[DB] isc_dsql_execute(stmt: 59, tran: 8)
[DB] isc_commit_retaining(tran: 8)
[DB] isc_start_multiple(tran: 9)
[DB] isc_dsql_prepare(stmt: 60, tran: 9)
Other, Error:  invalid BLOB ID, Code: -901 (Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements)
EZSQLException: SQL Error:  invalid BLOB ID. Error Code: -901. Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements
Other, Error:  invalid BLOB ID, Code: -901 (Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements)
EZSQLException: SQL Error:  invalid BLOB ID. Error Code: -901. Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements

Re: FB random Invalid BLOB ID

Posted: 03.07.2018, 13:39
by DPStano
when i let loging isc_open_blob error will change

Code: Select all

Focus changed: Navigation
[DB] isc_dsql_prepare(stmt: 29, tran: 4)
[DB] isc_dsql_execute(stmt: 29, tran: 4)
[DB] isc_dsql_fetch(stmt: 29)
[DB] isc_dsql_fetch(stmt: 29) - 99x
[DB] isc_open_blob2(tran: 4) - 362x
[DB] isc_dsql_prepare(stmt: 30, tran: 4)
[DB] isc_dsql_execute(stmt: 30, tran: 4)
[DB] isc_dsql_prepare(stmt: 31, tran: 4)
[DB] isc_dsql_execute(stmt: 31, tran: 4)
[DB] isc_dsql_fetch(stmt: 31) - 5x
[DB] isc_open_blob2(tran: 4)
[DB] isc_dsql_fetch(stmt: 31) - 98x
[DB] isc_open_blob2(tran: 4)
[DB] isc_dsql_fetch(stmt: 31) - 2x
[DB] isc_open_blob2(tran: 4)
[DB] isc_dsql_fetch(stmt: 31) - 2x
[DB] isc_dsql_fetch(stmt: 30)
[DB] isc_dsql_fetch(stmt: 30)
[DB] isc_open_blob2(tran: 4) - 112x
[DB] isc_dsql_prepare(stmt: 32, tran: 4)
[DB] isc_dsql_execute(stmt: 32, tran: 4)
[DB] isc_dsql_fetch(stmt: 32)
[DB] isc_commit_transaction(tran: 0) // <--- transaction handle changes from 4 to 0
[DB] isc_start_multiple(tran: 8)
[DB] isc_dsql_prepare(stmt: 33, tran: 8)
[DB] isc_dsql_execute(stmt: 33, tran: 8)
[DB] isc_dsql_fetch(stmt: 33) - 2x
[DB] isc_dsql_prepare(stmt: 34, tran: 8)
[DB] isc_dsql_execute(stmt: 34, tran: 8)
[DB] isc_commit_retaining(tran: 8)
[DB] isc_open_blob2(tran: 0)
Other, Error:  invalid transaction handle (expecting explicit transaction start), Code: -901 (Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements)
EZSQLException: SQL Error:  invalid transaction handle (expecting explicit transaction start). Error Code: -901. Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements
[DB] isc_open_blob2(tran: 0)
Other, Error:  invalid transaction handle (expecting explicit transaction start), Code: -901 (Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements)
EZSQLException: SQL Error:  invalid transaction handle (expecting explicit transaction start). Error Code: -901. Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements
[DB] isc_dsql_prepare(stmt: 35, tran: 5)
[DB] isc_dsql_execute(stmt: 35, tran: 5)
[DB] isc_dsql_prepare(stmt: 36, tran: 7)
[DB] isc_dsql_execute(stmt: 36, tran: 7)
[DB] isc_dsql_fetch(stmt: 36) - 2x
[DB] isc_dsql_prepare(stmt: 37, tran: 5)
[DB] isc_dsql_execute(stmt: 37, tran: 5)
Edit: it looks like StartTransaction will Close actual transaction even if there are open/active statements

Re: FB random Invalid BLOB ID

Posted: 03.07.2018, 14:02
by marsupilami
I have also seen this bug in my main apllication. Unfortunately the bug reports from the clients are deleted by now and I don't know how to reproduce them.

Re: FB random Invalid BLOB ID

Posted: 03.07.2018, 14:14
by DPStano
i'll just guess but but i think these steps should replicate it

Connection.Connect;
Query.Fetchrow = 10
Query Open;
Quey.Next 10x
Connection.StartTransaction; // it will close transaction and release all resources even Query stmt
Connection.Commit;
Query.Next; // should fail couse statement is released

Re: FB random Invalid BLOB ID

Posted: 07.07.2018, 11:08
by marsupilami
Hello DPStano,

this issue should be fixed in the current Zeos 7.2 SVN branch. Could you please test it?
Best regards,

Jan

Re: FB random Invalid BLOB ID

Posted: 09.07.2018, 07:20
by DPStano
i'ts not fixed by r4715 (i'm testing just 7.2-patches branch), i'll try to create small demo for you

EDIT: seems i can't create simple demo, it looks like its some kind of error in Firebird...

Edit2: im trying to bisect it FB 3.0.4 will return error, FB 3.0.3 returns some wrong data see attachments (1st is after, 2nd is before):)

Edit3: i've created ticket http://tracker.firebirdsql.org/browse/CORE-5867