Bug #70795 [NEW]: Opcache causes segfaults when Constant Arrays are used under some concurrency

From: Date: Mon, 26 Oct 2015 16:42:25 +0000
Subject: Bug #70795 [NEW]: Opcache causes segfaults when Constant Arrays are used under some concurrency
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196822@lists.php.net to get a copy of this message
From:             bastiaan at mollie dot com
Operating system: Linux debian wheezy
PHP version:      5.6.14
Package:          opcache
Bug Type:         Bug
Bug description:Opcache causes segfaults when Constant Arrays are used under some concurrency

Description:
------------
Call the script foo.bar, host it with apache2 on localhost and use ab to
call the script concurrently:

ab -c 20 -n 10000 'http://127.0.0.1/foo.php'

Tail the output of /var/log/apache2/*.log



Test script:
---------------
<?php

class Bar
{
    const FOO = [
        'foo' => 'bar',
    ];

    public function foo($bar)
    {
        return self::FOO[$bar];
    }
}

$foo = new Bar;
usleep(rand(1,1000000));
$bar = $foo->foo('foo');

Expected result:
----------------
status 200 / no segfaults

Actual result:
--------------
A segfault and segfaults to any subsequent requests to the same script.

[Mon Oct 26 17:07:39 2015] [error] [client 127.0.0.1] PHP Fatal error: 
Out of memory (allocated 262144) (tried to allocate 139794773411952
bytes) in Unknown on line 0
[Mon Oct 26 17:07:39 2015] [notice] child pid 7385 exit signal
Segmentation fault (11)
[Mon Oct 26 17:07:39 2015] [notice] child pid 7386 exit signal
Segmentation fault (11)
[Mon Oct 26 17:07:39 2015] [notice] child pid 7390 exit signal
Segmentation fault (11)
[Mon Oct 26 17:07:39 2015] [notice] child pid 7391 exit signal
Segmentation fault (11)
[Mon Oct 26 17:07:39 2015] [notice] child pid 7392 exit signal
Segmentation fault (11)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=70795&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=70795&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=70795&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=70795&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=70795&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=70795&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=70795&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=70795&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=70795&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=70795&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=70795&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=70795&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=70795&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=70795&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70795&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=70795&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=70795&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=70795&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70795&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=70795&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=70795&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#196822) next »