php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58096 Undefined symbols on PHP 5.3.0
Submitted: 2008-03-10 07:53 UTC Modified: 2013-02-23 11:20 UTC
Votes:2
Avg. Score:3.5 ± 1.5
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: hubbitus@php.net Assigned: pollita (profile)
Status: Closed Package: runkit (PECL)
PHP Version: 5_2 CVS-2008-03-10 OS: Linux
Private report: No CVE-ID: None
 [2008-03-10 07:53 UTC] hubbitus@php.net
Description:
------------
In PHP-5.3.0 from CVS 2008-02-26 (it is not in dropdown list of PHP versions in this form to BUG report) stable version 0.9 do not compiled with many errors, part of described in other bugs and partially fixed.

So, trying CVS-version (checkout at 2008-03-10).

Compiled successful, but not working due unresolved symbols with several errors (see Actual results).

Reproduce code:
---------------
Compile CVS, enable extension, and just run PHP:
php -m | grep runkit


Expected result:
----------------
Runkit enabled and working.

Actual result:
--------------
bash-3.2$ php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/runkit.so' - /usr/lib/php/modules/runkit.so: undefined symbol: ZVAL_REFCOUNT in Unknown on line 0

bash-3.2$ php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/runkit.so' - /usr/lib/php/modules/runkit.so: undefined symbol: ZVAL_ADDREF in Unknown on line 0

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-10 08:02 UTC] pahan at hubbitus dot spb dot su
Hmm... I have not found possibility attach patch to the post, so, put here as plain text:

Patch#0:
diff -NaurEbBH php-pecl-runkit-0.9.orig/runkit-0.9/runkit.c php-pecl-runkit-0.9/runkit-0.9/runkit.c
--- php-pecl-runkit-0.9.orig/runkit-0.9/runkit.c	2007-10-24 06:43:27.000000000 +0400
+++ php-pecl-runkit-0.9/runkit-0.9/runkit.c	2008-03-10 15:20:40.000000000 +0300
@@ -61,7 +61,8 @@
 	add_assoc_stringl(return_value, "address", addr, addr_len, 0);
 
 #if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || (PHP_MAJOR_VERSION >= 6)
-	add_assoc_long(return_value, "refcount", ZVAL_REFCOUNT(value));
+//*Hu	add_assoc_long(return_value, "refcount", ZVAL_REFCOUNT(value));
+	add_assoc_long(return_value, "refcount", Z_REFCOUNT_P(value));
 	add_assoc_bool(return_value, "is_ref", Z_ISREF_P(value));
 #else
 	add_assoc_long(return_value, "refcount", value->refcount);


Patch#1:
diff -NaurEbBH php-pecl-runkit-0.9.orig/runkit-0.9/runkit_constants.c php-pecl-runkit-0.9/runkit-0.9/runkit_constants.c
--- php-pecl-runkit-0.9.orig/runkit-0.9/runkit_constants.c	2007-10-24 06:43:27.000000000 +0400
+++ php-pecl-runkit-0.9/runkit-0.9/runkit_constants.c	2008-03-10 15:30:44.000000000 +0300
@@ -71,7 +71,8 @@
 	zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t)php_runkit_update_children_consts, 4, ce, c, cname, cname_len);
 
 	zend_hash_del(&ce->constants_table, cname, cname_len + 1);
-	ZVAL_ADDREF(c);
+//*Hu	ZVAL_ADDREF(c);
+	Z_ADDREF_P(c);
 	if (zend_hash_add(&ce->constants_table, cname, cname_len + 1, c, sizeof(zval*), NULL) ==  FAILURE) {
 		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error updating child class");
 		return ZEND_HASH_APPLY_KEEP;
diff -NaurEbBH php-pecl-runkit-0.9.orig/runkit-0.9/runkit_import.c php-pecl-runkit-0.9/runkit-0.9/runkit_import.c
--- php-pecl-runkit-0.9.orig/runkit-0.9/runkit_import.c	2006-10-26 20:18:52.000000000 +0400
+++ php-pecl-runkit-0.9/runkit-0.9/runkit_import.c	2008-03-10 15:32:00.000000000 +0300
@@ -193,7 +193,8 @@
 					goto import_const_skip;
 				}
 			}
