-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error from PCRE library in PHP on startup #1682
Comments
it work if you do apt-get dist-upgrade before php installation ie...
|
possibly related - https://bugs.php.net/bug.php?id=81424 |
Affected versions:
Unaffected: 7.3.33 |
@calvera - thanks, can confirm that adding a dist-upgrade makes the issue go away.
I will let Mr Surý decide whether to close this issue or not. |
I have the exact same bug with PHP-7.4 on Debian 10 when going from 7.4.25-2+0 It seems to happen because those servers keep Debian's libpcre2 :
But it should upgrade to deb.sury.org's libpcre2 :
In my case it's by design, I have pinned deb.sury.org Pacakges (via /etc/apt/preferences.d) in order not to pull dependencies from this repo as a default. But it's my fault it's not working if I don't let in the compatible libpcre2 from deb.sury.org. |
dist-upgrade brings in newer libs, including pcre, from Ondrej's PPA, which when installed fix the problem:
Perhaps the php packages should depend on this newer version. For instance, a docker build (see below) results in a broken build, even though we're installing PHP from scratch. You typically don't run package upgrades on docker builds as they result on irreproducible builds. FROM ubuntu:focal
ENV TERM=linux
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends gnupg \
&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ondrej-php.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \
&& apt-get update \
&& apt-get -y --no-install-recommends install \
ca-certificates \
curl \
unzip \
php8.0-apcu \
php8.0-cli \
php8.0-curl \
php8.0-mbstring \
php8.0-opcache \
php8.0-readline \
php8.0-xml \
php8.0-zip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* ~/.composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer |
Issues: * #44 * oerdnj/deb.sury.org#1682 Closes #44
I think this is caused by php/php-src#7602, in combination with some pcre.h confusion (bundled vs. system). Not sure whether that is a distro issue or a general issue of php-src. Anyway, upstream ticket is https://bugs.php.net/bug.php?id=81640. |
I would be really appreciative if this could be solved without change to existing installations, because it breaks lots of ddev instances already in the wild. I'm happy to add the dist-upgrade to the code that generates the changes, but that won't solve the problem for existing people. Interesting factoid: this isn't an issue on arm64, only on amd64. Second interesting factoid: Causes a flaming crash in
|
No, that's not going to work. The |
On debian buster (-slim), simply running |
FTR installing |
|
This is a bare minimum. You should be doing |
This also broke GH-hosted images generation in https://github.com/actions/virtual-environments. |
Yes, see PCRE2Project/pcre2#56
Nope, using different compile-time and run-time system library is all that's needed to trigger this.
I think this needs workaround at the distro level. Generally speaking, the problem lies in the fact that the newly added option is header only and not symbol, so there's no way how to track backwards compatibility. This will require some manual tweaking to the Debian packaging. I already applied the change to the DEB.SURY.ORG |
Newly rebuilt packages should already contain |
This doesn't seem to have made it to Debian arm64 yet, although working on Debian amd64. Thanks for the fix, hope it will propagate everywhere soon. |
TBH I didn't wait for pcre2 to be built on all archs, so this will get fixed with the next package update. |
Thanks, and as always thanks for these packages. Sooner package update is better because existing projects on arm64 are affected by this and there's no way to workaround that I've thought of. I did already add the dist-upgrade as standard though, so future situations wouldn't be affected by this (after next ddev release). |
…3385)" This exact dist-upgrade is now breaking dbimage_extra_packages. It's probably due to an error in mariadb packages, but it seems that apt-get dist-upgrade is not a risk-free action. Also, this whole problem seems to have been solved upstream in the deb.sury.org package. See ddev#3385 and oerdnj/deb.sury.org#1682 This reverts commit d385ef9.
…" (#3425) This exact dist-upgrade is now breaking dbimage_extra_packages. It's probably due to an error in mariadb packages, but it seems that apt-get dist-upgrade is not a risk-free action. Also, this whole problem seems to have been solved upstream in the deb.sury.org package. See #3385 and oerdnj/deb.sury.org#1682 This reverts commit d385ef9.
Frequently asked questions
Errors apparently from PCRE library
I'm getting slightly odd error messages that are apparently coming from the PCRE library:
To Reproduce
This can be reproduced by building and running the following docker container.
This gives output that includes
| PHP Warning: PHP Startup: ^(text/|application/xhtml\+xml) (offset=0): unrecognised compile-time option bit(s) in Unknown on line 0
Disabling mbstring makes the problem "go away", but I'm also seeing the problem with userland regexes from symfony/console.
Expected behavior
No error message.
Distribution (please complete the following information):
Package(s) (please complete the following information):
Output of
apt-cache policy <package>
works best.Additional context
This only started happening recently, like the last few days or maybe week.
New container build that is showing this problem.
Old container, built over a week ago that is not showing this problem
The text was updated successfully, but these errors were encountered: