Bug #80805 [NEW]: create simple class and get error in opcache.so
| From: | alexandr dot budko at gmail dot com | Date: | Fri, 26 Feb 2021 19:09:58 +0000 |
| Subject: | Bug #80805 [NEW]: create simple class and get error in opcache.so | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-232405@lists.php.net to get a copy of this message | ||
From: alexandr dot budko at gmail dot com
Operating system: Debian 10
PHP version: 7.4.15
Package: FPM related
Bug Type: Bug
Bug description:create simple class and get error in opcache.so
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 bug report at https://bugs.php.net/bug.php?id=80805&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80805&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80805&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80805&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80805&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80805&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80805&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80805&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80805&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80805&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80805&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80805&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80805&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80805&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80805&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80805&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80805&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80805&r=mysqlcfg