Hi,

 

Does the following look like a Firebird 2.1.4 bug, or are we doing
something wrong?

 

We are upgrading from Firebird 2.1.2.18118 to Firebird 2.1.4.18393. We
use Firebird Embedded in Windows (both 32-bit and 64-bit).

 

We are encountering a repeatable crash in Firebird 2.1.4.18393 when we
execute the SQL statement "DROP INDEX IX_LOGIN_TEMP_ACCOUNTNAME_LOWER"
in our database and commit. The crash occurs during commit. It doesn't
seem to occur in the 32-bit version but occurs with the 64-bit version.
It does not occur every time, but in more than 50% of the cases at
least. For example, when repeating the test 10 times, I typically get
say 7 crashes and 3 successful runs.

 

Earlier, the index has been created using the following SQL statement in
FB 2.1.4, and committed:

CREATE UNIQUE ASC INDEX IX_LOGIN_TEMP_ACCOUNTNAME_LOWER

ON LOGIN_TEMP COMPUTED BY ( LOWER( ACCOUNTNAME ) )

 

The call stack of the crash is as follows (note: fbclient.dll is
fbembed.dll, just renamed):

 

Unhandled exception at 0x100b8ec8 in memory.dmp: 0xC0000005: Access
violation reading location 0xffffffffffffffff.

 

fbclient.dll!CMP_release

fbclient.dll!index_block_flush

fbclient.dll!IDX_delete_index

fbclient.dll!delete_index

fbclient.dll!modify_index

fbclient.dll!DFW_perform_work

fbclient.dll!TRA_commit

fbclient.dll!commit

fbclient.dll!jrd8_commit_transaction

fbclient.dll!isc_commit_transaction

fbclient.dll!execute_request

fbclient.dll!GDS_DSQL_EXECUTE_CPP

fbclient.dll!dsql8_execute

fbclient.dll!isc_dsql_execute2_m

fbclient.dll!isc_dsql_execute2

IBProv.dll!ib_v5::t_ib_statement_v5::execute

IBProv.dll!ibp::t_ibp_command::execute

IBProv.dll!ib_sql_pstmt::t_ib_sql_pstmt_commit::execute_sql

IBProv.dll!ibp::t_ibp_command_pstmt_data::single_exec

IBProv.dll!ibp::t_ibp_command_pstmt_data::execute_for_one_param_set

IBProv.dll!ibp::t_ibp_command_pstmt_data::execute

IBProv.dll!ibp::TIBPCommand::Execute

oledb32.dll!CCommandText::Execute

MFServer.exe!CDBSession::CommitDBTransaction

MFServer.exe!CDBSession::Commit

MFServer.exe!CApplication::UpgradeMasterDB_V39

MFServer.exe!CApplication::UpgradeMasterDB_PerformUpgrade

MFServer.exe!CApplication::UpgradeMasterDB

MFServer.exe!CApplication::PrepareMasterDB

MFServer.exe!CApplication::InitRunningState

MFServer.exe!CServiceModuleMFServer::OnBeginRunning

MFServer.exe!CServiceModule::Run

MFServer.exe!CServiceModule::ServiceMain

sechost.dll!ScSvcctrlThreadW

kernel32.dll!BaseThreadInitThunk

ntdll.dll!RtlUserThreadStart

 

The same call stack with more details is in the attachment file.

 

The crash does not occur with Firebird 2.1.2.18118.

 

But, I have noticed that if I perform backup & restore for the database
in Firebird 2.1.4.18393, then the crash will not occur. In other words:

 

This leads to crash:

- Take the database that was used with Firebird 2.1.2 and perform a
backup & restore to it with FB 2.1.2

- Then use Firebird 2.1.4 to create the index, commit, do something
else, drop the index, and commit => crash

 

This does NOT lead to crash:

- Take the database that was used with Firebird 2.1.2 and perform a
backup & restore to it with FB 2.1.4

- Then use Firebird 2.1.4 to create the index, commit, do something
else, drop the index, and commit => crash

 

