Bug #70237 [Opn->Csd]: Empty while and do-while segmentation fault with opcode on CLI enabled
| From: | laruence@php.net | Date: | Tue, 11 Aug 2015 13:49:39 +0000 |
| Subject: | Bug #70237 [Opn->Csd]: Empty while and do-while segmentation fault with opcode on CLI enabled | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-195121@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70237&edit=1
ID: 70237
Updated by: laruence@php.net
Reported by: notrix at gmail dot com
Summary: Empty while and do-while segmentation fault with
opcode on CLI enabled
-Status: Open
+Status: Closed
Type: Bug
Package: opcache
Operating System: Ubuntu 14.04
PHP Version: 5.5.28
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=79cd9a18b505e8d77d16abe6ef146d4b4ff02ed9
Log: Fixed bug #70237 (Empty while and do-while segmentation fault with opcode on CLI enabled).
Previous Comments:
------------------------------------------------------------------------
[2015-08-11 08:43:06] notrix at gmail dot com
Description:
------------
If I enable opcache on cli environment (opcache.enable_cli) and run my test.php script I get:
"[1] 19066 segmentation fault (core dumped) php test.php"
This happens only if while (or do-while) condition is variable and content (between curly braces) is
empty or contains only comments.
Actually the code makes no sense, but I had to debug few hours and found this exact code with only
comment "// TODO: .." in do-while braces. Commenting out whole loop block fixed issue, but
it's still a bug I think.
Reproduced on php 5.5.27 and 5.6.11
Test script:
---------------
<?php
if ((int) ini_get('opcache.enable_cli') !== 1) {
throw new Exception('Opcode cache must be enabled on CLI environment');
}
function neverUsed() {
$bool = false;
while ($bool) { };
// Same with: do { } while ($bool);
}
echo "OK";
Expected result:
----------------
Expected to see OK printed
Actual result:
--------------
[1] 19066 segmentation fault (core dumped) php test.php
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70237&edit=1