Uncategorized

A Trappable error C0000005 occured in an external object, the script cannot continue running

This is an Access Violation exception which can have different causes (MDAC bad installation, third party components such as Oracle dlls which Oracle has a fix for etc…), but in the specific case I had some time ago this was due to a corrupted Windows Scripting Host engine. This was a classic ASP application and it was crashing randomly; we captured a dump with adplus (4 dumps, actually) and the stack of the faulting thread was always the same:

0:020> kpL2000
ChildEBP RetAddr  
04f5f5c8 7346520b vbscript!VarStack::SetMasterSp(long cvar = 6, class VAR ** ppvarSp = 0x04f5f6b8)+0xa3
04f5f5e4 7346492e vbscript!CScriptRuntime::Init(class CSession * psess = 0x00000000, class FncInfo * pfin = 0x04654e28, class VAR * pvarThis = 0x00000000, int cvar = 0, class VAR * prgvar = 0x00000000, unsigned long grfcall = 0)+0x265
04f5f6f0 73464cd2 vbscript!CScriptEntryPoint::Call(class VAR * pvarRes = 0x00000000, int cvar = 0, class VAR * prgvar = 0x00000000, class VAR * pvarThis = 0x00000000, unsigned long grfCall = 0)+0x4a
04f5f748 73465522 vbscript!CSession::Execute(class IEntryPoint * pep = 0x04654e20, struct tagVARIANT * pvarRes = 0x00000000, int cvar = 0, struct tagVARIANT * prgvar = 0x00000000, struct tagVARIANT * pvarThis = 0x00000000, unsigned long grfscr = 0)+0xb4
04f5f798 7346189b vbscript!COleScript::ExecutePendingScripts(struct tagVARIANT * pvarRes = 0x00000000, struct tagEXCEPINFO * pei = 0x00000000)+0x13e
04f5f7b4 709e2f5a vbscript!COleScript::SetScriptState(tagSCRIPTSTATE ss = SCRIPTSTATE_STARTED (1))+0x150
04f5f7e0 709e2f1a asp!CActiveScriptEngine::TryCall(unsigned short * strEntryPoint = 0x00000000)+0x19
04f5f81c 709f412b asp!CActiveScriptEngine::Call(unsigned short * strEntryPoint = 0x00000000)+0x31
04f5f824 709f40c8 asp!CActiveScriptEngine::MakeEngineRunnable(void)+0x7
04f5fa80 709f4231 asp!AllocAndLoadEngines(class CHitObj * pHitObj = 0x01db20f0, class CTemplate * pTemplate = 0x022b1fe8, struct ActiveEngineInfo * pEngineInfo = 0x04f5fb0c, class CScriptingNamespace * pScriptingNamespace = 0x020f2580, int fGlobalAsa = 1)+0x449
04f5fae0 709f4418 asp!ExecuteGlobal(class CHitObj * pHitObj = 0x01db20f0, class CIntrinsicObjects * intrinsics = 0x04f5fb68, struct ActiveEngineInfo * pEngineInfo = 0x04f5fb0c)+0x184
04f5fb44 709e2a4d asp!Execute(class CTemplate * pTemplate = 0x022b1e90, class CHitObj * pHitObj = 0x01db20f0, class CIntrinsicObjects * intrinsics = 0x04f5fb68, int fChild = 0)+0xb7
04f5fb98 709e271a asp!CHitObj::ViperAsyncCallback(int * pfRePosted = 0x00000000)+0x3e8
04f5fbb4 75bd72a5 asp!CViperAsyncRequest::OnCall(void)+0x92
04f5fbd0 7770f0eb comsvcs!CSTAActivityWork::STAActivityWorkHelper(void * pvoid = 0x05068f38)+0x32
04f5fc1c 7770fb38 ole32!EnterForCallback+0xc4
04f5fd7c 77710042 ole32!SwitchForCallback+0x1a3
04f5fda8 77694098 ole32!PerformCallback+0x54
04f5fe40 777127fd ole32!CObjectContext::InternalContextCallback+0x159
04f5fe60 75bd7649 ole32!CObjectContext::DoCallback+0x1c
04f5fecc 75bd79a5 comsvcs!CSTAActivityWork::DoWork(unsigned long * pdwWorkCount = 0x0012ced0)+0x12d
04f5fee4 75bd833e comsvcs!CSTAThread::DoWork(class CSTAWork * pWork = 0x05068f38)+0x18
04f5ff04 75bd878a comsvcs!CSTAThread::ProcessQueueWork(void)+0x37
04f5ff84 77bcb530 comsvcs!CSTAThread::WorkerLoop(void * pv = 0x0012ceb0)+0x17c
04f5ffb8 77e6608b msvcrt!_threadstartex(void * ptd = 0x010aebe0)+0x74
04f5ffec 00000000 kernel32!BaseThreadStart+0x34

The call stack shows the VBScript engine is called to run the ASP page, and is crashing just after the initialization; I’m not completely sure if this stack is specific to this problem or if we would have something similar also for the other known causes (MDAC and Oracle dlls) because unfortunately I’ve not had the chance to review those dumps, so just keep in mind this as a possible solution and not the only one…

Anyway here we fixed the problem reinstalling the Windows Scripting Host engine for Windows 2003 (version 5.7, as I’m writing).

 

 

Carlo

Quote of the day:

After I’m dead I’d rather have people ask why I have no monument than why I have one. – Cato the Elder

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.