Bug #70656 [Com]: require() statement broken after opcache_reset() or a few hours of use

From: Date: Sat, 31 Oct 2015 08:09:35 +0000
Subject: Bug #70656 [Com]: require() statement broken after opcache_reset() or a few hours of use
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196939@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70656&edit=1 ID: 70656 Comment by: tony dot levi at blackboard dot com Reported by: p at wspnr dot com Summary: require() statement broken after opcache_reset() or a few hours of use Status: Open Type: Bug Package: opcache Operating System: Debian (x86_64 and i686) PHP Version: 7.0Git-2015-10-07 (Git) Block user comment: N Private report: N New Comment: I can confirm that workaround and proposed fix solve the issue for me. It looks like the right solution - based on pattern elsewhere - but I'm not an expert either. Previous Comments: ------------------------------------------------------------------------ [2015-10-30 17:45:43] p at wspnr dot com I spent some time today tracing this bug as it is preventing our migration to PHP 7. The bug is caused by the opcache interned strings functionality. A simple workaround is to set opcache.interned_strings_buffer = 0 in php.ini. Looking at the code, I believe that the bug might be caused by this [0] call to memcpy(). Changing this to memcpy(ZSTR_VAL(p->key), ZSTR_VAL(str), ZSTR_LEN(str) + 1); has made the issue go away. However I am not familiar enough with opcache to determine whether this is an acceptable change. [0] http://lxr.php.net/xref/PHP_MASTER/ext/opcache/ZendAccelerator.c#374 ------------------------------------------------------------------------ [2015-10-30 12:36:25] machin dot dmitry at gmail dot com The same bug. Ubuntu 14.04.3 LTS PHP 7.0.1-dev (cli) (built: Oct 29 2015 10:15:42) ( NTS ) from PHP-7.0 branch ------------------------------------------------------------------------ [2015-10-25 15:55:10] p at wspnr dot com Updated bug summary ------------------------------------------------------------------------ [2015-10-24 17:35:05] p at wspnr dot com Can confirm: while this happens reliably with \opcache_reset(), we end up running into this issue after a couple of hours of regular use as well. ------------------------------------------------------------------------ [2015-10-23 06:20:50] ealexs at gmail dot com This bug is important, it breaks opcache until php-fpm gets a restart !!! It looks like a very simple fix !!! Probably a bad memcopy there, it does not copy the ending \0 Thanks ------------------------------------------------------------------------ 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=70656 -- Edit this bug report at https://bugs.php.net/bug.php?id=70656&edit=1

« previous php.bugs (#196939) next »