[PHP-BUG] Bug #51178 [NEW]: Compile fails randomly with default RPM CFLAGS

2010-03-01 Thread blake at bluehost dot com
From: 
Operating system: CentOS 5.4
PHP version:  5.2.13
Package:  Compile Failure}
Bug Type: Bug
Bug description:Compile fails randomly with default RPM CFLAGS

Description:

The CFLAGS used for this build are:

-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=0 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m64 -mtune=generic
-DSECURITY_HOLE_PASS_AUTHORIZATION



The differences from a default RPM build are
SECURITY_HOLE_PASS_AUTHORIZATION and _FORTIFY_SOURCE=2.  I don't have this
failure when building normally via ./configure && make, so this makes me
think it's the optimisation that's making the build flakey.  Is it possible
to make this function a little more resilient to optimisation?



About 50% of the time PHP fails to build, it always fails in exactly the
same place:



/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c:136: error: expected '=',
',', ';', 'asm' or '__attribute__' before 'stream_cookie_functions'

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c: In function
'_php_stream_cast':

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c:189: warning: implicit
declaration of function 'fopencookie'

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c:189: error:
'stream_cookie_functions' undeclared (first use in this function)

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c:189: error: (Each
undeclared identifier is reported only once

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c:189: error: for each
function it appears in.)

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c:189: warning: assignment
makes pointer from integer without a cast

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c:230: warning: cast to
pointer from integer of different size

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c:233: warning: cast to
pointer from integer of different size

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c: In function
'_php_stream_open_wrapper_as_file':

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c:306: warning:
dereferencing type-punned pointer will break strict-aliasing rules

make: *** [main/streams/cast.lo] Error 1



Expected result:

A successful build 100% of the time.

Actual result:
--
If I build the RPM 20 times (without changing ANYTHING), it fails to build
at least - usually more - than half the time.  This increases the time
required to roll-out updates to PHP a great deal, by breaking our automated
build system.

-- 
Edit bug report at http://bugs.php.net/bug.php?id=51178&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=51178&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=51178&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=51178&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=51178&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=51178&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=51178&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=51178&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=51178&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=51178&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=51178&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=51178&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=51178&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=51178&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=51178&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=51178&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=51178&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=51178&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=51178&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=51178&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=51178&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=51178&r=mysqlcfg



[PHP-BUG] Bug #51178 [Bgs]: Compile fails randomly with default RPM CFLAGS

2010-03-02 Thread blake at bluehost dot com
Edit report at http://bugs.php.net/bug.php?id=51178&edit=1

 ID:   51178
 User updated by:  blake at bluehost dot com
 Reported by:  blake at bluehost dot com
 Summary:  Compile fails randomly with default RPM CFLAGS
 Status:   Bogus
 Type: Bug
 Package:  Compile Failure
 Operating System: CentOS 5.4
 PHP Version:  5.2.13

 New Comment:

Thanks for the feedback.  Just wanted to say for others that run into
this that I tracked down the problem based on your comment about the
_GNU_SOURCE define.  There was an old patch from redhat removing the
define in some instances.  Reverting this patch results in a reliable
build.



For reference it was:

#Patch1: php-5.2.4-gnusrc.patch



Thanks again.


Previous Comments:

[2010-03-02 00:40:32] ras...@php.net

-Status: Open
+Status: Bogus



[2010-03-02 00:40:32] ras...@php.net

I see nothing wrong with that code.  Line 136 of main/streams/cast.c in
PHP 

5.2.13 is:



#if HAVE_FOPENCOOKIE



And that define come from the configure check in acinclude.m4 which does
a test 

compile with _GNU_SOURCE defined.



I don't see why that would sometimes work and sometimes not on the same
system.  

Feel free to send us some suggested patches if you can figure out what
is 

sometimes tripping up your system, but since I see no bug here I am
marking this 

one bogus.


[2010-03-01 22:48:17] blake at bluehost dot com

Description:

The CFLAGS used for this build are:

-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=0 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic
-DSECURITY_HOLE_PASS_AUTHORIZATION



The differences from a default RPM build are
SECURITY_HOLE_PASS_AUTHORIZATION and _FORTIFY_SOURCE=2.  I don't have
this failure when building normally via ./configure && make, so this
makes me think it's the optimisation that's making the build flakey.  Is
it possible to make this function a little more resilient to
optimisation?



About 50% of the time PHP fails to build, it always fails in exactly the
same place:



/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c:136: error: expected
'=', ',', ';', 'asm' or '__attribute__' before
'stream_cookie_functions'

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c: In function
'_php_stream_cast':

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c:189: warning: implicit
declaration of function 'fopencookie'

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c:189: error:
'stream_cookie_functions' undeclared (first use in this function)

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c:189: error: (Each
undeclared identifier is reported only once

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c:189: error: for each
function it appears in.)

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c:189: warning:
assignment makes pointer from integer without a cast

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c:230: warning: cast to
pointer from integer of different size

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c:233: warning: cast to
pointer from integer of different size

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c: In function
'_php_stream_open_wrapper_as_file':

/usr/src/rpm/BUILD/php-5.2.13/main/streams/cast.c:306: warning:
dereferencing type-punned pointer will break strict-aliasing rules

make: *** [main/streams/cast.lo] Error 1



Expected result:

A successful build 100% of the time.

Actual result:
--
If I build the RPM 20 times (without changing ANYTHING), it fails to
build at least - usually more - than half the time.  This increases the
time required to roll-out updates to PHP a great deal, by breaking our
automated build system.






-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51178&edit=1