From:
Operating system: Linux
PHP version: 5.3SVN-2011-08-01 (SVN)
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Segfault with allow_call_time_pass_reference = Off
Description:
------------
The scripts that are provided below causes segfault. The following
configuration was used to compile PHP:
./configure --disable-all
Test script:
---------------
To reproduce the bug one needs 3 PHP files:
1. index.php
<?php
function error_handler($errno, $errstr, $errfile, $errline)
{
require_once 'error_handler.php';
}
set_error_handler('error_handler');
require_once('inc.php');
echo 'Never prints';
2. error_handler.php
<?php
// The file may be empty. It's OK.
3. inc.php
<?php
function foo()
{
$array = array();
foreach ($array as $key => $value) {
bar($key, &$value);
}
}
function bar()
{
}
Before running index.php be sure allow_call_time_pass_reference is Off
Expected result:
----------------
Never prints
Actual result:
--------------
Program terminated with signal 11, Segmentation fault.
#0 0x00000000006210e7 in ?? ()
(gdb) bt
#0 0x00000000006210e7 in ?? ()
#1 0x0000000100000000 in ?? ()
#2 0x00007f3a4a29d390 in ?? ()
#3 0x0000000000000000 in ?? ()
--
Edit bug report at https://bugs.php.net/bug.php?id=55339&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=55339&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=55339&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=55339&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=55339&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=55339&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=55339&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=55339&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=55339&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=55339&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=55339&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=55339&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=55339&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=55339&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=55339&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=55339&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=55339&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=55339&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=55339&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=55339&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=55339&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=55339&r=mysqlcfg