com php-src: Fixed bug #71930 (_zval_dtor_func: Ass ertion `(arr)->gc.refcount <= 1' fail ed): NEWS Zend/tests/bug71930.phpt Zend/z end_execute_API.c
| From: | Xinchen Hui | Date: | Fri, 01 Apr 2016 14:27:29 +0000 |
| Subject: | com php-src: Fixed bug #71930 (_zval_dtor_func: Ass ertion `(arr)->gc.refcount <= 1' fail ed): NEWS Zend/tests/bug71930.phpt Zend/z end_execute_API.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91578@lists.php.net to get a copy of this message | ||
Commit: 5b1bb41c0b125fe9964abaa1d523ce2ba1823cf6
Author: Xinchen Hui <laruence@gmail.com> Fri, 1 Apr 2016 22:27:29 +0800
Parents: 034e8ec02e263f5908b469bba1285e26c0a67bc4
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5b1bb41c0b125fe9964abaa1d523ce2ba1823cf6
Log:
Fixed bug #71930 (_zval_dtor_func: Assertion `(arr)->gc.refcount <= 1' failed)
Bugs:
https://bugs..php.net/71930
Changed paths:
M NEWS
A Zend/tests/bug71930.phpt
M Zend/zend_execute_API.c
Diff:
diff --git a/NEWS b/NEWS
index b81998b..f86d7b2 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PHP NEWS
?? ??? 2016 PHP 7.0.6
- Core:
+ . Fixed bug #71930 (_zval_dtor_func: Assertion `(arr)->gc.refcount <= 1'
+ failed). (Laruence)
. Fixed bug #71914 (Reference is lost in "switch"). (Laruence)
. Fixed Bug #71859 (zend_objects_store_call_destructors operates on realloced
memory, crashing). (Laruence)
diff --git a/Zend/tests/bug71930.phpt b/Zend/tests/bug71930.phpt
new file mode 100644
index 0000000..4604b88
--- /dev/null
+++ b/Zend/tests/bug71930.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Bug #71930 (_zval_dtor_func: Assertion `(arr)->gc.refcount <= 1' failed)
+--SKIPIF--
+<?php
+if (!extension_loaded("curl")) {
+ die("skip Require a resource which is able to hold a callbck");
+}
+?>
+--FILE--
+<?php
+
+class A {
+ public static function dummy() {
+ }
+}
+
+$a = array();
+$a[] = "A";
+$a[] = "dummy";
+
+$ch1 = curl_init();
+curl_setopt($ch1, CURLOPT_HEADERFUNCTION, $a);
+
+set_error_handler($a);
+set_error_handler(function()use($ch1){});
+set_error_handler(function(){});
+?>
+okey
+--EXPECT--
+okey
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 650f0a1..bdb9bb7 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -295,8 +295,8 @@ void shutdown_executor(void) /* {{{ */
}
zend_stack_clean(&EG(user_error_handlers_error_reporting), NULL, 1);
- zend_stack_clean(&EG(user_error_handlers), (void (*)(void *))ZVAL_DESTRUCTOR, 1);
- zend_stack_clean(&EG(user_exception_handlers), (void (*)(void *))ZVAL_DESTRUCTOR, 1);
+ zend_stack_clean(&EG(user_error_handlers), (void (*)(void *))ZVAL_PTR_DTOR, 1);
+ zend_stack_clean(&EG(user_exception_handlers), (void (*)(void *))ZVAL_PTR_DTOR, 1);
} zend_end_try();
zend_try {