php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42232 Crash after exit main() function
Submitted: 2007-08-07 09:49 UTC Modified: 2007-08-07 11:28 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: filipski at mail dot md Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 5.2.4RC1 OS: Windows
Private report: No CVE-ID: None
 [2007-08-07 09:49 UTC] 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() 	


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-07 09:50 UTC] filipski at mail dot md
summary edit
 [2007-08-07 10:16 UTC] jani@php.net
This is a PECL package, report bugs on it here instead:

http://pecl.php.net/bugs/report.php?package=PHPScript

 [2007-08-07 11:28 UTC] filipski at mail dot md
Thanks, I just have reported on PHP Script
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 20:01:28 2024 UTC