Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 518904 - >=dev-util/re2c-0.13.7.2 breaks dev-lang/php's HEREDOC syntax: PHP Parse error: syntax error, unexpected '<<<DOC'
Summary: >=dev-util/re2c-0.13.7.2 breaks dev-lang/php's HEREDOC syntax: PHP Parse erro...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sergei Trofimovich (RETIRED)
URL: https://bugs.php.net/bug.php?id=67714
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-03 07:09 UTC by Guillaume Castagnino
Modified: 2021-11-03 10:56 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume Castagnino 2014-08-03 07:09:07 UTC
Yesterday, I updated php from 5.5.14 to 5.5.15 on my hardened box. Since then, HEREDOC syntax is broken. I get this:

# php -v
PHP 5.5.15-pl0-gentoo (cli) (built: Aug  2 2014 17:38:15)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

# cat test.php
<?php

$here = <<<DOC
coucou
DOC;

echo $here;

?>

# php test.php
PHP Parse error:  syntax error, unexpected '<<<DOC' in /root/test.php on line 3


This is the same as reported upstream here: https://bugs.php.net/bug.php?id=67714


It seems that it is not related to php 5.5.15, because:
- I tried to downgrade to 5.5.14 (that was working before the upgrade) => same issue
- I tried to upgrade to 5.6_rc1 => same issue
- It does _not_ happen on my non-hardened box with the same versions (both ~amd64)


My thoughts:
The fact that 5.5.14 does not work anymore make me think that the problem may be somewhere in a dependency. Maybe somewhere in a compile time dependency, since I do not see anything significant in my emerge.log apart from coreutils.


If I can help, tell me !





# emerge --info php
Portage 2.2.10 (hardened/linux/amd64/no-multilib, gcc-4.8.3, glibc-2.19-r1, 3.15.7-hardened x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.15.7-hardened-x86_64-Intel-R-_Atom-TM-_CPU_D510_@_1.66GHz-with-gentoo-2.2
KiB Mem:     2030484 total,   1200148 free
KiB Swap:    1048704 total,   1048704 free
Timestamp of tree: Sun, 03 Aug 2014 02:30:01 +0000
ld GNU ld (GNU Binutils) 2.24
app-shells/bash:          4.2_p47
dev-lang/python:          2.7.8, 3.4.1
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.14.1
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.15 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo gcpan xwing local_portage
Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -mtune=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -mtune=native -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildsyspkg collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://dagobah.xwing.info/ ftp://ftp.free.fr/mirrors/ftp.gentoo.org/     http://mirror.ovh.net/gentoo-distfiles/ http://gentoo.tiscali.nl/"
LANG="fr_FR.utf8"
LC_ALL="fr_FR.utf8"
LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,--sort-common"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/gcpan-portage /usr/local/portage/portage /usr/local/portage/local-portage"
SYNC="rsync://dagobah.xwing.info/gentoo-portage"
USE="acl acpi adobe-cff amd64 bash-completion bashlogger bzip2 caps cli cracklib crypt cxx dri fontconfig fpm hardened iconv idn inotify iproute2 ipv6 ithreads jpeg justify mmx ncurses nls nptl openldap openmp openssl pam pax_kernel pcre png readline sasl session sieve sse sse2 sse3 ssl ssse3 tcpd threads tiff unicode urandom vim-pager vim-syntax xattr xtpax zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="fr" NGINX_MODULES_HTTP="access auth_basic autoindex browser charset empty_gif fastcgi gzip headers_more limit_req limit_conn map proxy realip referer rewrite stub_status upstream_ip_hash userid" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python3_4" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

dev-lang/php-5.5.15 was built with the following:
USE="bzip2 calendar cli crypt ctype curl exif fileinfo filter fpm ftp gd hash iconv imap ipv6 json ldap ldap-sasl mhash nls opcache pcntl pdo phar posix postgres readline session simplexml soap sockets ssl sysvipc tokenizer unicode xml zlib -apache2 -bcmath -berkdb -cdb -cgi -cjk -debug -embed -enchant (-firebird) -flatfile (-frontbase) -gdbm -gmp -inifile -intl -iodbc -kerberos -libedit -libmysqlclient -mssql -mysql -mysqli -oci8-instant-client -odbc -qdbm -recode (-selinux) -sharedmem -snmp -spell -sqlite (-sybase-ct) -systemd -threads -tidy -truetype -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xslt -zip"
Comment 1 Heltem 2014-08-04 14:36:48 UTC
Same here on non hardened gentoo
Comment 2 Yoann Colin 2014-08-04 16:17:12 UTC
Same for me.

I rebuilt php with apache2, pdo, mysql and mysqli.
I rebuilt eselect-php with apache2.

Now it's OK.
I guess it's about apache2 support... I have to test it but I don't have time enough
Comment 3 Guillaume Castagnino 2014-08-05 03:36:06 UTC
(In reply to Yoann Colin from comment #2)
> Same for me.
> 
> I rebuilt php with apache2, pdo, mysql and mysqli.
> I rebuilt eselect-php with apache2.
> 
> Now it's OK.
> I guess it's about apache2 support... I have to test it but I don't have
> time enough

certainly not: as you can see above in my test case, I get it with the cli SAPI (and fpm too). No apache SAPI build here.
Comment 4 Robert Förster 2014-08-05 14:45:01 UTC
FWIW, a local php-5.6.0_rc3 ebuild works (on a system where this bug applies to, of course)
Comment 5 Robert Förster 2014-08-06 01:23:02 UTC
ok i have to adjust this statement slightly: php 5.6 works with USE=debug (so i *guess* 5.5 will too, i have not tested it)
Comment 6 Heltem 2014-08-06 12:56:54 UTC
(In reply to Robert Förster from comment #5)
> ok i have to adjust this statement slightly: php 5.6 works with USE=debug
> (so i *guess* 5.5 will too, i have not tested it)

Tested with 5.5.15 with debug : it does not work better.
Comment 7 teejot 2014-08-06 20:04:19 UTC
Same here

PHP 5.5.15-pl0-gentoo (cli) (built: Jul 29 2014 21:42:14) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies


dev-lang/php-5.5.15 was built with the following:
USE="berkdb bzip2 cli crypt ctype curl exif fileinfo filter fpm gd gdbm hash iconv ipv6 json mhash mysql mysqli nls opcache pdo phar posix readline session sharedmem simplexml sqlite ssl tokenizer truetype unicode xml xmlwriter zip zlib -apache2 -bcmath -calendar -cdb -cgi -cjk -debug -embed -enchant (-firebird) -flatfile (-frontbase) -ftp -gmp -imap -inifile -intl -iodbc -kerberos -ldap -ldap-sasl -libedit -libmysqlclient -mssql -oci8-instant-client -odbc -pcntl -postgres -qdbm -recode (-selinux) -snmp -soap -sockets -spell (-sybase-ct) -systemd -sysvipc -threads -tidy -wddx -xmlreader -xmlrpc -xpm -xslt" ABI_X86="64"


Also tried to downgrade without success.
Comment 8 Guillaume Castagnino 2014-08-08 04:35:54 UTC
today I tried to downgrade to 5.4 branch => same error.

All those versions that were perfectly working before... This does not looks like a php bug but more like a bug in some dependency or in the building toolchain...
Comment 9 Guillaume Castagnino 2014-08-10 02:26:51 UTC
Some more input:
- I build php on my ~amd[1] with the same php USE flags, the build is working
- I build php on my ~amd hardened (see post #1), the build fails as reported

If I scp the binaries from my ~amd to my ~amd hardened, those binaries are running fine too. So this is definitely not a runtime issue, but a building issue.

I will try to dump and analyse the builds logs, but not in the next days since I'm not at home

[1]Portage 2.2.11-r1 (python 3.4.1-final-0, default/linux/amd64/13.0/desktop, gcc-4.8.3, glibc-2.19-r1, 3.15.6-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.15.6-gentoo-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9300_@_2.50GHz-with-gentoo-2.2
KiB Mem:     3977116 total,   1404848 free
KiB Swap:    1716448 total,   1217988 free
Timestamp of tree: Sun, 10 Aug 2014 01:30:01 +0000
ld GNU ld (GNU Binutils) 2.24
app-shells/bash:          4.2_p47
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.8, 3.4.1
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.14.1
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.16 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo gcpan_overlay xwing local
Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -mtune=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -mtune=native -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildsyspkg collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ http://mirror.ovh.net/gentoo-distfiles/     http://trumpetti.atm.tut.fi/gentoo/ http://gentoo.tiscali.nl/"
LANG="fr_FR.UTF-8"
LC_ALL="fr_FR.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,--sort-common"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/gcpan-portage /usr/local/portage/portage /usr/local/portage/local-portage"
USE="X a52 aac acl acpi additions adobe-cff alsa amd64 bash-completion branding bzip2 cairo caps cdda cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvb dvd dvdnav dvdr emboss encode exif extensions firefox flac fontconfig fpm g3dvl gif gles gles2 gpm gtk gtk2 iconv icu idn inotify iproute2 ipv6 ithreads jpeg kde kmod lcms libkms libnotify live llvm lzma mad matroska minizip mmx mng modules mp3 mp4 mpeg multilib ncurses network nls nptl nsplugin ofx ogg opengl openmp openssl pam pango pcre pdf png policykit qt3support qt4 rdesktop readline sasl scanner session spell sse sse2 sse3 sse4 sse4_1 ssl ssse3 startup-notification svg tcpd theora threads tiff truetype udev udisks unicode upower usb v4l vaapi vdpau vim-pager vim-syntax vnc vorbis x264 xattr xcb xml xorg xv xvid xvmc zip zlib" ABI_X86="32 64" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="fr" NGINX_MODULES_HTTP="access auth_basic autoindex browser charset empty_gif fastcgi gzip headers_more limit_req limit_conn map proxy realip referer rewrite stub_status upstream_ip_hash userid" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python3_4" RUBY_TARGETS="ruby19 ruby20" SANE_BACKENDS="plustek" USERLAND="GNU" VIDEO_CARDS="nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="3.4"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC

=================================================================
                        Package Settings
=================================================================

dev-lang/php-5.5.15 was built with the following:
USE="bzip2 calendar cli crypt ctype curl exif fileinfo filter fpm ftp gd hash iconv imap ipv6 json ldap ldap-sasl mhash nls opcache pcntl pdo phar posix postgres readline session simplexml soap sockets ssl sysvipc tokenizer unicode xml zip zlib -apache2 -bcmath -berkdb -cdb -cgi -cjk -debug -embed -enchant (-firebird) -flatfile (-frontbase) -gdbm -gmp -inifile -intl -iodbc -kerberos -libedit -libmysqlclient -mssql -mysql -mysqli -oci8-instant-client -odbc -qdbm -recode (-selinux) -sharedmem -snmp -spell -sqlite (-sybase-ct) -systemd -threads -tidy -truetype -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xslt" ABI_X86="64"
Comment 10 stefan staudenmeyer 2014-08-11 09:59:03 UTC
Crosslink: https://bugs.php.net/bug.php?id=67714

Some ppl had issues with funtoo as well, I had them with any 5.5 ebuild.
Comment 11 Holger 2014-08-16 20:30:59 UTC
I had the same problem on non-hardended.
php-5.5.15 failed with syntax error on HEREDOC syntax. php-5.5.14 (which was working before) failed also.
Building php-5.5.15 by hand was working.

I tracked it down to the re-generation of the file "Zend/zend_language_scanner.c". The packaged one (generated by by re2c 0.13.5) was working and the one generated during emerge (generated by by re2c 0.13.7.2) failed.

Hence I masked >=dev-util/re2c-0.13.6 and now it is working again (with dev-util/re2c-0.13.5-r1).

Here the output of my emerge --info php

# emerge --info php
Portage 2.2.12 (python 3.4.1-final-0, default/linux/amd64/13.0/no-multilib, gcc-4.8.3, glibc-2.19-r1, 3.16.1 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.16.1-x86_64-Intel-R-_Atom-TM-_CPU_D2700_@_2.13GHz-with-gentoo-2.2
KiB Mem:     8154512 total,   2879804 free
KiB Swap:    3999676 total,   3999676 free
Timestamp of tree: Sat, 16 Aug 2014 17:45:01 +0000
ld GNU ld (GNU Binutils) 2.24
app-shells/bash:          4.2_p47
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.8, 3.4.1
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.11.6, 1.14.1
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.16 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo gentoo-extras-overlay freeswitch
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -mtune=native -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=native -mtune=native -fomit-frame-pointer"
DISTDIR="/var/tmp/portage/distfiles"
EMERGE_DEFAULT_OPTS="--complete-graph --with-bdeps=y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j 4"
PKGDIR="/usr/portage/packages"
PORTAGE_COMPRESS="lzma"
PORTAGE_COMPRESS_FLAGS="-9"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage.gentoo-extras-overlay /usr/local/portage.freeswitch-overlay"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="acl alsa amd64 apache2 avahi bzip2 caps cli cracklib crypt curl cxx dbus expat fam fontconfig gd gmp gssapi iconv icu idn ipv6 jbig jpeg kerberos logrotate lzma mmx ncurses nls nptl openmp pam pcre png quota readline sasl sctp session sse sse2 ssl syslog tcmalloc threads tiff truetype udev unicode vhosts xattr zeroconf zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="alias auth_basic auth_ldap authn_core authz_core authz_host authz_user deflate dir filter headers include info ldap log_config mime mime_magic negotiation proxy proxy_http proxy_wstunnel socache_shmcb status unixd" APACHE2_MPMS="event" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

dev-lang/php-5.5.15 was built with the following:
USE="apache2 bcmath bzip2 cli crypt ctype curl fileinfo filter gd gmp hash iconv intl ipv6 json kerberos ldap mysql mysqli nls opcache pcntl pdo phar posix readline session simplexml snmp sockets sqlite ssl sysvipc threads tokenizer truetype unicode xml xslt zip zlib -berkdb -calendar -cdb -cgi -cjk -debug -embed -enchant -exif (-firebird) -flatfile -fpm (-frontbase) -ftp -gdbm -imap -inifile -iodbc -ldap-sasl -libedit -libmysqlclient -mhash -mssql -oci8-instant-client -odbc -postgres -qdbm -recode (-selinux) -sharedmem -soap -spell (-sybase-ct) -systemd -tidy -wddx -xmlreader -xmlrpc -xmlwriter -xpm"
Comment 12 Guillaume Castagnino 2014-08-17 06:46:04 UTC
You make my day !

Indeed:
- the system where php is working has *no re2c installed*
- the system where php fails has re2c-0.13.7.2

First thought: there is some automagic around re2c, it’s not a php dependency, but if present, it’s used at build time
Secondly, indeed, downgrading to re2c-0.13.6, and the HEREDOC problem vanishes !

Thanks!

I update the bug title accordingly to this, but now: re2c or php fault ? ;)
Comment 13 Sergei Trofimovich (RETIRED) gentoo-dev 2014-08-18 16:05:01 UTC
Very likely re2c bug. Notified upstream.

Thanks!
Comment 14 Sergei Trofimovich (RETIRED) gentoo-dev 2014-08-19 08:49:37 UTC
I've masked latest re2c until it will be fixed upstream:

>  19 Aug 2014; Sergei Trofimovich <slyfox@gentoo.org> package.mask:
>  Mask >=dev-util/re2c-0.13.7.2 (bug #518904).

How to test if you are affected:

    $ cat a.php 
    <?php

        echo $v = <<<EOT
            hello
    EOT;
    $ php -f a.php

should output "        hello".

If it bails with error like:
    PHP Parse error:  syntax error, unexpected '<<<EOT' in /home/slyfox/a.php on line 3

    Parse error: syntax error, unexpected '<<<EOT' in /home/slyfox/a.php on line 3

then you need to rebuild php:

1. sync tree and "update" re2c (it should downgrade down to 0.13.6)
2. rebuild all affected php slots
Comment 15 Sergei Trofimovich (RETIRED) gentoo-dev 2014-08-22 21:17:42 UTC
Upstream fix:
    http://sourceforge.net/p/re2c/code-git/ci/7205f9126b563eb2827cf94dcd383fd930c1fd65/

Pushed fixed re2c as:

>  22 Aug 2014; Sergei Trofimovich <slyfox@gentoo.org> +re2c-0.13.7.5.ebuild,
>  -re2c-0.13.7.2.ebuild:
>  Version bump, drop broken version (bug #518904).

And unmasked as:

>  22 Aug 2014; Sergei Trofimovich <slyfox@gentoo.org> package.mask:
>  Unmask '>=dev-util/re2c-0.13.7.2' as upstream fixed PHP lexer bug.

Thanks!