php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61472 cannot use date function in mips64
Submitted: 2012-03-22 12:31 UTC Modified: 2013-10-19 15:03 UTC
Votes:3
Avg. Score:4.0 ± 0.8
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:3 (100.0%)
From: jonathanbj at qq dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.4.0 OS: linux 2.6
Private report: No CVE-ID: None
 [2012-03-22 12:31 UTC] jonathanbj at qq dot com
Description:
------------
1) get the source of php 5.4.0 or 5.3.6:
./configure --host=mips64-unkown-linux
make

2) do the test
  ./php 3.php
  Result with date()Segmentation fault (core dumped)



  



Test script:
---------------
<?php
echo("Result with date()");
echo(date("l"));
?>



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-22 12:34 UTC] jonathanbj at qq dot com
(gdb) bt
#0  0x0000005555e4ba38 in memcpy () at 
../ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h:195
#1  0x000000012007ef18 in timelib_parse_tzfile (timezone=<value optimized out>, 
tzdb=<value optimized out>)
    at /home/ck/trunk/dongda/apps/php-5.4.0/ext/date/lib/parse_tz.c:124
#2  0x00000001200540f0 in php_date_parse_tzfile (formal_tzname=0x55565496b0 "", 
tzdb=0x120795ffe)
    at /home/ck/trunk/dongda/apps/php-5.4.0/ext/date/php_date.c:831
#3  0x0000000120056c9c in get_timezone_info () at 
/home/ck/trunk/dongda/apps/php-5.4.0/ext/date/php_date.c:877
#4  0x0000000120059964 in php_format_date (format=0x555614b0c0 "l", 
format_len=1, ts=4839792638, localtime=1)
    at /home/ck/trunk/dongda/apps/php-5.4.0/ext/date/php_date.c:1126
#5  0x000000012005a40c in php_date (ht=1, return_value=0x55555ab368, 
return_value_ptr=<value optimized out>, 
    this_ptr=<value optimized out>, return_value_used=<value optimized out>, 
localtime=1)
    at /home/ck/trunk/dongda/apps/php-5.4.0/ext/date/php_date.c:1111
#6  0x00000001203a0bc0 in zend_do_fcall_common_helper_SPEC 
(execute_data=0x5555579060)
    at /home/ck/trunk/dongda/apps/php-5.4.0/Zend/zend_vm_execute.h:642
#7  0x00000001203a8d0c in execute (op_array=<value optimized out>)
    at /home/ck/trunk/dongda/apps/php-5.4.0/Zend/zend_vm_execute.h:410
#8  0x0000000120369180 in zend_execute_scripts (type=8, retval=0x0, 
file_count=3)
    at /home/ck/trunk/dongda/apps/php-5.4.0/Zend/zend.c:1272
#9  0x00000001202f92f4 in php_execute_script (primary_file=0xffffaec568)
    at /home/ck/trunk/dongda/apps/php-5.4.0/main/main.c:2473
#10 0x000000012043d328 in do_cli (argc=0, argv=0xffffaecbe8) at 
/home/ck/trunk/dongda/apps/php-5.4.0/sapi/cli/php_cli.c:983
#11 0x000000012043daa0 in main (argc=0, argv=0xffffaecbe8) at 
/home/ck/trunk/dongda/apps/php-5.4.0/sapi/cli/php_cli.c:1356
(gdb)
 [2012-03-26 05:32 UTC] aharvey@php.net
-Package: Reproducible crash +Package: Date/time related
 [2013-10-18 20:15 UTC] cassiano at idbinfo dot com dot br
I'm having exactly the same issue. PHP compiled for mips64 architecture, 32bit N32 binary format.

I've crossbuilt PHP from 5.3.20 to 5.3.27 and 5.4.20, both all crashes at the same point

1: how to test:
php -r 'print_r(date('l'));'



crashes with the following output

