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

Expression index may become inconsistent if CREATE INDEX was interrupted after b-tree creation but before commiting [CORE5275] #5553

Closed
firebird-issue-importer opened this issue Jun 13, 2016 · 7 comments

Comments

@firebird-issue-importer

Submitted by: @aafemt

Running test bugs.core_1746 from standard test suite for both SS and CS mode makes engine abort with following call stack:

> engine13.dll!fb_assert_impl(const char * msg, const char * file, int line, bool do_abort) Line 49 C++
engine13.dll!BTR_description(Jrd::thread_db * tdbb, Jrd::jrd_rel * relation, Ods::index_root_page * root, Jrd::index_desc * idx, unsigned short id) Line 535 C++
engine13.dll!BTR_next_index(Jrd::thread_db * tdbb, Jrd::jrd_rel * relation, Jrd::jrd_tra * transaction, Jrd::index_desc * idx, Jrd::win * window) Line 1765 C++
engine13.dll!IDX_store(Jrd::thread_db * tdbb, Jrd::record_param * rpb, Jrd::jrd_tra * transaction) Line 1009 C++
engine13.dll!Jrd::StoreNode::store(Jrd::thread_db * tdbb, Jrd::jrd_req * request, Jrd::StmtNode::WhichTrigger whichTrig) Line 6975 C++
engine13.dll!Jrd::StoreNode::execute(Jrd::thread_db * tdbb, Jrd::jrd_req * request, Jrd::StmtNode::ExeState * exeState) Line 6912 C++
engine13.dll!EXE_looper(Jrd::thread_db * tdbb, Jrd::jrd_req * request, const Jrd::StmtNode * node) Line 1295 C++
engine13.dll!looper_seh(Jrd::thread_db * tdbb, Jrd::jrd_req * request, const Jrd::StmtNode * node) Line 1407 C++
engine13.dll!execute_looper(Jrd::thread_db * tdbb, Jrd::jrd_req * request, Jrd::jrd_tra * transaction, const Jrd::StmtNode * node, Jrd::jrd_req::req_s next_state) Line 1029 C++
engine13.dll!EXE_receive(Jrd::thread_db * tdbb, Jrd::jrd_req * request, unsigned short msg, unsigned long length, unsigned char * buffer, bool top_level) Line 632 C++
engine13.dll!Jrd::ExecProcedureNode::executeProcedure(Jrd::thread_db * tdbb, Jrd::jrd_req * request) Line 2979 C++
engine13.dll!Jrd::ExecProcedureNode::execute(Jrd::thread_db * tdbb, Jrd::jrd_req * request, Jrd::StmtNode::ExeState * __formal) Line 2900 C++
engine13.dll!EXE_looper(Jrd::thread_db * tdbb, Jrd::jrd_req * request, const Jrd::StmtNode * node) Line 1295 C++
engine13.dll!looper_seh(Jrd::thread_db * tdbb, Jrd::jrd_req * request, const Jrd::StmtNode * node) Line 1407 C++
engine13.dll!execute_looper(Jrd::thread_db * tdbb, Jrd::jrd_req * request, Jrd::jrd_tra * transaction, const Jrd::StmtNode * node, Jrd::jrd_req::req_s next_state) Line 1029 C++
engine13.dll!EXE_receive(Jrd::thread_db * tdbb, Jrd::jrd_req * request, unsigned short msg, unsigned long length, unsigned char * buffer, bool top_level) Line 632 C++
engine13.dll!JRD_receive(Jrd::thread_db * tdbb, Jrd::jrd_req * request, unsigned short msg_type, unsigned long msg_length, unsigned char * msg) Line 7578 C++
engine13.dll!Jrd::DsqlDmlRequest::execute(Jrd::thread_db * tdbb, Jrd::jrd_tra * * traHandle, Firebird::IMessageMetadata * inMetadata, const unsigned char * inMsg, Firebird::IMessageMetadata * outMetadata, unsigned char * outMsg, bool singleton) Line 728 C++
engine13.dll!DSQL_execute(Jrd::thread_db * tdbb, Jrd::jrd_tra * * tra_handle, Jrd::dsql_req * request, Firebird::IMessageMetadata * in_meta, const unsigned char * in_msg, Firebird::IMessageMetadata * out_meta, unsigned char * out_msg) Line 177 C++
engine13.dll!Jrd::JStatement::execute(Firebird::CheckStatusWrapper * user_status, Firebird::ITransaction * apiTra, Firebird::IMessageMetadata * inMetadata, void * inBuffer, Firebird::IMessageMetadata * outMetadata, void * outBuffer) Line 4434 C++
engine13.dll!Firebird::IStatementBaseImpl<Jrd::JStatement,Firebird::CheckStatusWrapper,Firebird::IReferenceCountedImpl<Jrd::JStatement,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IVersionedImpl<Jrd::JStatement,Firebird::CheckStatusWrapper,Firebird::InheritFirebird::IStatement\ > > > >::cloopexecuteDispatcher(Firebird::IStatement * self, Firebird::IStatus * status, Firebird::ITransaction * transaction, Firebird::IMessageMetadata * inMetadata, void * inBuffer, Firebird::IMessageMetadata * outMetadata, void * outBuffer) Line 8198 C++
fbclient.dll!Firebird::IStatement::executeFirebird::CheckStatusWrapper\(Firebird::CheckStatusWrapper * status, Firebird::ITransaction * transaction, Firebird::IMessageMetadata * inMetadata, void * inBuffer, Firebird::IMessageMetadata * outMetadata, void * outBuffer) Line 1637 C++
fbclient.dll!Why::YStatement::execute(Firebird::CheckStatusWrapper * status, Firebird::ITransaction * transaction, Firebird::IMessageMetadata * inMetadata, void * inBuffer, Firebird::IMessageMetadata * outMetadata, void * outBuffer) Line 4353 C++
fbclient.dll!Firebird::IStatementBaseImpl<Why::YStatement,Firebird::CheckStatusWrapper,Firebird::IReferenceCountedImpl<Why::YStatement,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IVersionedImpl<Why::YStatement,Firebird::CheckStatusWrapper,Firebird::InheritFirebird::IStatement\ > > > >::cloopexecuteDispatcher(Firebird::IStatement * self, Firebird::IStatus * status, Firebird::ITransaction * transaction, Firebird::IMessageMetadata * inMetadata, void * inBuffer, Firebird::IMessageMetadata * outMetadata, void * outBuffer) Line 8198 C++
firebird.exe!Firebird::IStatement::executeFirebird::CheckStatusWrapper\(Firebird::CheckStatusWrapper * status, Firebird::ITransaction * transaction, Firebird::IMessageMetadata * inMetadata, void * inBuffer, Firebird::IMessageMetadata * outMetadata, void * outBuffer) Line 1637 C++
firebird.exe!rem_port::execute_statement(P_OP op, p_sqldata * sqldata, packet * sendL) Line 3302 C++
firebird.exe!process_packet(rem_port * port, packet * sendL, packet * receive, rem_port * * result) Line 4376 C++
firebird.exe!loopThread(void * __formal) Line 5817 C++
firebird.exe!`anonymous namespace'::ThreadArgs::run() Line 78 C++
firebird.exe!threadStart(void * arg) Line 94 C++
[External Code]

In release builds a bugcheck (invalid send request) may be raised instead.

Commits: 38d2631 062f5d7 0229709

====== Test Details ======

See comments in .fbt: main test idea is almost the same as it initially was for core-1746.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jun 15, 2016

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jun 18, 2016

Modified by: @dyemanov

assignee: Vlad Khorsun [ hvlad ] => Dmitry Yemanov [ dimitr ]

description: Running test bugs.core_1746 from standard test suite for both SS and CS mode makes engine abort with following call stack:

> engine13.dll!fb_assert_impl(const char * msg, const char * file, int line, bool do_abort) Line 49 C++
engine13.dll!BTR_description(Jrd::thread_db * tdbb, Jrd::jrd_rel * relation, Ods::index_root_page * root, Jrd::index_desc * idx, unsigned short id) Line 535 C++
engine13.dll!BTR_next_index(Jrd::thread_db * tdbb, Jrd::jrd_rel * relation, Jrd::jrd_tra * transaction, Jrd::index_desc * idx, Jrd::win * window) Line 1765 C++
engine13.dll!IDX_store(Jrd::thread_db * tdbb, Jrd::record_param * rpb, Jrd::jrd_tra * transaction) Line 1009 C++
engine13.dll!Jrd::StoreNode::store(Jrd::thread_db * tdbb, Jrd::jrd_req * request, Jrd::StmtNode::WhichTrigger whichTrig) Line 6975 C++
engine13.dll!Jrd::StoreNode::execute(Jrd::thread_db * tdbb, Jrd::jrd_req * request, Jrd::StmtNode::ExeState * exeState) Line 6912 C++
engine13.dll!EXE_looper(Jrd::thread_db * tdbb, Jrd::jrd_req * request, const Jrd::StmtNode * node) Line 1295 C++
engine13.dll!looper_seh(Jrd::thread_db * tdbb, Jrd::jrd_req * request, const Jrd::StmtNode * node) Line 1407 C++
engine13.dll!execute_looper(Jrd::thread_db * tdbb, Jrd::jrd_req * request, Jrd::jrd_tra * transaction, const Jrd::StmtNode * node, Jrd::jrd_req::req_s next_state) Line 1029 C++
engine13.dll!EXE_receive(Jrd::thread_db * tdbb, Jrd::jrd_req * request, unsigned short msg, unsigned long length, unsigned char * buffer, bool top_level) Line 632 C++
engine13.dll!Jrd::ExecProcedureNode::executeProcedure(Jrd::thread_db * tdbb, Jrd::jrd_req * request) Line 2979 C++
engine13.dll!Jrd::ExecProcedureNode::execute(Jrd::thread_db * tdbb, Jrd::jrd_req * request, Jrd::StmtNode::ExeState * __formal) Line 2900 C++
engine13.dll!EXE_looper(Jrd::thread_db * tdbb, Jrd::jrd_req * request, const Jrd::StmtNode * node) Line 1295 C++
engine13.dll!looper_seh(Jrd::thread_db * tdbb, Jrd::jrd_req * request, const Jrd::StmtNode * node) Line 1407 C++
engine13.dll!execute_looper(Jrd::thread_db * tdbb, Jrd::jrd_req * request, Jrd::jrd_tra * transaction, const Jrd::StmtNode * node, Jrd::jrd_req::req_s next_state) Line 1029 C++
engine13.dll!EXE_receive(Jrd::thread_db * tdbb, Jrd::jrd_req * request, unsigned short msg, unsigned long length, unsigned char * buffer, bool top_level) Line 632 C++
engine13.dll!JRD_receive(Jrd::thread_db * tdbb, Jrd::jrd_req * request, unsigned short msg_type, unsigned long msg_length, unsigned char * msg) Line 7578 C++
engine13.dll!Jrd::DsqlDmlRequest::execute(Jrd::thread_db * tdbb, Jrd::jrd_tra * * traHandle, Firebird::IMessageMetadata * inMetadata, const unsigned char * inMsg, Firebird::IMessageMetadata * outMetadata, unsigned char * outMsg, bool singleton) Line 728 C++
engine13.dll!DSQL_execute(Jrd::thread_db * tdbb, Jrd::jrd_tra * * tra_handle, Jrd::dsql_req * request, Firebird::IMessageMetadata * in_meta, const unsigned char * in_msg, Firebird::IMessageMetadata * out_meta, unsigned char * out_msg) Line 177 C++
engine13.dll!Jrd::JStatement::execute(Firebird::CheckStatusWrapper * user_status, Firebird::ITransaction * apiTra, Firebird::IMessageMetadata * inMetadata, void * inBuffer, Firebird::IMessageMetadata * outMetadata, void * outBuffer) Line 4434 C++
engine13.dll!Firebird::IStatementBaseImpl<Jrd::JStatement,Firebird::CheckStatusWrapper,Firebird::IReferenceCountedImpl<Jrd::JStatement,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IVersionedImpl<Jrd::JStatement,Firebird::CheckStatusWrapper,Firebird::InheritFirebird::IStatement\ > > > >::cloopexecuteDispatcher(Firebird::IStatement * self, Firebird::IStatus * status, Firebird::ITransaction * transaction, Firebird::IMessageMetadata * inMetadata, void * inBuffer, Firebird::IMessageMetadata * outMetadata, void * outBuffer) Line 8198 C++
fbclient.dll!Firebird::IStatement::executeFirebird::CheckStatusWrapper\(Firebird::CheckStatusWrapper * status, Firebird::ITransaction * transaction, Firebird::IMessageMetadata * inMetadata, void * inBuffer, Firebird::IMessageMetadata * outMetadata, void * outBuffer) Line 1637 C++
fbclient.dll!Why::YStatement::execute(Firebird::CheckStatusWrapper * status, Firebird::ITransaction * transaction, Firebird::IMessageMetadata * inMetadata, void * inBuffer, Firebird::IMessageMetadata * outMetadata, void * outBuffer) Line 4353 C++
fbclient.dll!Firebird::IStatementBaseImpl<Why::YStatement,Firebird::CheckStatusWrapper,Firebird::IReferenceCountedImpl<Why::YStatement,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IVersionedImpl<Why::YStatement,Firebird::CheckStatusWrapper,Firebird::InheritFirebird::IStatement\ > > > >::cloopexecuteDispatcher(Firebird::IStatement * self, Firebird::IStatus * status, Firebird::ITransaction * transaction, Firebird::IMessageMetadata * inMetadata, void * inBuffer, Firebird::IMessageMetadata * outMetadata, void * outBuffer) Line 8198 C++
firebird.exe!Firebird::IStatement::executeFirebird::CheckStatusWrapper\(Firebird::CheckStatusWrapper * status, Firebird::ITransaction * transaction, Firebird::IMessageMetadata * inMetadata, void * inBuffer, Firebird::IMessageMetadata * outMetadata, void * outBuffer) Line 1637 C++
firebird.exe!rem_port::execute_statement(P_OP op, p_sqldata * sqldata, packet * sendL) Line 3302 C++
firebird.exe!process_packet(rem_port * port, packet * sendL, packet * receive, rem_port * * result) Line 4376 C++
firebird.exe!loopThread(void * __formal) Line 5817 C++
firebird.exe!`anonymous namespace'::ThreadArgs::run() Line 78 C++
firebird.exe!threadStart(void * arg) Line 94 C++
[External Code]

