Open
Description
When UDR is used in expression index, it could be called by background garbage collector which run in special system attachment.
Note, system attachment have no assigned provider and no external handle.
When ExtEngineManager access external handle of that system attachment - it crashes.
The call stack:
fbclient.dll!Why::YAttachment::YAttachment(aProvider, aNext, aDbPath) Line 4980
fbclient.dll!Why::MasterImplementation::registerAttachment(provider=0x0000000000000000, attachment=0x0000000000000000) Line 3729
fbclient.dll!Firebird::IMasterBaseImpl<Why::MasterImplementation,Firebird::CheckStatusWrapper,Firebird::IVersionedImpl<Why::MasterImplementation,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IMaster> > >::cloopregisterAttachmentDispatcher(self=0x0000000000000000, provider=0x000007fedb9c4a79, attachment=0x0000000000000004) Line 5728
engine12.dll!Jrd::ExtEngineManager::ExternalContextImpl::ExternalContextImpl(tdbb, aEngine) Line 607
engine12.dll!Jrd::ExtEngineManager::getEngineAttachment(tdbb=0x000000000766fa40, engine=0x00000000077f0388, closing=false) Line 1598
engine12.dll!Jrd::ExtEngineManager::makeFunction(tdbb=0x000000000766fa40, csb=0x00000000052a8b40, udf=0x0000000007717150, engine={...}, entryPoint={...}, body={...}) Line 1162
engine12.dll!Jrd::Function::loadMetadata(tdbb=0x000000000766fa40, id=58688, noscan=64, flags=25408) Line 1107
engine12.dll!Jrd::Function::lookup(tdbb=0x000000000766fa40, name={...}, noscan) Line 646
engine12.dll!Jrd::UdfCallNode::parse(tdbb=0x000000000766fa40, pool={...}, csb=0x00000000052a1dc0, blrOp) Line 11057
...
engine12.dll!Jrd::Routine::parseBlr(tdbb=0x000000000766fa40, csb=0x00000000052a1dc0, blob_id=0x000000000766c1a0, blobDbg=0x000000000766c190) Line 175
engine12.dll!Jrd::Function::loadMetadata(tdbb=0x000000000766fa40, id=22720, noscan=192, flags=25408) Line 1121
engine12.dll!Jrd::Function::lookup(tdbb=0x000000000766fa40, name={...}, noscan) Line 646
engine12.dll!Jrd::UdfCallNode::parse(tdbb=0x000000000766fa40, pool={...}, csb=0x0000000006aa4780, blrOp) Line 11057
engine12.dll!PAR_parse_node(tdbb=0x000000000766fa40, csb=0x0000000006aa4780) Line 1650
engine12.dll!PAR_blr(tdbb=0x000000000766fa40, relation, blr=0x000000000766cd68, blr_length, view_csb=0x0000000000000000, csb_ptr=0x000000000766d020, statementPtr=0x000000000766d278, trigger=false, flags=0) Line 235
engine12.dll!MET_parse_blob(tdbb=0x000000000766fa40, relation=0x00000000052630c0, blob_id, csb_ptr=0x000000000766d020, statementPtr=0x000000000766d278, trigger=false, validationExpr=false) Line 7804
engine12.dll!MET_lookup_index_expression(tdbb=0x000000000766fa40, relation=0x00000000052630c0, idx=0x000000000766d230) Line 7194
engine12.dll!BTR_description(tdbb, relation=0x00000000052630c0, root=0x0000000006902000, idx=0x000000000766d230, id=0) Line 518
engine12.dll!IDX_garbage_collect(tdbb=0x000000000766fa40, rpb=0x000000000766f420, going={...}, staying={...}) Line 738
engine12.dll!garbage_collect(tdbb=0x000000000766fa40, rpb=0x000000000766f420, prior_page=187, staying={...}) Line 4803
engine12.dll!purge(tdbb=0x000000000766fa40, rpb=0x000000000766f870) Line 6101
engine12.dll!VIO_chase_record_version(tdbb=0x000000000766fa40, rpb=0x000000000766f870, transaction=0x00000000048aee70, pool=0x0000000000000000, writelock=false, noundo=false) Line 1257
engine12.dll!VIO_next_record(tdbb=0x000000000766fa40, rpb=0x000000000766f870, transaction=0x00000000048aee70, pool=0x0000000000000000, onepage) Line 3094
engine12.dll!Jrd::Database::garbage_collector(dbb=0x000000000351ec40) Line 5008
engine12.dll!ThreadFinishSync<Jrd::Database * __ptr64>::internalRun() Line 189
engine12.dll!ThreadFinishSync<Jrd::Database * __ptr64>::internalRun(arg) Line 182
engine12.dll!threadStart(arg=0x000000000203f120) Line 97
msvcr120.dll!_callthreadstartex() Line 376 C
msvcr120.dll!_threadstartex(ptd=0x000000000059fb10) Line 354 C