(gdb) run -r 'print_r(date('l'));'
Starting program: /root/php -r 'print_r(date('l'));'
*** Error in `/root/php': free(): invalid next size (fast): 0x10566ef0 ***

Program received signal SIGABRT, Aborted.
0x778b76b8 in raise () from /lib32/libc.so.6
(gdb) 
(gdb) bt
#0  0x778b76b8 in raise () from /lib32/libc.so.6
#1  0x778bc0a0 in abort () from /lib32/libc.so.6
#2  0x778f740c in __libc_message () from /lib32/libc.so.6
#3  0x77904f94 in malloc_printerr () from /lib32/libc.so.6
#4  0x77905f88 in _int_free () from /lib32/libc.so.6
#5  0x10063a10 in read_types (tz=0x10566d98, tzf=0x7fff53ec) at /home/cassiano/SecureGateway/mips64/output/build/php-5.3.21/ext/date/lib/parse_tz.c:179
#6  timelib_parse_tzfile (timezone=<optimized out>, tzdb=<optimized out>) at /home/cassiano/SecureGateway/mips64/output/build/php-5.3.21/ext/date/lib/parse_tz.c:326
#7  0x1003b87c in php_date_parse_tzfile (formal_tzname=0x1041ae00 "America/Sao_Paulo", tzdb=0x103ee828 <timezonedb_builtin>) at /home/cassiano/SecureGateway/mips64/output/build/php-5.3.21/ext/date/php_date.c:831
#8  0x1003c47c in get_timezone_info () at /home/cassiano/SecureGateway/mips64/output/build/php-5.3.21/ext/date/php_date.c:949
#9  0x1003e8c4 in php_format_date (format=0x104f60a8 "l", format_len=1, ts=3064, localtime=localtime@entry=1) at /home/cassiano/SecureGateway/mips64/output/build/php-5.3.21/ext/date/php_date.c:1198
#10 0x1003ea00 in php_date (ht=1, return_value=0x104f40e8, localtime=1, return_value_used=<optimized out>, this_ptr=<optimized out>, return_value_ptr=<optimized out>)
    at /home/cassiano/SecureGateway/mips64/output/build/php-5.3.21/ext/date/php_date.c:1183
#11 0x102f0f34 in zend_do_fcall_common_helper_SPEC (execute_data=0x10526ba8) at /home/cassiano/SecureGateway/mips64/output/build/php-5.3.21/Zend/zend_vm_execute.h:320
#12 0x102a877c in execute (op_array=0x104f4680) at /home/cassiano/SecureGateway/mips64/output/build/php-5.3.21/Zend/zend_vm_execute.h:107
#13 0x10273740 in zend_eval_stringl (str=<optimized out>, str_len=<optimized out>, retval_ptr=0x0, string_name=<optimized out>) at /home/cassiano/SecureGateway/mips64/output/build/php-5.3.21/Zend/zend_execute_API.c:1198
#14 0x1027394c in zend_eval_stringl_ex (str=<optimized out>, str_len=<optimized out>, retval_ptr=<optimized out>, string_name=<optimized out>, handle_exceptions=1)
    at /home/cassiano/SecureGateway/mips64/output/build/php-5.3.21/Zend/zend_execute_API.c:1240
#15 0x10035ebc in main (argc=3, argv=0x104154f0) at /home/cassiano/SecureGateway/mips64/output/build/php-5.3.21/sapi/cli/php_cli.c:1281
 [2013-10-18 23:05 UTC] cassiano at idbinfo dot com dot br
Nevermind.

Solved it by forcing ac_cv_c_bigendian_php=yes

Looks like a problem with autoconf detecting architecture when crosscompiling
 [2013-10-19 15:03 UTC] derick@php.net
-Status: Open +Status: Not a bug
 [2013-10-19 15:03 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Cross compiling is not supported, so you're on your own there. Marking this as "not a bug".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 19:01:29 2024 UTC