ID:               28743
 Updated by:       php-bugs@lists.php.net
 Reported By:      rodolfo at rodsoft dot org
-Status:           Feedback
+Status:           No Feedback
 Bug Type:         Reproducible crash
 Operating System: linux 2.6.6
 PHP Version:      5.0.0RC2
 New Comment:

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".


Previous Comments:
------------------------------------------------------------------------

[2005-01-15 00:09:17] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.0-win32-latest.zip

Seems to be fixed, as I can reproduce with latest 5.* snapshots.

------------------------------------------------------------------------

[2004-06-11 18:17:17] rodolfo at rodsoft dot org

Description:
------------
If you run the following script with your web browser and reload the
page a couple of times, php dumps core. My apache version is 2.0.49
with libphp dynamically linked.

Strangely enough, if you change the array index inside the
create_function to something bogus, like "d", array_udiff returns an
empty array (without issuing an error). The second time the script is
called, as usual, php dumps core. With the correct array index, the
output is ok the first time. But dumps core the second time is called.

Reproduce code:
---------------
<?
    $p1[] = array('a'=>1, 'b'=>'apple');
    $p1[] = array('a'=>2, 'b'=>'orange');
    $p1[] = array('a'=>3, 'b'=>'banana');
    $p2[] = array('a'=>3, 'b'=>'banana');
    $p2[] = array('a'=>4, 'b'=>'raspberry');

    echo "<pre>";
    print_r(array_udiff($p1, $p2,create_function('$a,$b',
                        'return $a["a"]-$b["a"];')));
    echo "</pre>";
?>

Expected result:
----------------
Array
(
    [0] => Array
        (
            [a] => 1
            [b] => apple
        )

    [1] => Array
        (
            [a] => 2
            [b] => orange
        )
)

no matter how many times we run the script

Actual result:
--------------
The correct result in the first time the script is run, and the
following core dump backtrace the second time:

#0 0x00000001 in ?? ()
#1 0x4072bc0a in zend_call_function () from /usr/lib/apache/libphp5.so
#2 0x4067dd81 in array_user_compare () from /usr/lib/apache/libphp5.so
#3 0x407458c9 in zend_qsort() from /usr/lib/apache/libphp5.so
#4 0x40684a19 in php_array_diff () from /usr/lib/apache/libphp5.so
#5 0x00000003 in ?? ()
#6 0x00000004 in ?? ()
#7 0x4067dcf0 in zif_rsort() from /usr/lib/apache/libphp5.so
Previous frame inner to this frame (corrupt stack?)


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=28743&edit=1

Reply via email to