#42317 [Fbk->Opn]: The JVM cores in at _zval_ptr_dtor()

From: Date: Thu, 16 Aug 2007 14:29:26 +0000
Subject: #42317 [Fbk->Opn]: The JVM cores in at _zval_ptr_dtor()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-116194@lists.php.net to get a copy of this message
 ID:               42317
 User updated by:  jfclere at gmail dot com
 Reported By:      jfclere at gmail dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         Reproducible crash
 Operating System: RHEL 5 + JRockit
 PHP Version:      5.2.3
 New Comment:

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
+++


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

[2007-08-16 13:37:28] jani@php.net

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.




------------------------------------------------------------------------

[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


Thread (1 message)

  • jfclere at gmail dot com
  • Unknown Message
    • jfclere at gmail dot com
« previous php.bugs (#116194) next »