php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47230 Bug with gcc Optimizer on Sparc systems
Submitted: 2009-01-28 13:17 UTC Modified: 2009-09-04 18:35 UTC
Votes:10
Avg. Score:4.6 ± 1.2
Reproduced:7 of 9 (77.8%)
Same Version:4 (57.1%)
Same OS:6 (85.7%)
From: lneve at mail dot nih dot gov Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 5.3.0-beta2-dev OS: Solaris 10 (completely patched)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lneve at mail dot nih dot gov
New email:
PHP Version: OS:

 

 [2009-01-28 13:17 UTC] lneve at mail dot nih dot gov
Description:
------------
Here is the relevant part of the make output:

-bash-3.00# gmake
Generating phar.php
Bus Error - core dumped
gmake: *** [ext/phar/phar.php] Error 138

Someone reported a similar bug in the previous release
on the Irix OS (bug #46074).

I use the vanilla Solaris gcc compiler (version 3.4.3). 
Here are my configure options:

./configure  
--with-pgsql=/opt/postgres/8.3-community 
--with-mysql=/opt/mysql 
--with-mysqli=/opt/mysql/bin/mysql_config 
--with-apxs2=/opt/httpd/bin/apxs 
--with-config-file-path=/etc 
--with-libxml-dir=/usr/lib 
--with-zlib-dir=/usr/lib 
--enable-zip 
--enable-mbstring 
--with-gd 
--with-jpeg-dir=/usr/lib 
--with-png-dir=/usr/lib 
--with-xpm-dir=/usr/lib 
--with-freetype-dir=/usr/sfw 
--with-pdo-mysql=/opt/mysql 
--with-pdo-pgsql=/opt/pgsql 
--with-gettext=/usr/local/lib 
--with-imap=/usr/local/imap-2007d 
--with-imap-ssl=/usr/local/ssl

I would be happy to provide you additional debugging 
information.

-Leif Neve


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-28 13:28 UTC] scottmac@php.net
What sort of processor do you have?

There is a problem with sparc and ppc processors and phar.
 [2009-01-28 13:32 UTC] lneve at mail dot nih dot gov
It's a sparc system. Is there a workaround since I don't need phar? If 
I add --disable-phar it builds successfully, but experiences a bus error during "make test".
 [2009-01-28 13:40 UTC] lneve at mail dot nih dot gov
If I build with --disable-phar it builds successfully but "make test" fails with:

-bash-3.00# make test

Build complete.
Don't forget to run 'make test'.

Bus Error - core dumped
*** Error code 138 (ignored)
The following command caused the error:
if test ! -z "" && test -x ""; then \
        TEST_PHP_EXECUTABLE= \
        TEST_PHP_SRCDIR=/opt/php-5.3.0alpha3 \
        CC="gcc" \
                 -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' /opt/php-5.3.0alpha3/run-tests.php -d extension_dir=modules/ `  if test "x" != "x"; then  for i in ""; do  . $i; /opt/php-5.3.0alpha3/build/shtool echo -n -- " -d extension=$dlname";  done;  fi;  if test "x" != "x"; then  for i in ""; do  . $i; /opt/php-5.3.0alpha3/build/shtool echo -n -- " -d zend_extension=/opt/php-5.3.0alpha3/modules/$dlname";  done;  fi` tests/; \
elif test ! -z "sapi/cli/php" && test -x "sapi/cli/php"; then \
        INI_FILE=`/opt/php-5.3.0alpha3/sapi/cli/php -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \
        if test "$INI_FILE"; then \
                egrep -v '^(zend_)?extension(_debug)?(_ts)?[\t\ ]*=' "$INI_FILE" > /opt/php-5.3.0alpha3/tmp-php.ini; \
        else \
                echo > /opt/php-5.3.0alpha3/tmp-php.ini; \
        fi; \
        INI_SCANNED_PATH=`/opt/php-5.3.0alpha3/sapi/cli/php -d 'display_errors=stderr' -r '$a = explode(",\n", trim(php_ini_scanned_files())); echo $a[0];' 2> /dev/null`; \
        if test "$INI_SCANNED_PATH"; then \
                INI_SCANNED_PATH=`/opt/php-5.3.0alpha3/build/shtool path -d $INI_SCANNED_PATH`; \
                egrep -h -v '^(zend_)?extension(_debug)?(_ts)?[\t\ ]*=' "$INI_SCANNED_PATH"/*.ini >> /opt/php-5.3.0alpha3/tmp-php.ini; \
        fi; \
        TEST_PHP_EXECUTABLE=/opt/php-5.3.0alpha3/sapi/cli/php \
        TEST_PHP_SRCDIR=/opt/php-5.3.0alpha3 \
        CC="gcc" \
                /opt/php-5.3.0alpha3/sapi/cli/php -n -c /opt/php-5.3.0alpha3/tmp-php.ini -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' /opt/php-5.3.0alpha3/run-tests.php -n -c /opt/php-5.3.0alpha3/tmp-php.ini -d extension_dir=/opt/php-5.3.0alpha3/modules/ `  if test "x" != "x"; then  for i in ""; do  . $i; /opt/php-5.3.0alpha3/build/shtool echo -n -- " -d extension=$dlname";  done;  fi;  if test "x" != "x"; then  for i in ""; do  . $i; /opt/php-5.3.0alpha3/build/shtool echo -n -- " -d zend_extension=/opt/php-5.3.0alpha3/modules/$dlname";  done;  fi` ; \
else \
        echo "ERROR: Cannot run tests without CLI sapi."; \
fi
 [2009-01-28 17:16 UTC] scottmac@php.net
This is a gcc optimizer bug, if you do CFLAGS="-O0" prior to compiling it you don't get a problem.

I've been told SunCC works fine.
 [2009-04-27 15:56 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-05-05 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-07-14 22:22 UTC] lepage at grm dot polymtl dot ca
same problem here with php-5.3.0.
on Solaris 10 and gcc 4.3.2
 [2009-07-15 08:05 UTC] sriram dot natarajan at gmail dot com
hi
 please see related bug - http://bugs.php.net/bug.php?id=48668 .

 if you compile with sun studio 12 (which is available for free from http://www.sun.com/sunstudio , you should not have this problem.

 future releases of php 5.3 should address this issue
 [2009-07-16 00:45 UTC] lepage at grm dot polymtl dot ca
URL for sun studio is http://developers.sun.com/sunstudio/

will try it or wait for 5.3.1, when is it scheduled ?
 [2009-07-29 21:28 UTC] lepage at grm dot polymtl dot ca
not able to compile with sun studio to many dependance (libs) need to be recompile with sun studio.

php5.3-200907282230 still has the same problem.
 [2009-09-04 18:35 UTC] srinatar@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.

this issue is not because of a bug with gcc in sparc. sparc requires  memory accesses to be aligned. however, with php 5.3, zend stack was not aligned and this was causing php 5.3 to crash on sparc as well as on irix. 

this issue is now resolved with dmitry's commit as part of his fix for bug #46074. 

this below diff fixes this issue:
http://svn.php.net/viewvc?view=revision&revision=287992


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 18:01:34 2024 UTC