-			ZVAL_ADDREF(*c);
+//*Hu			ZVAL_ADDREF(*c);
+			Z_ADDREF_P(*c);
 			if (zend_hash_add_or_update(&dce->constants_table, key, key_len, (void*)c, sizeof(zval*), NULL, action) == FAILURE) {
 				zval_ptr_dtor(c);
 				php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to import %s::%s", dce->name, key);
@@ -241,7 +242,8 @@
 					goto import_prop_skip;
 				}
 			}
-			ZVAL_ADDREF(*p);
+//*Hu			ZVAL_ADDREF(*p);
+			Z_ADDREF_P(*p);
 			if (zend_hash_add_or_update(&dce->default_properties, key, key_len, (void*)p, sizeof(zval*), NULL, action) == FAILURE) {
 				zval_ptr_dtor(p);
 				php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to import %s->%s", dce->name, pname);
diff -NaurEbBH php-pecl-runkit-0.9.orig/runkit-0.9/runkit_props.c php-pecl-runkit-0.9/runkit-0.9/runkit_props.c
--- php-pecl-runkit-0.9.orig/runkit-0.9/runkit_props.c	2007-10-24 06:43:27.000000000 +0400
+++ php-pecl-runkit-0.9/runkit-0.9/runkit_props.c	2008-03-10 15:32:16.000000000 +0300
@@ -45,7 +45,8 @@
 	zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t)php_runkit_update_children_def_props, 4, ce, p, pname, pname_len);
 
 	zend_hash_del(&ce->default_properties, pname, pname_len + 1);
