Bug #72191 [Opn->Csd]: Segmentation Fault on recursively call class static function
| From: | cmb@php.net | Date: | Thu, 11 Feb 2021 17:37:37 +0000 |
| Subject: | Bug #72191 [Opn->Csd]: Segmentation Fault on recursively call class static function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-232072@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72191&edit=1
ID: 72191
Updated by: cmb@php.net
Reported by: kir dot 9 dot pro at gmail dot com
Summary: Segmentation Fault on recursively call class static
function
-Status: Open
+Status: Closed
Type: Bug
Package: Class/Object related
Operating System: win/nix
PHP Version: 5.6.21
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
> In 7 versions the mistake doesn't appear, [â¦]
The this ticket is obsolete[1].
[1] <https://www.php.net/supported-versions.php>
Previous Comments:
------------------------------------------------------------------------
[2016-08-17 21:12:57] brian dot carpenter at gmail dot com
Related To: Bug #72871
------------------------------------------------------------------------
[2016-05-11 06:10:59] kir dot 9 dot pro at gmail dot com
Description:
------------
In 7 versions the mistake doesn't appear, to povidimy because of other principle of work with
memory.
Probably it is possible to solve a problem check of value of a stack (ESP) by recursive/dynamic
calls.
tested on <= 5.6.21 versions
Test script:
---------------
<?php
class A{
public static function __callStatic($name, $arguments){
self::inf();
}
}
$b = new A;
$b::hello();
?>
Expected result:
----------------
Fatal error, as it is made in 7 versions.
Actual result:
--------------
root@de:/tmp/php-5.6.21# sapi/cli/php -v
PHP 5.6.21 (cli) (built: May 10 2016 19:37:58)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
root@de:/tmp/php-5.6.21/sapi/cli# gdb --args php -f /tmp/1.php
GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from php...done.
(gdb) display/10i $rip
(gdb) set heigth 0
No symbol "heigth" in current context.
(gdb) set height 0
(gdb) r
Starting program: /tmp/php-5.6.21/sapi/cli/php -f /tmp/1.php
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00000000006a7156 in _zend_mm_alloc_int (heap=0xea81c0, size=72) at
/tmp/php-5.6.21/Zend/zend_alloc.c:1881
1881 {
1: x/10i $rip
=> 0x6a7156 <_zend_mm_alloc_int+6>: push %r12
0x6a7158 <_zend_mm_alloc_int+8>: mov %rsi,%r13
0x6a715b <_zend_mm_alloc_int+11>: push %rbp
0x6a715c <_zend_mm_alloc_int+12>: push %rbx
0x6a715d <_zend_mm_alloc_int+13>: mov %rdi,%r12
0x6a7160 <_zend_mm_alloc_int+16>: sub $0x18,%rsp
0x6a7164 <_zend_mm_alloc_int+20>: cmp $0xf,%rsi
0x6a7168 <_zend_mm_alloc_int+24>: jbe 0x6a71f0 <_zend_mm_alloc_int+160>
0x6a716e <_zend_mm_alloc_int+30>: lea 0x7fdb93(%rip),%rax # 0xea4d08
<zend_block_interruptions>
0x6a7175 <_zend_mm_alloc_int+37>: lea 0x17(%rsi),%rbp
(gdb) set logging on
(gdb) bt full
backtrace file (25Mb): http://rnsd.ru/down/php-bt-z8f02lds_fas.txt
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72191&edit=1