ID:               16212
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Feedback
 Bug Type:         Reproducible crash
 Operating System: Mandrake Linux 8.2
 PHP Version:      4.1.2
 New Comment:

Derick,
        I am now using RC1 from your page, and I still get the error.
        Here are my compile options:

'./configure' '--prefix=/usr' '--with-mysql=/usr'
'--with-apxs=/usr/sbin/apxs' 
'--enable-gd=/usr/lib/gd-1.8.4' '--enable-ftp'

        I believe I've found what causes it. If I create a multi-dimensional
that has a sub-array at either 
the beginning or end, the engine does not crash:


[[EMAIL PROTECTED]]-[~]$ php -r 'error_reporting(E_ALL); $x =
array(array(),"c","b","a"); natsort($x); 
print_r($x);';
Array
(
    [0] => Array
        (
        )

    [3] => a
    [2] => b
    [1] => c
)


        The engine doesn't seggfault. However, if I create a multi-dimensional
array with a sub-array 
anywhere but at the beginning or end, this happens:


[[EMAIL PROTECTED]]-[~]$ php -r 'error_reporting(E_ALL); $x =
array("c",array(),"b","a"); natsort($x); 
print_r($x);';
Array
(
    [1] => Array
        (
        )

    [3] => a
    [2] => b
    [0] => c
)

Segmentation fault


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

[2002-03-22 03:43:25] [EMAIL PROTECTED]

Me neither, can you try RC1 from www.php.net/~derick ?

Derick

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

[2002-03-21 18:08:35] [EMAIL PROTECTED]

Weird, can't reproduce this at all:

$ php -r 'error_reporting(E_ALL); $x = array("a",array("x","y"),"b");
natsort($x);'
Command line code(1) : Notice - Array to string conversion
Command line code(1) : Notice - Array to string conversion

Even with 4.1.2 on another machine no esegfault, just the warnings.

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

[2002-03-21 16:44:54] [EMAIL PROTECTED]

The problem arises when you attempt to natsort() a multi-dimensional
array, which in turn causes the engine 
to segault.

[[EMAIL PROTECTED]]-[~]$ echo '<? $x =
array("a",array("x","y"),"b"); natsort($x); ?>' | php -q
Segmentation fault

This bug exists in both PHP-4.1.2 and the current PHP CVS as of
03/21/02.

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


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

Reply via email to