Bug #79599 [Opn->Ver]: coredump in set_error_handler
| From: | laruence@php.net | Date: | Fri, 15 May 2020 07:00:38 +0000 |
| Subject: | Bug #79599 [Opn->Ver]: coredump in set_error_handler | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-227040@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79599&edit=1
ID: 79599
Updated by: laruence@php.net
Reported by: thedinosaurmail at gmail dot com
Summary: coredump in set_error_handler
-Status: Open
+Status: Verified
Type: Bug
Package: *General Issues
Operating System: ubuntu 16.04
PHP Version: 7.4.6
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2020-05-15 05:36:08] thedinosaurmail at gmail dot com
Description:
------------
the set_error_handler will coredump in NTS DEBUG MODE
the stack
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007ffff5d45801 in __GI_abort () at abort.c:79
#2 0x00007ffff5d3539a in __assert_fail_base (fmt=0x7ffff5ebc7d8 "%s%s%s:%u: %s%sAssertion
`%s' failed.\n%n",
assertion=assertion@entry=0x5555563ed9f0 "(zend_gc_refcount(&(ht)->gc) == 1) ||
((ht)->u.flags & (1<<6))", file=file@entry=0x5555563ed960
"/root/php-src/Zend/zend_hash.c",
line=line@entry=965, function=function@entry=0x5555563edee0 <__PRETTY_FUNCTION__.13579>
"_zend_hash_index_add_or_update_i") at assert.c:92
#3 0x00007ffff5d35412 in __GI___assert_fail (assertion=0x5555563ed9f0
"(zend_gc_refcount(&(ht)->gc) == 1) || ((ht)->u.flags & (1<<6))",
file=0x5555563ed960 "/root/php-src/Zend/zend_hash.c",
line=965, function=0x5555563edee0 <__PRETTY_FUNCTION__.13579>
"_zend_hash_index_add_or_update_i") at assert.c:101
#4 0x0000555555ba2bdb in _zend_hash_index_add_or_update_i (ht=0x7fffee6593c0, h=0,
pData=0x555556978ac0 <executor_globals>, flag=18) at /root/php-src/Zend/zend_hash.c:965
#5 0x0000555555ba3170 in zend_hash_next_index_insert (ht=0x7fffee6593c0, pData=0x555556978ac0
<executor_globals>) at /root/php-src/Zend/zend_hash.c:1078
#6 0x0000555555c5dcba in ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_OP_DATA_CV_HANDLER () at
/root/php-src/Zend/zend_vm_execute.h:46211
#7 0x0000555555c69ebf in execute_ex (ex=0x7fffee614020) at
/root/php-src/Zend/zend_vm_execute.h:57578
#8 0x0000555555c6a466 in zend_execute (op_array=0x7fffee682300, return_value=0x0) at
/root/php-src/Zend/zend_vm_execute.h:57922
#9 0x0000555555b8d2b4 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at
/root/php-src/Zend/zend.c:1666
#10 0x0000555555aee5b4 in php_execute_script (primary_file=0x7fffffffd0f0) at
/root/php-src/main/main.c:2617
#11 0x0000555555c6d070 in do_cli (argc=2, argv=0x55555697d570) at
/root/php-src/sapi/cli/php_cli.c:961
#12 0x0000555555c6e232 in main (argc=2, argv=0x55555697d570) at
/root/php-src/sapi/cli/php_cli.c:1356
it may relate the commit of
https://github.com/php/php-src/commit/a588b825d6f243935911e58591d4072ca5bcbcfb#diff-3054389ad750ce9a9f5895cd6d27800fR2222
and
Test script:
---------------
<?php
set_error_handler(function(){
throw new \Exception();
});
function test(){
$a[] = $b;
}
try{
test();
}catch(\Exception $e){
echo "catch";
}
Expected result:
----------------
it will catch and print "catch"
Actual result:
--------------
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79599&edit=1