#17449 [Com]: sort() does not work

From: Date: Tue, 03 Sep 2002 16:24:07 +0000
Subject: #17449 [Com]: sort() does not work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18308@lists.php.net to get a copy of this message
 ID:               17449
 Comment by:       r@bttr.org
 Reported By:      nohn@php.net
 Status:           Closed
 Bug Type:         Arrays related
 Operating System: Digital UNIX V4.0G (Rev. 1530)
 PHP Version:      4.2.1
 New Comment:

Ok, I've tested the new php-4.2.3RC2 on 
Compaq Tru64 (details see above), and it
works.


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

[2002-08-26 20:34:49] sniper@php.net

I just merged the changes from HEAD to the 4.2.x branch.
Please test next RC when it comes out (tomorrow, propably)


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

[2002-08-26 18:40:46] David.Hill@hp.com

I replicated the problem with 4.2.2 on Tru64, but found that it was
fixed by replacing Zend/zend_qsort.c with the latest from CVS, version
1.3 (HEAD)

I am not getting unaligned accesses.

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

[2002-08-24 05:50:32] derick@php.net

Attention!

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

[2002-08-24 04:53:03] r@bttr.org

This bug still exists in the 4.2.3RC1 version on 
Compaq Tru64 (OSF1 xxxxxxx V5.1 1885 alpha):

My very simple test case:

$ar1 = array("k","i","f","o","p","b");
print "unsorted ar1:";
print_r($ar1);
reset($ar1);
sort($ar1);
print "sorted ar1";
print_r($ar1);

The results:

unsorted ar1:Array
(
    [0] => k
    [1] => i
    [2] => f
    [3] => o
    [4] => p
    [5] => b
)
sorted ar1Array
(
    [0] => k
    [1] => i
    [2] => f
    [3] => o
    [4] => p
    [5] => b
)

The configure options, taken from further
installation on this machine:

./configure  --with-mysql --with-xml --enable-ftp --with-pcre \
--with-gd=/usr/local --with-png-dir=/usr/local \
--with-zlib=/usr/local --with-freetype --with-sessions \
--enable-trans-sid --enable-memory-limit

Sorry, but I don't understand why this
bug is declared as "closed", although 
sorting doesn't work in this release candicate. :-(

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

[2002-06-07 15:03:05] michael.mauch@gmx.de

Thanks, I didn't know that.

With php4-200206070600, sort() works again, so this bug is solved:

bash-2.01$ ./php 
Unaligned access pid=24680 <php> va=0x14005d27c pc=0x1201ad760
ra=0x1201ad754 inst=0xb4010000
<?php
$a = array(9,7,3,5);
sort($a);
print_r($a);
?>
X-Powered-By: PHP/4.3.0-dev
Content-type: text/html

Array
(
    [0] => 3
    [1] => 5
    [2] => 7
    [3] => 9
)

I had some problems compiling it on Tru64, though, and the "unaligned
access" doesn't look especially pretty, too.
I will open a new bug report for these (if nobody else did).

Thank you for your help!

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/17449

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



Thread (21 messages)

« previous php.bugs (#18308) next »