Bug #71092 [NEW]: Segmentation fault
| From: | emilie dot guth at gmail dot com | Date: | Fri, 11 Dec 2015 14:06:00 +0000 |
| Subject: | Bug #71092 [NEW]: Segmentation fault | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-197791@lists.php.net to get a copy of this message | ||
From: emilie dot guth at gmail dot com
Operating system: Mac OS X Version 10.11.1 (15B42)
PHP version: 7.0.0
Package: *General Issues
Bug Type: Bug
Bug description:Segmentation fault
Description:
------------
I get a segfault with this code while including an empty file (see test
script which contains a.php and c.php).
This bug comes from a larger script, so I tried to get the shortest test
script I could. When I change a tiny little thing (switch to if, no id()
function ...) in it, there is no more segfault.
I'm working on Mac OS X Version 10.11.1 with PHP 7.0.0 :
$ php -v
PHP 7.0.0 (cli) (built: Dec 11 2015 14:48:07) ( NTS )
I tried the same code on an Ubuntu 15.10 computer with PHP 7.0.0 there
is no problem at all.
Test script:
---------------
File a.php :
<?php
declare(strict_types = 1);
function id() {
return ['id'];
}
function boom(): array {
$data = [id()];
switch($data[0]) {
case ['id'] : return;
}
}
set_exception_handler(function($e) {
require_once './c.php';
echo "plop";
});
boom();
?>
File c.php :
<?php
?>
Expected result:
----------------
I am supposed to be shown "plop" as a result.
Instead of that I get :
$ php a.php
Segmentation fault: 11
--
Edit bug report at https://bugs.php.net/bug.php?id=71092&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71092&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71092&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71092&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71092&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71092&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71092&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71092&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71092&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71092&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71092&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71092&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71092&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71092&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71092&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71092&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71092&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71092&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71092&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71092&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71092&r=mysqlcfg