From:             mvali at urania dot ee
Operating system: Red Hat 8, Fedora Core 1
PHP version:      4.3.6RC1
PHP Bug Type:     Reproducible crash
Bug description:  array manipulation and references segfaults php

Description:
------------
This is testded with 4.2.1, 4.3.4 and 4.3.6RC2, the script

produces a segfault. 

PHP is compiled with-apxs2 or with apache 1.3 with no

special parameters to ./configure.

The script produces segfaults both on console

php interpretator or when loaded with apache server.

Reproduce code:
---------------
<?php

class AClass {

  function AClass($v) {$this->v = $v;}

  function func() {return $this->v;}

}

function & func($mall) {

  if (is_array($mall))

    return array ("b" => func($mall["b"]));  

  else

    return $mall->func();

}

function random($staatus="OK\n") {

  $a1 = array();

  $a2 = func(array("b" => new AClass($staatus)));

  $a1 = array(array_merge(array(), $a2));

  $important = 0;

  return array_values($a1);

}

$out = random();

echo $out[0]["b"];

?>

Expected result:
----------------
It should print 'OK'

Actual result:
--------------
echo receives a segfault.

-- 
Edit bug report at http://bugs.php.net/?id=27902&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27902&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27902&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27902&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27902&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27902&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27902&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27902&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27902&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27902&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27902&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27902&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27902&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27902&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27902&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27902&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27902&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27902&r=float

Reply via email to