It seems that backup & restore in FB 2.1.4. somehow fixes the database,
which a backup & restore in FB 2.1.2 does not. The original database in
FB 2.1.2 does not report any errors when validated with FB 2.1.2 or
2.1.4.

 

 

We can work around the problem by adding a backup & restore step in our
code. But I would like to know if this indicates some sort of bug that
FB 2.1.4 that 2.1.2 did not have and if we should refrain from using FB
2.1.4.

 

-Antti

 

Unhandled exception at 0x100b8ec8 in memory.dmp: 0xC0000005: Access violation 
reading location 0xffffffffffffffff.




        fbclient.dll!CMP_release(Jrd::thread_db * tdbb=0x0000000001494ed0, 
Jrd::jrd_req * request=0x0000000001cbcf80)  Line 2418 + 0x8 bytes    C++
        fbclient.dll!index_block_flush(void * ast_object=0x0000000001cbcf80)  
Line 1530 C++
        fbclient.dll!IDX_delete_index(Jrd::thread_db * tdbb=0x0000000000f60070, 
Jrd::jrd_rel * relation=0x000000000173e760, unsigned short id=53120)  Line 599  
C++
        fbclient.dll!delete_index(Jrd::thread_db * tdbb=0xfffffffffffffffe, 
short phase=-8088, Jrd::DeferredWork * work=0x0000000000400020, Jrd::jrd_tra * 
transaction=0x0000000001494c20)  Line 4561   C++
        fbclient.dll!modify_index(Jrd::thread_db * tdbb=0x0000000000000001, 
short phase=1, Jrd::DeferredWork * work=0x000000000149a3f8, Jrd::jrd_tra * 
transaction=0x0000000001494c20)  Line 2724 + 0xe bytes   C++
        fbclient.dll!DFW_perform_work(Jrd::jrd_tra * 
transaction=0x0000000001494c20)  Line 1147 + 0x11 bytes    C++
        fbclient.dll!TRA_commit(Jrd::thread_db * tdbb=0x0000000000000000, 
Jrd::jrd_tra * transaction=0x00000000029fc138, const bool retaining_flag=true)  
Line 442      C++
        fbclient.dll!commit(__int64 * user_status=0x0000000001cbd8f0, 
Jrd::jrd_tra * * tra_handle=0x0000000001cbcf80, const bool 
retaining_flag=false)  Line 5166       C++
        fbclient.dll!jrd8_commit_transaction(__int64 * 
user_status=0x0000000000000000, Jrd::jrd_tra * * tra_handle=0x0000000000000000) 
 Line 1675 + 0x2a bytes  C++
        fbclient.dll!isc_commit_transaction(__int64 * 
user_status=0x0000000000000000, unsigned int * tra_handle=0x0000000001850000)  
Line 1430 + 0x1f bytes     C++
        fbclient.dll!execute_request(dsql_req * request=0x000000000000000b, 
unsigned int * trans_handle=0x0000000000381968, unsigned short 
in_blr_length=56744, const unsigned char * in_blr=0x0000000000000000, unsigned 
short in_msg_length=0, unsigned char * in_msg=0x0000000000000000, unsigned 
short out_blr_length=0, unsigned char * out_blr=0x0000000000000000, unsigned 
short out_msg_length=0, unsigned char * out_msg=0x0000000000000000, bool 
singleton=false)  Line 3313 + 0x11 bytes     C++
        fbclient.dll!GDS_DSQL_EXECUTE_CPP(__int64 * 
user_status=0x0000000002a0a7d0, unsigned int * trans_handle=0x0000000000381950, 
dsql_req * * req_handle=0xfffffffffffffffe, unsigned short in_blr_length=0, 
const unsigned char * in_blr=0x0000000000000000, unsigned short in_msg_type=0, 
unsigned short in_msg_length=0, unsigned char * in_msg=0x0000000000000000, 
unsigned short out_blr_length=0, unsigned char * out_blr=0x0000000000000000, 
unsigned short out_msg_type=0, unsigned short out_msg_length=0, unsigned char * 
out_msg=0x0000000000000000)  Line 564 + 0x66 bytes       C++
        fbclient.dll!dsql8_execute(__int64 * user_status=0x0000000000000000, 
unsigned int * trans_handle=0x0000000000000000, dsql_req * * 
req_handle=0x0000000000000000, unsigned short in_blr_length=0, const char * 
in_blr=0x0000000000000000, unsigned short in_msg_type=0, unsigned short 
in_msg_length=0, char * in_msg=0x0000000000000000, unsigned short 
out_blr_length=0, char * out_blr=0x0000000000000000, unsigned short 
out_msg_type=0, unsigned short out_msg_length=0, char * 
out_msg=0x0000000000000000)  Line 297       C++
        fbclient.dll!isc_dsql_execute2_m(__int64 * 
user_status=0x0000000000000000, unsigned int * tra_handle=0x0000000045e03b3b, 
unsigned int * stmt_handle=0x0000000001cbd8b0, unsigned short in_blr_length=0, 
const char * in_blr=0x0000000000000000, unsigned short in_msg_type=0, unsigned 
short in_msg_length=0, char * in_msg=0x0000000000000000, unsigned short 
out_blr_length=0, char * out_blr=0x0000000000000000, unsigned short 
out_msg_type=0, unsigned short out_msg_length=0, char * 
out_msg=0x0000000000000000)  Line 2537       C++
        fbclient.dll!isc_dsql_execute2(__int64 * 
user_status=0x00000000043a0000, unsigned int * tra_handle=0x0000000001cbdd58, 
unsigned int * stmt_handle=0x0000000002a0e7d0, unsigned short dialect=15712, 
XSQLDA * in_sqlda=0x0000000000000000, XSQLDA * out_sqlda=0x0000000000000000)  
Line 2447 + 0x74 bytes        C++
        
