php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51008 Zend/tests/bug45877.phpt fails
Submitted: 2010-02-11 01:54 UTC Modified: 2010-10-05 13:29 UTC
From: geissert at debian dot org Assigned: dmitry (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3SVN-2010-02-12 OS: debian sid
Private report: No CVE-ID: None
 [2010-02-11 01:54 UTC] geissert at debian dot org
Description:
------------
The test fails 

Reproduce code:
---------------
<?php
$keys = array(PHP_INT_MAX,
        (string) PHP_INT_MAX,
        (string) (-PHP_INT_MAX - 1),
        -PHP_INT_MAX - 1,
        (string) (PHP_INT_MAX + 1));

var_dump(array_fill_keys($keys, 1));
?>


Expected result:
----------------
array(2) {
  [2147483647]=>
  int(1)
  [-2147483648]=>
  int(1)
  ["2147483648"]=>
  int(1)
}


Actual result:
--------------
array(2) {
  [2147483647]=>
  int(1)
  [-2147483648]=>
  int(1)
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-12 17:02 UTC] jani@php.net
In what kind of environment does it fail? It works fine for me in both 32bit and 64bit systems. (using latest SVN checkout of course :)
 [2010-02-12 18:58 UTC] geissert at debian dot org
It fails for me with 5.3.1 on i686, ia64, s390, alpha, powerpc, x86_64, etc. Even on those running kfreebsd.
It also fails with the latest 5.3 svn on ia64 (haven't built it on any other arch.)
 [2010-02-22 18:05 UTC] sniper@php.net
Possibly same issue as bug #51023 ??
 [2010-02-22 23:47 UTC] geissert@php.net
Indeed. I just checked with the -O0 build and it passes.

The affected code in this case is ZEND_HANDLE_NUMERIC in Zend/zend_hash.h

Should this one be assigned to somebody in particular?
 [2010-02-23 13:05 UTC] jani@php.net
Duplicate.
 [2010-03-06 20:02 UTC] geissert@php.net
-Status: Bogus +Status: Open
 [2010-03-06 20:02 UTC] geissert@php.net
Reopening it because somebody with commit access to the engine needs to apply and commit the patch there. The other patch can be found at
http://git.debian.org/?p=pkg-php/php.git;a=blob;f=debian/patches/zend_int_overflow.patch;hb=0fe497525d46b2fa8353e37106b47c05ef804cc5
 [2010-09-29 17:54 UTC] cataphract@php.net
-Assigned To: +Assigned To: dmitry
 [2010-09-29 17:54 UTC] cataphract@php.net
See also http://bugs.gentoo.org/show_bug.cgi?id=338280 and http://bugs.php.net/bug.php?id=52899

The current implementation relies on undefined behavior and apparently the overflow check can be optimized away.
 [2010-10-05 13:28 UTC] dmitry@php.net
Automatic comment from SVN on behalf of dmitry
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=304083
Log: Fixed bug #51008 (Zend/tests/bug45877.phpt fails)
 [2010-10-05 13:29 UTC] dmitry@php.net
-Status: Assigned +Status: Closed
 [2010-10-05 13:29 UTC] dmitry@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC