php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51178 Compile fails randomly with default RPM CFLAGS
Submitted: 2010-03-01 22:48 UTC Modified: 2010-03-03 03:37 UTC
From: blake at bluehost dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.2.13 OS: CentOS 5.4
Private report: No CVE-ID: None
 [2010-03-01 22:48 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-02 00:40 UTC] rasmus@php.net
-Status: Open +Status: Bogus
 [2010-03-02 00:40 UTC] rasmus@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-03 03:13 UTC] blake at bluehost dot com
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.
 [2010-03-03 03:36 UTC] aharvey@php.net
-Status: Bogus +Status: No Feedback
 [2010-03-03 03:37 UTC] aharvey@php.net
-Status: No Feedback +Status: Bogus
 [2010-03-03 03:37 UTC] aharvey@php.net
Wrong bug. Sorry for the noise. Too many tabs, not enough coffee.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 14:01:30 2024 UTC