Bug #79535 [Com]: PHP crashes with specific opcache.optimization_level

From: Date: Mon, 15 Mar 2021 07:02:56 +0000
Subject: Bug #79535 [Com]: PHP crashes with specific opcache.optimization_level
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232719@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79535&edit=1 ID: 79535 Comment by: modelmonikasharma at gmail dot com Reported by: roland at nextendweb dot com Summary: PHP crashes with specific opcache.optimization_level Status: Closed Type: Bug Package: opcache Operating System: Windows, Linux PHP Version: 7.3.17 Block user comment: N Private report: N New Comment: I Don't thing anyone write better that this. Amazing Post!! Keep it up! <a href="https://www.aarinkaur.com/">Mumbai Escorts</a> <a href="https://www.aarinkaur.com/">Escorts Mumbai</a> Previous Comments: ------------------------------------------------------------------------ [2020-05-04 12:52:57] nikic@php.net Automatic comment on behalf of nikita.ppv@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=7c1316ec6a726adaf96b9101054b85bbd763c14f Log: Fixed bug #79535 ------------------------------------------------------------------------ [2020-05-04 11:09:32] nikic@php.net Minimal: function create() { $name = stdClass::class; return new $name; } var_dump(create()); with -d opcache.optimization_level=0x000000a0 (only SCCP) ==9022== Conditional jump or move depends on uninitialised value(s) ==9022== at 0xADEAEF: ZEND_FETCH_CLASS_SPEC_UNUSED_CONST_HANDLER (zend_vm_execute.h:31745) ==9022== by 0xB096C8: execute_ex (zend_vm_execute.h:58853) ==9022== by 0xB0B8B1: zend_execute (zend_vm_execute.h:60939) ==9022== by 0xA2FD73: zend_execute_scripts (zend.c:1568) ==9022== by 0x99562D: php_execute_script (main.c:2639) ==9022== by 0xB0E6C3: do_cli (php_cli.c:997) ==9022== by 0xB0F8F5: main (php_cli.c:1393) Has something to do with the FETCH_CLASS cache slot. ------------------------------------------------------------------------ [2020-05-04 10:29:24] nikic@php.net Can confirm that the test case crashes at opcache.optimization_level=0xfffffaaf (but not at the default level). ------------------------------------------------------------------------ [2020-04-30 13:10:08] roland at nextendweb dot com Good news! I was able to create a reduced test case where this bug happens. Could you verify that the crash happens for you too? https://www.dropbox.com/s/3jp5dzyfzmurxcc/php-bug-79535.zip?dl=1 Run index.php The desired output: html{padding:0;}Hello World If you open LessCompiler.php and replace protected function newFormatter() { $className = Compressed::class; return new $className; } with protected function newFormatter() { return new Compressed(); } It will work fine. Also when you invalidate opcode cache for LessCompiler.php, then it works for the first load and every other try crashes. ------------------------------------------------------------------------ [2020-04-30 10:00:41] nikic@php.net I can't do anything about this without a way to reproduce. The only suggestion I have is to make sure that the optimization level is masked with 0xfffeffff, which disables an unsafe (in the sense of "can crash" rather than "can cause misbehavior") optimization, though I doubt that is the actual cause. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=79535 -- Edit this bug report at https://bugs.php.net/bug.php?id=79535&edit=1

« previous php.bugs (#232719) next »