Bug #70428 [ReO->Fbk]: Opcache crashes with SIGSEGV

From: Date: Wed, 23 Dec 2015 10:08:20 +0000
Subject: Bug #70428 [ReO->Fbk]: Opcache crashes with SIGSEGV
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198161@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70428&edit=1 ID: 70428 Updated by: requinix@php.net Reported by: christian at rishoj dot net Summary: Opcache crashes with SIGSEGV -Status: Re-Opened +Status: Feedback Type: Bug Package: opcache Operating System: Ubuntu 14.04 PHP Version: 5.6.12 Block user comment: N Private report: N New Comment: @viking: > $this->{self::TEST_CONST}(); That will cause PHP to call testConst() repeatedly until the process eventually runs out of stack space and crashes. This is expected behavior. Do you have a test case that is related to @christian's problem with opcache and the opcache.interned_strings_buffer setting? Previous Comments: ------------------------------------------------------------------------ [2015-12-23 08:57:15] viking at xakep dot ru No, it not that bug. So this is one, but floating reproduction. Always reproduce after first crash of php_fpm TestClass.php >> <?php class TestClass { public function __get($field) {} public function someMethodName() { return $this->someMethodName; } } ?> ----------------------- baseClass.php >> spl_autoload_register(function($className){ $fileName = $className . '.php'; include $fileName; }); class baseClass extends TestClass{ const TEST_CONST = 'testConst'; private function testConst() { if ( true) { $this->{self::TEST_CONST}(); } } } $class = new baseClass(); ?> php 5.6.12 on 3.10.0-229.7.2.el7.x86_64 ------------------------------------------------------------------------ [2015-12-21 09:34:38] christian at rishoj dot net Thanks, but are you sure this test case reproduces the opcache bug? It causes the PHP CLI interpreter to crash with SIGSEGV regardless of whether opcache is enabled or not. Also, judging from a back trace, the crash does not not seem to involve the opcache. ------------------------------------------------------------------------ [2015-12-21 08:32:48] viking at xakep dot ru i've isolated minimal test case. <?php spl_autoload_register(function($className){ $fileName = $className . '.php'; include $fileName; unlink($fileName); }); $symbols = array_merge(range('a', 'z'), range('A', 'Z'), ['_']); class baseClass { public $arr = []; } $oldClassName = 'baseClass'; for ($k=0; $k < 10000; ++$k) { $className = ''; do { for ($len = rand(10, 22); $len > 0; --$len) { $className .= $symbols[rand(0, count($symbols) - 1)]; } } while (class_exists($className, false)); $className = trim($className, '_ '); $code = '<?php class ' . $className . ' extends ' . $oldClassName . '{}'; file_put_contents($className . '.php', $code); $oldClassName = $className; } $class = new $className($class); var_dump($class); ------------------------------------------------------------------------ [2015-10-18 04:22:21] php-bugs at lists dot php dot net No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. ------------------------------------------------------------------------ [2015-10-04 06:26:04] laruence@php.net Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. ------------------------------------------------------------------------ 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=70428 -- Edit this bug report at https://bugs.php.net/bug.php?id=70428&edit=1

« previous php.bugs (#198161) next »