From: filipski at mail dot md Operating system: Windows PHP version: 5.2.4RC1 PHP Bug Type: Reproducible crash Bug description: Crash after exit mai function
Description: ------------ A problem with php5activescript.dll I created a new Win32 Console application in VisualStudio2005. Everything runs fine until the very end. But after returning from function main() the program waits some time and crashes. So, it: 1. It unload slowly 2. It crashes When doing the same with Python, PerlScript, JScript, VBScript there is no problem after the function main exits. The program runs fine, invokes the script dispatch functions, exits ok, quick and with no crashes. BTW after the program ends, the engine unloads very slowly. Much slower than other engines I tried Python, PerlScript, JScript, VBScript. Reproduce code: --------------- int main(){...CoInitialize();...{ IActiveScriptSite* pSite = new MyActiveScriptSite(); CComPtr<IActiveScript> pas; CComPtr<IDispatch> pDisp; HRESULT hr; CComPtr<IActiveScriptParse> pasp; hr = pasp.CoCreateInstance(L"PHPScript", 0, CLSCTX_ALL); hr = pasp->InitNew(); hr = pasp->QueryInterface(&pas); hr = pas->SetScriptSite(pSite); EXCEPINFO ei; wchar_t *pwszCode = L".... some PHP code in UNICODE format... hr = pasp->ParseScriptText(pwszCode, 0, 0, 0, 0, 0, SCRIPTTEXT_ISPERSISTENT, 0, &ei); ... } CoUninitialize(); Expected result: ---------------- I expect the engine to unload imediately, quickly and with no crashes. Actual result: -------------- A diallog box with a crash report is shown: Unhandled exception at 0x011aa455 in eval.exe: 0xC0000005: Access violation reading location 0x019eceb8. This is the call stack, maybe it could be helpful: php5ts.dll!011aa455() [Frames below may be incorrect and/or missing, no symbols loaded for php5ts.dll] php5ts.dll!011aa1a8() php5ts.dll!011aa1c4() php5ts.dll!01199a97() php5ts.dll!01101f22() php5ts.dll!011db5e6() php5activescript.dll!10001fa2() ntdll.dll!7c91056d() kernel32.dll!7c80995a() ntdll.dll!7c91056d() msvcrt.dll!77c2c2de() msvcrt.dll!77c2c2e3() kernel32.dll!7c80996d() MSCTFIME.IME!755d9c87() MSCTFIME.IME!755d9fb8() php5activescript.dll!10006611() ntdll.dll!7c9011a7() ntdll.dll!7c923f31() ntdll.dll!7c96cd11() ntdll.dll!7c910945() ntdll.dll!7c91094e() kernel32.dll!7c81cd76() ntdll.dll!7c960af8() ntdll.dll!7c960bf0() ntdll.dll!7c960bcc() ntdll.dll!7c91056d() > eval.exe!_free_base(void * pBlock=0x7ffddc00) Line 109 + 0x12 bytes > C ntdll.dll!7c90f0aa() kernel32.dll!7c80e62b() kernel32.dll!7c80e45c() kernel32.dll!7c81cdee() eval.exe!__crtExitProcess(int status=0) Line 684 C eval.exe!doexit(int code=0, int quick=0, int retcaller=0) Line 596 + 0x9 bytes C eval.exe!exit(int code=0) Line 398 + 0xd bytes C eval.exe!__tmainCRTStartup() Line 333 C eval.exe!mainCRTStartup() Line 196 C kernel32.dll!7c816fd7() -- Edit bug report at http://bugs.php.net/?id=42232&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42232&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42232&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42232&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42232&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42232&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42232&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42232&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42232&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42232&r=support Expected behavior: http://bugs.php.net/fix.php?id=42232&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42232&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42232&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42232&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42232&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42232&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42232&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42232&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42232&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42232&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42232&r=mysqlcfg