IBProv.dll!ib_v5::t_ib_statement_v5::execute(db_obj::t_db_operation_context & 
op_ctx={...}, db_obj::t_db_row * const in_param=0x00000000043ac2d0, 
db_obj::t_db_row * const out_param=0x0000000000000000, __int64 * const 
rows_affected=0x0000000000000000, const unsigned int exec_flags=0)  Line 500 + 
0x95 bytes      C++
        IBProv.dll!ibp::t_ibp_command::execute(ibp::t_ibp_operation_context & 
op_ctx={...}, __int64 * const pcRowsAffected=0x0000000002a0a2e0, const unsigned 
int exec_flags=44081888)  Line 151        C++
        
IBProv.dll!ib_sql_pstmt::t_ib_sql_pstmt_commit::execute_sql(ibp::TIBPSession * 
const __formal=0x0000000000000000, ibp::t_ibp_operation_context & op_ctx={...}, 
ibp::TIBPSession * const __formal=0x0000000000000000, 
ibp::t_ibp_command_pstmt_params_data * const pParams=0x0000000000000000, 
structure::t_smart_object_ptr<db_obj::t_db_result_set,structure::t_sptr_traits<db_obj::t_db_result_set>
 > & spResultSet={...}, __int64 * const pcRowsAffected=0x0000000001cbdbe0, 
db_obj::t_db_exec_triggers * const pTriggers=0x0000000001cbe268, 
ibp::TIBPSession * const __formal=0x0000000000000000)  Line 93 C++
        
IBProv.dll!ibp::t_ibp_command_pstmt_data::single_exec(ibp::t_ibp_command_pstmt_data::tag_exec_context
 & ExecContext={...}, ibp::t_ibp_transaction * pIBPTrans=0x000000000297f500, 
ibp::t_ibp_command_pstmt * pPStmt=0x0000000000000400, ibp::t_ibp_command * 
pIBPCmd=0x00000000029d1cd0, const bool NeedRePreparePStmt=false, const bool 
ForceCacheAllResultData=false, const bool DetectRowsAffected=true, const bool 
CreateIsolatedParams=false, const ibp::t_ibp_command_pstmt_params_info * const 
pParamsInfo=0x0000000001cbde48, ibp::t_ibp_command_pstmt_params_data * const 
pParamsData=0x0000000000000000, 
structure::t_smart_object_ptr<ibp::TIBP_SingleResult,structure::t_sptr_traits<ibp::TIBP_SingleResult>
 > & spResult={...}, structure::t_value_with_null<__int64> & 
TotalRowsAffected={...}, db_obj::t_db_exec_triggers * const 
pTriggers=0x0000000001cbe268)  Line 565 + 0x74 bytes   C++
        
