ID:               42232
 User updated by:  filipski at mail dot md
-Summary:          Crash after exit mai function
 Reported By:      filipski at mail dot md
 Status:           Open
 Bug Type:         Reproducible crash
 Operating System: Windows
 PHP Version:      5.2.4RC1
 New Comment:

summary edit


Previous Comments:
------------------------------------------------------------------------

[2007-08-07 09:49:16] filipski at mail dot md

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 this bug report at http://bugs.php.net/?id=42232&edit=1

Reply via email to