#42317 [Fbk]: The JVM cores in at _zval_ptr_dtor()
| From: | jani@php.net | Date: | Thu, 16 Aug 2007 22:36:35 +0000 |
| Subject: | #42317 [Fbk]: The JVM cores in at _zval_ptr_dtor() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-116206@lists.php.net to get a copy of this message | ||
ID: 42317
Updated by: jani@php.net
Reported By: jfclere at gmail dot com
Status: Feedback
Bug Type: Reproducible crash
Operating System: RHEL 5 + JRockit
PHP Version: 5.2.3
New Comment:
Also, you should provide any patches against the latest sources:
http://snaps.php.net/php5.2-latest.tar.gz
Please try the snapshot first (without any patches!).
Previous Comments:
------------------------------------------------------------------------
[2007-08-16 22:35:55] jani@php.net
I'm more interested on what platform and configuration you need this
"fix" since it's not proper fix.
------------------------------------------------------------------------
[2007-08-16 14:29:25] jfclere at gmail dot com
If *zval_ptr is NULL the actual code in
php-5.2.3/Zend/zend_execute_API.c will core on some platforms
This is fixed by applying the following patch:
+++
--- php-5.2.3/Zend/zend_execute_API.c 2007-08-16 08:12:59.927931000
-0400
+++ php-5.2.3/Zend/zend_execute_API.c 2007-08-16 10:12:26.919010000
-0400
@@ -406,6 +406,8 @@
ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC)
{
+ if (*zval_ptr == NULL)
+ return;
#if DEBUG_ZEND>=2
printf("Reducing refcount for %x (%x): %d->%d\n", *zval_ptr,
zval_ptr, (*zval_ptr)->refcount, (*zval_ptr)->refcount-1);
#endif
+++
------------------------------------------------------------------------
[2007-08-16 12:02:42] jfclere at gmail dot com
Description:
------------
When accessing to a php page via our php servlet on IA64 with JRockit
1.5.x we get a core.
Reproduce code:
---------------
That is an embbedded php in a JVM. Any php code causes the problem.
Expected result:
----------------
A page to be displayed.
Actual result:
--------------
+++
Thread Stack Trace:
at _zval_ptr_dtor(zend_execute_API.c:412)@0x4a520e80
at zend_do_fcall_common_helper_SPEC(zend_execute.h:155)@0x4a59f1a0
at execute(zend_vm_execute.h:92)@0x4a59e4d0
at
zend_do_fcall_common_helper_SPEC(zend_vm_execute.h:234)@0x4a59ec80
at execute(zend_vm_execute.h:92)@0x4a59e4d0
at zend_execute_scripts(zend.c:1135)@0x4a54d560
at php_execute_script(main.c:1794)@0x4a4984a0
at Java_org_jboss_web_php_Handler_php()@0x45372770
+++
The problem is fixed by adding in _zval_ptr_dtor:
+++
if (*zval_ptr == NULL)
return;
+++
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42317&edit=1