-	ZVAL_ADDREF(p);
+//*Hu	ZVAL_ADDREF(p);
+	Z_ADDREF_P(p);
 	if (zend_hash_add(&ce->default_properties, pname, pname_len + 1, p, sizeof(zval*), NULL) ==  FAILURE) {
 		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error updating child class");
 		return ZEND_HASH_APPLY_KEEP;
 [2010-09-29 22:30 UTC] tychay at alumni dot caltech dot edu
Applied patchfile (based on above) on PHP yum on fedora core

============================================================
=========
TEST RESULT SUMMARY
------------------------------------------------------------
---------
Exts skipped    :    0
Exts tested     :   29
------------------------------------------------------------
---------

Number of tests :   48                20
Tests skipped   :   28 ( 58.3%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :   20 ( 41.7%) (100.0%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :    0 (  0.0%) (  0.0%)
------------------------------------------------------------
---------
Time taken      :    2 seconds
============================================================
=========

============================================================
=========
FAILED TEST SUMMARY
------------------------------------------------------------
---------
runkit_method_copy() function [tests/bug10053.phpt]
Bug #10300 Segfault when copying __call() 
[tests/bug10300.phpt]
Bug #4519 Unable to override class definitions of a derived 
class [tests/bug4519.phpt]
runkit_class_adopt() function 
[tests/runkit_class_adopt.phpt]
runkit_class_emancipate() function 
[tests/runkit_class_emancipate.phpt]
runkit_constant_add() function 
[tests/runkit_constant_add.phpt]
runkit_constant_redefine() function 
[tests/runkit_constant_redefine.phpt]
runkit_constant_remove() function 
[tests/runkit_constant_remove.phpt]
runkit_function_add() function 
[tests/runkit_function_add.phpt]
runkit_function_copy() function 
[tests/runkit_function_copy.phpt]
runkit_function_redefine() function 
[tests/runkit_function_redefine.phpt]
runkit_function_remove() function 
[tests/runkit_function_remove.phpt]
runkit_function_rename() function 
[tests/runkit_function_rename.phpt]
runkit_import() Importing and overriding functions 
[tests/runkit_import_functions.phpt]
runkit_method_add() function [tests/runkit_method_add.phpt]
runkit_method_copy() function 
[tests/runkit_method_copy.phpt]
runkit_method_redefine() function 
[tests/runkit_method_redefine.phpt]
runkit_method_remove() function 
[tests/runkit_method_remove.phpt]
runkit_method_rename() function 
[tests/runkit_method_rename.phpt]
runkit_return_value_used() function 
[tests/runkit_return_value_used.phpt]
============================================================
=========

Index: runkit_props.c
============================================================
=======
--- runkit_props.c  (revision 303882)
+++ runkit_props.c  (working copy)
@@ -45,7 +45,8 @@
    zend_hash_apply_with_arguments(EG(class_table), 
(apply_func_args_t)php_runkit_update_children_def_props, 4, 
ce, p, pname, pname_len);

    zend_hash_del(&ce->default_properties, pname, pname_len 
+ 1);
-   ZVAL_ADDREF(p);
+//*Hu  ZVAL_ADDREF(p);
+   Z_ADDREF_P(p);
    if (zend_hash_add(&ce->default_properties, pname, 
pname_len + 1, p, sizeof(zval*), NULL) ==  FAILURE) {
        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error 
updating child class");
        return ZEND_HASH_APPLY_KEEP;
Index: runkit_import.c
============================================================
=======
--- runkit_import.c (revision 303882)
+++ runkit_import.c (working copy)
@@ -179,7 +179,8 @@
                    goto import_const_skip;
                }
            }
-           ZVAL_ADDREF(*c);
+//*Hu      ZVAL_ADDREF(*c);
+           Z_ADDREF_P(*c);
            if (zend_hash_add_or_update(&dce-
>constants_table, key, key_len, (void*)c, sizeof(zval*), 
NULL, action) == FAILURE) {
                zval_ptr_dtor(c);
                php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"Unable to import %s::%s", dce->name, key);
@@ -227,7 +228,8 @@
                    goto import_prop_skip;
                }
            }
-           ZVAL_ADDREF(*p);
+//*Hu      ZVAL_ADDREF(*p);
+           Z_ADDREF_P(*p);
            if (zend_hash_add_or_update(&dce-
>default_properties, key, key_len, (void*)p, sizeof(zval*), 
NULL, action) == FAILURE) {
                zval_ptr_dtor(p);
                php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"Unable to import %s->%s", dce->name, pname);
Index: runkit_constants.c
============================================================
=======
--- runkit_constants.c  (revision 303882)
+++ runkit_constants.c  (working copy)
@@ -71,7 +71,8 @@
    zend_hash_apply_with_arguments(EG(class_table), 
(apply_func_args_t)php_runkit_update_children_consts, 4, ce, 
c, cname, cname_len);

    zend_hash_del(&ce->constants_table, cname, cname_len + 
1);
-   ZVAL_ADDREF(c);
+//*Hu  ZVAL_ADDREF(c);
+   Z_ADDREF_P(c);
    if (zend_hash_add(&ce->constants_table, cname, cname_len 
+ 1, c, sizeof(zval*), NULL) ==  FAILURE) {
        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error 
updating child class");
        return ZEND_HASH_APPLY_KEEP;
Index: runkit.c
============================================================
=======
--- runkit.c    (revision 303882)
+++ runkit.c    (working copy)
@@ -61,7 +61,8 @@
    add_assoc_stringl(return_value, "address", addr, 
addr_len, 0);

 #if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || 
(PHP_MAJOR_VERSION >= 6)
-   add_assoc_long(return_value, "refcount", 
ZVAL_REFCOUNT(value));
+//*Hu  add_assoc_long(return_value, "refcount", 
ZVAL_REFCOUNT(value));
+   add_assoc_long(return_value, "refcount", 
Z_REFCOUNT_P(value));
    add_assoc_bool(return_value, "is_ref", 
Z_ISREF_P(value));
 #else
    add_assoc_long(return_value, "refcount", value-
>refcount);                                                                
Index: runkit_props.c
============================================================
=======
--- runkit_props.c  (revision 303882)
+++ runkit_props.c  (working copy)
@@ -45,7 +45,8 @@
    zend_hash_apply_with_arguments(EG(class_table), 
(apply_func_args_t)php_runkit_update_children_def_props, 4, 
ce, p, pname, pname_len);

    zend_hash_del(&ce->default_properties, pname, pname_len 
+ 1);
-   ZVAL_ADDREF(p);
+//*Hu  ZVAL_ADDREF(p);
+   Z_ADDREF_P(p);
    if (zend_hash_add(&ce->default_properties, pname, 
pname_len + 1, p, sizeof(zval*), NULL) ==  FAILURE) {
        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error 
updating child class");
        return ZEND_HASH_APPLY_KEEP;
Index: runkit_import.c
============================================================
=======
--- runkit_import.c (revision 303882)
+++ runkit_import.c (working copy)
@@ -179,7 +179,8 @@
                    goto import_const_skip;
                }
            }