=>

Running test bugs.core_1746 from standard test suite for both SS and CS mode makes engine abort with following call stack:

> engine13.dll!fb_assert_impl(const char * msg, const char * file, int line, bool do_abort) Line 49 C++
engine13.dll!BTR_description(Jrd::thread_db * tdbb, Jrd::jrd_rel * relation, Ods::index_root_page * root, Jrd::index_desc * idx, unsigned short id) Line 535 C++
engine13.dll!BTR_next_index(Jrd::thread_db * tdbb, Jrd::jrd_rel * relation, Jrd::jrd_tra * transaction, Jrd::index_desc * idx, Jrd::win * window) Line 1765 C++
engine13.dll!IDX_store(Jrd::thread_db * tdbb, Jrd::record_param * rpb, Jrd::jrd_tra * transaction) Line 1009 C++
engine13.dll!Jrd::StoreNode::store(Jrd::thread_db * tdbb, Jrd::jrd_req * request, Jrd::StmtNode::WhichTrigger whichTrig) Line 6975 C++
engine13.dll!Jrd::StoreNode::execute(Jrd::thread_db * tdbb, Jrd::jrd_req * request, Jrd::StmtNode::ExeState * exeState) Line 6912 C++
engine13.dll!EXE_looper(Jrd::thread_db * tdbb, Jrd::jrd_req * request, const Jrd::StmtNode * node) Line 1295 C++
engine13.dll!looper_seh(Jrd::thread_db * tdbb, Jrd::jrd_req * request, const Jrd::StmtNode * node) Line 1407 C++
engine13.dll!execute_looper(Jrd::thread_db * tdbb, Jrd::jrd_req * request, Jrd::jrd_tra * transaction, const Jrd::StmtNode * node, Jrd::jrd_req::req_s next_state) Line 1029 C++
engine13.dll!EXE_receive(Jrd::thread_db * tdbb, Jrd::jrd_req * request, unsigned short msg, unsigned long length, unsigned char * buffer, bool top_level) Line 632 C++
engine13.dll!Jrd::ExecProcedureNode::executeProcedure(Jrd::thread_db * tdbb, Jrd::jrd_req * request) Line 2979 C++
engine13.dll!Jrd::ExecProcedureNode::execute(Jrd::thread_db * tdbb, Jrd::jrd_req * request, Jrd::StmtNode::ExeState * __formal) Line 2900 C++
engine13.dll!EXE_looper(Jrd::thread_db * tdbb, Jrd::jrd_req * request, const Jrd::StmtNode * node) Line 1295 C++
engine13.dll!looper_seh(Jrd::thread_db * tdbb, Jrd::jrd_req * request, const Jrd::StmtNode * node) Line 1407 C++
engine13.dll!execute_looper(Jrd::thread_db * tdbb, Jrd::jrd_req * request, Jrd::jrd_tra * transaction, const Jrd::StmtNode * node, Jrd::jrd_req::req_s next_state) Line 1029 C++
engine13.dll!EXE_receive(Jrd::thread_db * tdbb, Jrd::jrd_req * request, unsigned short msg, unsigned long length, unsigned char * buffer, bool top_level) Line 632 C++
engine13.dll!JRD_receive(Jrd::thread_db * tdbb, Jrd::jrd_req * request, unsigned short msg_type, unsigned long msg_length, unsigned char * msg) Line 7578 C++
engine13.dll!Jrd::DsqlDmlRequest::execute(Jrd::thread_db * tdbb, Jrd::jrd_tra * * traHandle, Firebird::IMessageMetadata * inMetadata, const unsigned char * inMsg, Firebird::IMessageMetadata * outMetadata, unsigned char * outMsg, bool singleton) Line 728 C++
engine13.dll!DSQL_execute(Jrd::thread_db * tdbb, Jrd::jrd_tra * * tra_handle, Jrd::dsql_req * request, Firebird::IMessageMetadata * in_meta, const unsigned char * in_msg, Firebird::IMessageMetadata * out_meta, unsigned char * out_msg) Line 177 C++
engine13.dll!Jrd::JStatement::execute(Firebird::CheckStatusWrapper * user_status, Firebird::ITransaction * apiTra, Firebird::IMessageMetadata * inMetadata, void * inBuffer, Firebird::IMessageMetadata * outMetadata, void * outBuffer) Line 4434 C++
engine13.dll!Firebird::IStatementBaseImpl<Jrd::JStatement,Firebird::CheckStatusWrapper,Firebird::IReferenceCountedImpl<Jrd::JStatement,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IVersionedImpl<Jrd::JStatement,Firebird::CheckStatusWrapper,Firebird::InheritFirebird::IStatement\ > > > >::cloopexecuteDispatcher(Firebird::IStatement * self, Firebird::IStatus * status, Firebird::ITransaction * transaction, Firebird::IMessageMetadata * inMetadata, void * inBuffer, Firebird::IMessageMetadata * outMetadata, void * outBuffer) Line 8198 C++
fbclient.dll!Firebird::IStatement::executeFirebird::CheckStatusWrapper\(Firebird::CheckStatusWrapper * status, Firebird::ITransaction * transaction, Firebird::IMessageMetadata * inMetadata, void * inBuffer, Firebird::IMessageMetadata * outMetadata, void * outBuffer) Line 1637 C++
fbclient.dll!Why::YStatement::execute(Firebird::CheckStatusWrapper * status, Firebird::ITransaction * transaction, Firebird::IMessageMetadata * inMetadata, void * inBuffer, Firebird::IMessageMetadata * outMetadata, void * outBuffer) Line 4353 C++
fbclient.dll!Firebird::IStatementBaseImpl<Why::YStatement,Firebird::CheckStatusWrapper,Firebird::IReferenceCountedImpl<Why::YStatement,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IVersionedImpl<Why::YStatement,Firebird::CheckStatusWrapper,Firebird::InheritFirebird::IStatement\ > > > >::cloopexecuteDispatcher(Firebird::IStatement * self, Firebird::IStatus * status, Firebird::ITransaction * transaction, Firebird::IMessageMetadata * inMetadata, void * inBuffer, Firebird::IMessageMetadata * outMetadata, void * outBuffer) Line 8198 C++
firebird.exe!Firebird::IStatement::executeFirebird::CheckStatusWrapper\(Firebird::CheckStatusWrapper * status, Firebird::ITransaction * transaction, Firebird::IMessageMetadata * inMetadata, void * inBuffer, Firebird::IMessageMetadata * outMetadata, void * outBuffer) Line 1637 C++
firebird.exe!rem_port::execute_statement(P_OP op, p_sqldata * sqldata, packet * sendL) Line 3302 C++
firebird.exe!process_packet(rem_port * port, packet * sendL, packet * receive, rem_port * * result) Line 4376 C++
firebird.exe!loopThread(void * __formal) Line 5817 C++
firebird.exe!`anonymous namespace'::ThreadArgs::run() Line 78 C++
firebird.exe!threadStart(void * arg) Line 94 C++
[External Code]

In release builds a bugcheck (invalid send request) may be raised instead.

summary: Test bugs.core_1746 acivates assertion => Expression index may become inconsistent if CREATE INDEX was interrupted after b-tree creation but before commiting

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jun 18, 2016

Modified by: @dyemanov

Fix Version: 4.0 Alpha 1 [ 10731 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jun 18, 2016

Modified by: @dyemanov

Version: 3.0.0 [ 10740 ]

Version: 2.5.5 [ 10670 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jun 18, 2016

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.5.6 [ 10721 ]

Fix Version: 3.0.1 [ 10730 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jun 20, 2016

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

Test Details: See comments in .fbt: main test idea is almost the same as it initially was for core-1746.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jun 20, 2016

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

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