IBProv.dll!ibp::t_ibp_command_pstmt_data::execute_for_one_param_set(ibp::t_ibp_command_pstmt_data::tag_exec_context
 & ExecContext={...}, ibp::t_ibp_transaction * const 
pIBPTrans=0x000000000297f500, const ibp::t_ibp_command_pstmt_data__state * 
const pStateData=0x000000000297f500, const bool DetectRowsAffected=true, 
ibp::TIBP_ParametersData * const pParamsData=0x0000000000000000, 
ibp::TIBP_SingleResultSet & Results={...}, 
structure::t_value_with_null<__int64> & TotalRowsAffected={...}, 
db_obj::t_db_exec_triggers * const pTriggers=0x0000000001cbe268)  Line 331 + 
0x65 bytes        C++
        IBProv.dll!ibp::t_ibp_command_pstmt_data::execute(ibp::TIBPCommand * 
const pCommand=0x000007fef87a13ee, const 
std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > & 
command_text=<Bad Ptr>, const bool CreateMultipleResults=true, const bool 
DetectRowsAffected=true, ibp::TIBP_ParametersData * const 
pFirstParams=0x0000000000000000, const unsigned __int64 nExecution=1, 
ibp::TIBP_SingleResultSet & Results={...}, 
structure::t_value_with_null<__int64> & TotalRowsAffected={...}, 
db_obj::t_db_exec_triggers * const pTriggers=0x0000000001cbe268)  Line 207 + 
0x3e bytes     C++
        IBProv.dll!ibp::TIBPCommand::Execute(IUnknown * const 
pUnkOuter=0x0000000000acf4b8, const _GUID & riid={...}, tagDBPARAMS * const 
pParams=0x000007fefe2e6739, __int64 * const pcRowsAffected=0x0000000001cbe658, 
IUnknown * * const ppRowset=0x0000000001cbe3f0)  Line 159 + 0x53 bytes C++
        oledb32.dll!CCommandText::Execute()  + 0x2701 bytes     
        MFServer.exe!CDBSession::CommitDBTransaction()  Line 546 + 0xbb bytes   
C++
        MFServer.exe!CDBSession::Commit()  Line 501 + 0x8 bytes C++
>       MFServer.exe!CApplication::UpgradeMasterDB_V39()  Line 973 + 0x283 
> bytes        C++
        MFServer.exe!CApplication::UpgradeMasterDB_PerformUpgrade(long 
lVersion=39)  Line 177 + 0x13 bytes      C++
        MFServer.exe!CApplication::UpgradeMasterDB(bool * 
pbUpgraded=0xffffffffffffffff)  Line 2462 + 0xa bytes C++
        MFServer.exe!CApplication::PrepareMasterDB()  Line 1938 + 0x10 bytes    
C++
        MFServer.exe!CApplication::InitRunningState()  Line 1102 + 0x8 bytes    
C++
        MFServer.exe!CServiceModuleMFServer::OnBeginRunning()  Line 166 + 0xd 
bytes     C++
        MFServer.exe!CServiceModule::Run()  Line 769 + 0x9 bytes        C++
        MFServer.exe!CServiceModule::ServiceMain(unsigned long dwArgc=4987888, 
wchar_t * * lpszArgv=0x0000000000000000)  Line 897 + 0x8 bytes   C++
        sechost.dll!ScSvcctrlThreadW()  + 0x25 bytes    
        kernel32.dll!BaseThreadInitThunk()  + 0xd bytes 
        ntdll.dll!RtlUserThreadStart()  + 0x21 bytes    
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to