-           ZVAL_ADDREF(*c);
+//*Hu      ZVAL_ADDREF(*c);
+           Z_ADDREF_P(*c);
            if (zend_hash_add_or_update(&dce-
>constants_table, key, key_len, (void*)c, sizeof(zval*), 
NULL, action) == FAILURE) {
                zval_ptr_dtor(c);
                php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"Unable to import %s::%s", dce->name, key);
@@ -227,7 +228,8 @@
                    goto import_prop_skip;
                }
            }
-           ZVAL_ADDREF(*p);
+//*Hu      ZVAL_ADDREF(*p);
+           Z_ADDREF_P(*p);
            if (zend_hash_add_or_update(&dce-
>default_properties, key, key_len, (void*)p, sizeof(zval*), 
NULL, action) == FAILURE) {
                zval_ptr_dtor(p);
                php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"Unable to import %s->%s", dce->name, pname);
Index: runkit_constants.c
============================================================
=======
--- runkit_constants.c  (revision 303882)
+++ runkit_constants.c  (working copy)
@@ -71,7 +71,8 @@
    zend_hash_apply_with_arguments(EG(class_table), 
(apply_func_args_t)php_runkit_update_children_consts, 4, ce, 
c, cname, cname_len);

    zend_hash_del(&ce->constants_table, cname, cname_len + 
1);
-   ZVAL_ADDREF(c);
+//*Hu  ZVAL_ADDREF(c);
+   Z_ADDREF_P(c);
    if (zend_hash_add(&ce->constants_table, cname, cname_len 
+ 1, c, sizeof(zval*), NULL) ==  FAILURE) {
        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error 
updating child class");
        return ZEND_HASH_APPLY_KEEP;
Index: runkit.c
============================================================
=======
--- runkit.c    (revision 303882)
+++ runkit.c    (working copy)
@@ -61,7 +61,8 @@
    add_assoc_stringl(return_value, "address", addr, 
addr_len, 0);

 #if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || 
(PHP_MAJOR_VERSION >= 6)
-   add_assoc_long(return_value, "refcount", 
ZVAL_REFCOUNT(value));
+//*Hu  add_assoc_long(return_value, "refcount", 
ZVAL_REFCOUNT(value));
+   add_assoc_long(return_value, "refcount", 
Z_REFCOUNT_P(value));
    add_assoc_bool(return_value, "is_ref", 
Z_ISREF_P(value));
 #else
    add_assoc_long(return_value, "refcount", value-
>refcount);
 [2013-02-23 11:20 UTC] pollita@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2013-02-23 11:20 UTC] pollita@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: pollita
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Sep 30 07:01:23 2020 UTC