Bug #73241 [NEW]: php-cgi.exe is crashing while the script execution is being finalized
| From: | petr dot maly at remotehost dot cz | Date: | Tue, 04 Oct 2016 13:55:12 +0000 |
| Subject: | Bug #73241 [NEW]: php-cgi.exe is crashing while the script execution is being finalized | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-204442@lists.php.net to get a copy of this message | ||
From: petr dot maly at remotehost dot cz
Operating system: Windows 10
PHP version: 7.0.11
Package: COM related
Bug Type: Bug
Bug description:php-cgi.exe is crashing while the script execution is being finalized
Description:
------------
When the script uses COM object several times and all the statements are
executed, php-cgi.exe crashes while it is shutting down. This causes
that Apache returns error 5xx, the script code is executed correctly.
The crashing happens randomly. I was inspecting the code of
php_com_dotnet extension and I found that the php crashes while it is
trying to call destructor on function object:
com_handlers.c(237:246):
static void function_dtor(zval *zv)
{
zend_internal_function *f = (zend_internal_function*)Z_PTR_P(zv);
zend_string_release(f->function_name);
if (f->arg_info) {
efree(f->arg_info);
}
efree(f);
}
The destructor crashes because f->function_name is NULL (sometimes),
therefore
zend_string_release is unable to access member variables.
Suggested fix:
static void function_dtor(zval *zv)
{
zend_internal_function *f = (zend_internal_function*)Z_PTR_P(zv);
if (f->function_name != NULL) {
zend_string_release(f->function_name);
}
if (f->arg_info) {
efree(f->arg_info);
}
efree(f);
}
Best Regards,
Petr Maly
--
Edit bug report at https://bugs.php.net/bug.php?id=73241&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73241&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73241&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73241&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73241&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73241&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73241&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73241&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73241&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73241&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73241&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73241&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73241&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73241&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73241&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73241&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73241&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73241&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73241&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73241&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73241&r=mysqlcfg