Bug #80805 [Ver->Csd]: create simple class and get error in opcache.so

From: Date: Mon, 01 Mar 2021 14:14:08 +0000
Subject: Bug #80805 [Ver->Csd]: create simple class and get error in opcache.so
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232452@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80805&edit=1 ID: 80805 Updated by: nikic@php.net Reported by: alexandr dot budko at gmail dot com Summary: create simple class and get error in opcache.so -Status: Verified +Status: Closed Type: Bug Package: opcache Operating System: Debian 10 PHP Version: 7.4.15 Assigned To: nikic Block user comment: N Private report: N New Comment: Automatic comment on behalf of nikita.ppv@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=e8579365181d8e61c00968715ed8be5ec151002d Log: Fixed bug #80805 Previous Comments: ------------------------------------------------------------------------ [2021-03-01 14:11:05] nikic@php.net This was fixed in PHP-8.0 by https://github.com/php/php-src/commit/8446e2827585c37d0739f8d44fa8d359cbbb6551, needs backport. ------------------------------------------------------------------------ [2021-02-26 19:09:58] alexandr dot budko at gmail dot com Description: ------------ If run this script after a few second I get 502 nginx error. there will be no error if: - change type in property <int $foo;> to <?int $foo = null;> - clear type in property <int $foo;> to <$foo;> - change method inc() to <$result = $this->foo += 2; return $result;> Info: ------ OS System Linux devtest 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 php-fpm 7.4.15 || php-fpm 7.4.9 || php-fpm 7.4.4 nginx 1.18.0 xdebug disabled. When xdebug enabled (with remote IDE) script works without error. opcache default settings. -------- GDB bt [New LWP 412] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `php-fpm: pool www '. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007ff739942263 in ?? () from /usr/lib/php/20190902/opcache.so #1 0x00007ff739952444 in ?? () from /usr/lib/php/20190902/opcache.so #2 0x00007ff7399589b8 in ?? () from /usr/lib/php/20190902/opcache.so #3 0x00007ff739958b64 in ?? () from /usr/lib/php/20190902/opcache.so #4 0x00007ff73993c08a in ?? () from /usr/lib/php/20190902/opcache.so #5 0x00007ff73992d9bf in ?? () from /usr/lib/php/20190902/opcache.so #6 0x00007ff7399195f1 in ?? () from /usr/lib/php/20190902/opcache.so #7 0x0000558a4680089c in zend_execute_scripts () #8 0x0000558a4679fc90 in php_execute_script () #9 0x0000558a46668a49 in ?? () #10 0x00007ff73bcb909b in __libc_start_main (main=0x558a46667bc0, argc=4, argv=0x7ffdd6b35a68, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffdd6b35a58) at ../csu/libc-start.c:308 #11 0x0000558a4666985a in _start () Test script: --------------- class Test { public int $foo; public function __construct() { $this->foo = 2; } public function inc(): int { return $this->foo += 2; } } $ee = new Test(); Expected result: ---------------- no errors Actual result: -------------- 502 nginx error ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80805&edit=1

« previous php.bugs (#232452) next »