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

Server crashes while compiling stored procedure with nested references to query-based computed fields [CORE5547] #5815

Closed
firebird-issue-importer opened this issue May 19, 2017 · 5 comments

Comments

@firebird-issue-importer

Submitted by: Maxim Kuzmin (cybermax)

After migrating DB from FB 2.5, when i realter some stored procedures, server crashed with "Access violation".
Test case sended to hvlad privately.

Commits: d88750c 3123315

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

Deferred after discuss with dimitr, see letter 22.11.2017 09:05

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 19, 2017

Commented by: @hvlad

Debug build have assert failed:

engine12\.dll\!fb\_assert\_impl Line 40	C\+\+
engine12\.dll\!Firebird::Array<Jrd::CompilerScratch::csb\_repeat,Firebird::InlineStorage<Jrd::CompilerScratch::csb\_repeat,5\> \>::getElement Line 137	C\+\+
engine12\.dll\!Firebird::Array<Jrd::CompilerScratch::csb\_repeat,Firebird::InlineStorage<Jrd::CompilerScratch::csb\_repeat,5\> \>::operator\[\] Line 171	C\+\+

> engine12.dll!Jrd::RelationSourceNode::copy Line 658 C++
engine12.dll!Jrd::RseNode::copy Line 2604 C++
engine12.dll!Jrd::NodeCopier::copyJrd::RseNode\ Line 210 C++
engine12.dll!Jrd::NodeCopier::copyJrd::RseNode\ Line 220 C++
engine12.dll!Jrd::SubQueryNode::copy Line 9562 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 210 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 220 C++
engine12.dll!Jrd::ValueListNode::copy Line 1221 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueListNode\ Line 210 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueListNode\ Line 220 C++
engine12.dll!Jrd::ProcedureSourceNode::copy Line 1100 C++
engine12.dll!Jrd::RseNode::copy Line 2604 C++
engine12.dll!Jrd::NodeCopier::copyJrd::RseNode\ Line 210 C++
engine12.dll!Jrd::NodeCopier::copyJrd::RseNode\ Line 220 C++
engine12.dll!Jrd::SubQueryNode::copy Line 9562 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 210 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 220 C++
engine12.dll!Jrd::DecodeNode::copy Line 4081 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 210 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 220 C++
engine12.dll!Jrd::CastNode::copy Line 2767 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 210 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 220 C++
engine12.dll!Jrd::ValueIfNode::copy Line 11647 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 210 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 220 C++
engine12.dll!Jrd::CastNode::copy Line 2767 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 210 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 220 C++
engine12.dll!Jrd::ValueIfNode::copy Line 11647 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 210 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 220 C++
engine12.dll!Jrd::CastNode::copy Line 2767 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 210 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 220 C++
engine12.dll!Jrd::ValueIfNode::copy Line 11647 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 210 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 220 C++
engine12.dll!Jrd::CastNode::copy Line 2767 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 210 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 220 C++
engine12.dll!Jrd::ValueIfNode::copy Line 11647 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 210 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 220 C++
engine12.dll!Jrd::CastNode::copy Line 2767 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 210 C++
engine12.dll!Jrd::NodeCopier::copyJrd::ValueExprNode\ Line 225 C++
engine12.dll!Jrd::FieldNode::pass1 Line 5734 C++
engine12.dll!Jrd::DmlNode::doPass1Jrd::ValueExprNode\ Line 309 C++
engine12.dll!Jrd::ComparativeBoolNode::pass1 Line 566 C++
engine12.dll!Jrd::DmlNode::doPass1Jrd::BoolExprNode\ Line 309 C++
engine12.dll!Jrd::NodeRefImplJrd::BoolExprNode\::pass1 Line 716 C++
engine12.dll!Jrd::ExprNode::pass1 Line 320 C++
engine12.dll!Jrd::ValueExprNode::pass1 Line 803 C++
engine12.dll!Jrd::DmlNode::doPass1Jrd::ValueExprNode\ Line 309 C++
engine12.dll!Jrd::NodeRefImplJrd::ValueExprNode\::pass1 Line 716 C++
engine12.dll!Jrd::ExprNode::pass1 Line 320 C++
engine12.dll!Jrd::ValueExprNode::pass1 Line 803 C++
engine12.dll!Jrd::CastNode::pass1 Line 2800 C++
engine12.dll!Jrd::DmlNode::doPass1Jrd::ValueExprNode\ Line 309 C++
engine12.dll!Jrd::NodeRefImplJrd::ValueExprNode\::pass1 Line 716 C++
engine12.dll!Jrd::ExprNode::pass1 Line 320 C++
engine12.dll!Jrd::ValueExprNode::pass1 Line 803 C++
engine12.dll!Jrd::CastNode::pass1 Line 2800 C++
engine12.dll!Jrd::DmlNode::doPass1Jrd::ValueExprNode\ Line 309 C++
engine12.dll!Jrd::NodeRefImplJrd::ValueExprNode\::pass1 Line 716 C++
engine12.dll!Jrd::ExprNode::pass1 Line 320 C++
engine12.dll!Jrd::ValueExprNode::pass1 Line 803 C++
engine12.dll!Jrd::DerivedExprNode::pass1 Line 4255 C++
engine12.dll!Jrd::DmlNode::doPass1Jrd::ValueExprNode\ Line 309 C++
engine12.dll!Jrd::FieldNode::pass1 Line 5807 C++
engine12.dll!Jrd::DmlNode::doPass1Jrd::ValueExprNode\ Line 309 C++
engine12.dll!Jrd::AssignmentNode::pass1 Line 393 C++
engine12.dll!Jrd::DmlNode::doPass1Jrd::StmtNode\ Line 309 C++
engine12.dll!Jrd::CompoundStmtNode::pass1 Line 833 C++
engine12.dll!Jrd::DmlNode::doPass1Jrd::StmtNode\ Line 309 C++
engine12.dll!Jrd::ForNode::pass1 Line 4650 C++
engine12.dll!Jrd::DmlNode::doPass1Jrd::StmtNode\ Line 309 C++
engine12.dll!Jrd::LabelNode::pass1 Line 4845 C++
engine12.dll!Jrd::DmlNode::doPass1Jrd::StmtNode\ Line 309 C++
engine12.dll!Jrd::CompoundStmtNode::pass1 Line 833 C++
engine12.dll!Jrd::DmlNode::doPass1Jrd::StmtNode\ Line 309 C++
engine12.dll!Jrd::CompoundStmtNode::pass1 Line 833 C++
engine12.dll!Jrd::DmlNode::doPass1Jrd::StmtNode\ Line 309 C++
engine12.dll!Jrd::LabelNode::pass1 Line 4845 C++
engine12.dll!Jrd::DmlNode::doPass1Jrd::StmtNode\ Line 309 C++
engine12.dll!Jrd::CompoundStmtNode::pass1 Line 833 C++
engine12.dll!Jrd::DmlNode::doPass1Jrd::StmtNode\ Line 309 C++
engine12.dll!Jrd::ReceiveNode::pass1 Line 6374 C++
engine12.dll!Jrd::DmlNode::doPass1Jrd::StmtNode\ Line 309 C++
engine12.dll!Jrd::CompoundStmtNode::pass1 Line 833 C++
engine12.dll!Jrd::DmlNode::doPass1Jrd::DmlNode\ Line 309 C++
engine12.dll!Jrd::JrdStatement::makeStatement Line 203 C++
engine12.dll!PAR_blr Line 241 C++
engine12.dll!Jrd::Routine::parseBlr Line 129 C++
engine12.dll!MET_procedure Line 8367 C++
engine12.dll!MET_lookup_procedure Line 7375 C++
engine12.dll!`anonymous namespace'::ProcedureManager::lookupBlobId Line 4362 C++
engine12.dll!`anonymous namespace'::RoutineManager<`anonymous namespace'::ProcedureManager,Jrd::jrd_prc,5,&MET_lookup_procedure_id,&MET_lookup_procedure,&MET_procedure>::getDependencies Line 4154 C++
engine12.dll!`anonymous namespace'::RoutineManager<`anonymous namespace'::ProcedureManager,Jrd::jrd_prc,5,&MET_lookup_procedure_id,&MET_lookup_procedure,&MET_procedure>::modifyRoutine Line 4003 C++
engine12.dll!DFW_perform_work Line 4746 C++
engine12.dll!TRA_commit Line 376 C++
engine12.dll!commit Line 5491 C++
engine12.dll!JRD_commit_transaction Line 7736 C++

At the marked frame i see following variable values

stream == 4

relativeStream == 3435973836 (0xcccccccc, i.e. not initialized memory)

copier.remap:
10
38
39
3435973836
40
3435973836
3435973836
3435973836
...

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 24, 2017

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Nov 21, 2017

Modified by: @dyemanov

Version: 4.0 Alpha 1 [ 10731 ]

summary: Access violation in module 'Engine12.DLL' => Server crashes while compiling stored procedure with nested references to query-based computed fields

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Nov 21, 2017

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

Fix Version: 3.0.3 [ 10810 ]

Fix Version: 4.0 Beta 1 [ 10750 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Nov 25, 2017

Modified by: @pavel-zotov

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

QA Status: No test => Deferred

Test Details: Deferred after discuss with dimitr, see letter 22.11.2017 09:05

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