php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54925 build php on solaris for 64 bits
Submitted: 2011-05-25 14:31 UTC Modified: 2013-02-18 00:34 UTC
Votes:2
Avg. Score:3.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: michel dot henaut at everyware dot ch Assigned: srinatar (profile)
Status: No Feedback Package: *General Issues
PHP Version: 5.2.17 OS: solaris
Private report: No CVE-ID: None
 [2011-05-25 14:31 UTC] michel dot henaut at everyware dot ch
Description:
------------
Build php on solaris with Sun compiler:

The default build for 64 bits, i.e. CFLAGS='-m64' produces strange results.
Rebuilding all with CFLAGS='-m64 -O -xs -xstrconst -zlazyload' seems to work.

To reproduce it:

$obj[0]['data'][0]['Usr'] = 0.009035;
echo json_encode($obj);

with just CFLAGS='-m64'
[{"data":[{"Usr":INF}]}]

with CFLAGS='-m64 -O -xs -xstrconst -zlazyload'
[{"data":[{"Usr":0.009035}]}]
which is correct.

may be a problem in main/snprintf.c and in main/spprintf.c

regards 




Test script:
---------------
$obj[0]['data'][0]['Usr'] = 0.009035;
echo json_encode($obj);


Expected result:
----------------
[{"data":[{"Usr":0.009035}]}]

Actual result:
--------------
[{"data":[{"Usr":INF}]}]

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-27 07:39 UTC] eugene at zhegan dot in
Same here.
PHP 5.3.6.

# cc -V
cc: Sun C 5.10 SunOS_i386 2009/06/03

Same workaround does help (thanks, Michael, by the way).
 [2011-07-15 11:37 UTC] dsp@php.net
-Assigned To: +Assigned To: srinatar
 [2011-07-15 11:37 UTC] dsp@php.net
assigning this to people working at oracle.
 [2011-07-19 14:26 UTC] srinatar@php.net
-Status: Assigned +Status: Feedback
 [2011-07-19 14:26 UTC] srinatar@php.net
I am not able to reproduce this behavior on both sparc as well as x86 platforms 
? I am using Oracle Solaris Studio 12.2 (formerly Sun Studio compiler)

[sn123202@zod]'php-5.3.6'>cc -V
cc: Sun C 5.10 SunOS_sparc Patch 141861-07 2010/12/09
usage: cc [ options] files.  Use 'cc -flags' for details


Possible, you are running into a compiler bug to me. In any case, you are using 
a really older version of compiler. So, you might wanna consider upgrading or 
installing latest compiler patches.

So, if some thing fixes by using -m64 -O but reproduces with -m64 -  is most 
likely a compiler issue. this is, -m64 doesn't do much but rather than expands 
the compiler flags to build on 64-bit platform. 


I would like to close this bug as not a valid bug
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC