php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63409 php-dba function test fails on big-endian machine
Submitted: 2012-11-01 09:06 UTC Modified: -
From: tianhonglouis at gmail dot com Assigned:
Status: Closed Package: Testing related
PHP Version: 5.4.8 OS: linux
Private report: No CVE-ID: None
 [2012-11-01 09:06 UTC] tianhonglouis at gmail dot com
Description:
------------
For ext/dba/tests/bug38698.phpt, if running the testcase on big-endian machine 
like ppc, it will fail. The main root cause is the function pack('i', 129), if 
add the format character "i", it's machine dependent size and byte order. Big 
endian and liitle endian will output the different string value. According to the 
string value, dba_insert() will insert the different position of the db, finally 
cause the different md5 value. 

Test script:
---------------
php run-tests.php ext/dba/tests/bug38698.phpt

Expected result:
----------------
Running selected tests.
PASS Bug #38698 (Bug #38698 for some keys cdbmake creates corrupted db and cdb 
can't read valid db) [ext/dba/tests/bug38698.phpt] 
=====================================================================
Number of tests :    1                 1
Tests skipped   :    0 (  0.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    0 (  0.0%) (  0.0%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :    1 (100.0%) (100.0%)
---------------------------------------------------------------------
Time taken      :    0 seconds

Actual result:
--------------
Running selected tests.
FAIL Bug #38698 (Bug #38698 for some keys cdbmake creates corrupted db and cdb 
can't read valid db) [ext/dba/tests/bug38698.phpt] 
=====================================================================
Number of tests :    1                 1
Tests skipped   :    0 (  0.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    1 (100.0%) (100.0%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :    0 (  0.0%) (  0.0%)
---------------------------------------------------------------------
Time taken      :    0 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Bug #38698 (Bug #38698 for some keys cdbmake creates corrupted db and cdb can't 
read valid db) [ext/dba/tests/bug38698.phpt]


Patches

bug38698_add_endian_check.patch (last revision 2012-11-01 09:06 UTC by tianhonglouis at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-26 16:49 UTC] felipe@php.net
Automatic comment on behalf of felipensp@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7e33b5d2fa89a6bf167fc4061dcf6aedab1cc6b8
Log: - Fixed bug #63409 (php-dba function test fails on big-endian machine) patch by: tianhonglouis at gmail dot com
 [2013-06-26 16:49 UTC] felipe@php.net
-Status: Open +Status: Closed
 [2014-10-07 23:18 UTC] stas@php.net
Automatic comment on behalf of felipensp@gmail.com
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=7e33b5d2fa89a6bf167fc4061dcf6aedab1cc6b8
Log: - Fixed bug #63409 (php-dba function test fails on big-endian machine) patch by: tianhonglouis at gmail dot com
 [2014-10-07 23:29 UTC] stas@php.net
Automatic comment on behalf of felipensp@gmail.com
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=7e33b5d2fa89a6bf167fc4061dcf6aedab1cc6b8
Log: - Fixed bug #63409 (php-dba function test fails on big-endian machine) patch by: tianhonglouis at gmail dot com
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Oct 27 02:01:24 2020 UTC