Project

General

Profile

Actions

Bug #67048

closed

PHP 5.6.9, probably due to libpcre-Update in PHP

Added by Jonas Eberle almost 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2015-05-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

After updating from PHP 5.6.8 to PHP 5.6.9 (http://php.net/ChangeLog-5.php#5.6.9), I am encountering these errors:

Typo3 7.2.0 (installtool or backend):

#1: PHP Warning: preg_match(): Compilation failed: internal error: previously-checked referenced subpattern not found at offset 1963 in typo3_src-7.2.0/typo3/sysext/fluid/Classes/Core/Parser/TemplateParser.php line 811

TYPO3\CMS\Core\Error\Exception thrown in file
typo3_src-7.2.0/typo3/sysext/core/Classes/Error/ErrorHandler.php in line 102.

(frontend):
Oops, an error occurred!

Typo3 6.2.12 (backend, installtool):

#1237900529: The argument "arguments" was registered with type "array", but is of type "string" in view helper "TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper" 

InvalidArgumentException thrown in file
/var/www/wrs.0711cms.de/typo3_src-6.2.12/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractViewHelper.php in line 385.

I suspect the PHP-upgrade to pcrelib 8.37 being the cause of the Typo3 7.2-error. For the other, I really have no idea.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #67234: Loading Language Files fails when document root is an nfs shareClosed2015-06-02

Actions
Has duplicate TYPO3 Core - Bug #67350: PHP Warning: preg_match(): Compilation failed: internal error: previously-checked referenced subpattern not found at offset 1963Closed2015-06-08

Actions
Actions #1

Updated by Christian Kuhn almost 9 years ago

  • Target version set to 6.2.13
  • Sprint Focus set to Stabilization Sprint

mmmh. needs to be takled ... added to 6.2.13 stabilization board for now ...

Actions #2

Updated by Markus Klein almost 9 years ago

The 6.2 error sounds more like a syntax error in some Fluid template.
Where do you get this error? Upon login?
Can you maybe provide a full stacktrace?

Actions #3

Updated by Markus Klein almost 9 years ago

http://www.pcre.org/changelog.txt Point 22
https://github.com/php/php-src/blob/master/ext/pcre/pcrelib/ChangeLog Point 14

Seems to be a bigger issue:

https://github.com/swiftmailer/swiftmailer/issues/259

In 5.6.9 the PCRE Version was updated to 8.37 (http://php.net/ChangeLog-5.php#5.6.9) and this does not seem to play well with the swiftmailer regex.

Actions #4

Updated by Jonas Eberle almost 9 years ago

I suspect that regex-based parameter-parsing is the cause of the 6.2-issue, too.

As this happened on a live system, I quickly reverted to the older PHP-version.

Strange thing: in the currently downloadable PHP 5.6.9 http://php.net/get/php-5.6.9.tar.bz2/from/a/mirror pcre 8.36 is included, not 8.37 as announced. At least it looks like that in these files:

php-5.6.9/ext/pcre/pcrelib/config.h:317:#define PACKAGE_STRING "PCRE 8.36" 
php-5.6.9/ext/pcre/pcrelib/config.h:326:#define PACKAGE_VERSION "8.36" 
php-5.6.9/ext/pcre/pcrelib/config.h:442:#define VERSION "8.36" 

I compared this with pcre's source ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ and upstream clearly states version 8.37 in these places.

I could verify on a test server (with Ubuntu, not Debian as the live system) that the problem actually does not exist with this PHP for both Typo3 v7.2.0 and Typo3 v6.2.12. This PHP is the official current PHP-5.6.9.

So to be honest I am very puzzled right now: PHP 5.6.9 does not include pcrelib 8.37 as announced (but maybe it did in an earlier download?) and I had an error that I cannot reproduce with freshly downloaded sources.

I had the error on Debian Wheezy with PHP-packages from

deb http://packages.dotdeb.org wheezy-php56 all
. Unfortunately I do not have a Debian wheezy test system here where I could quickly verify. It could very well be that the problem comes down to Debian PHP patches.

Or PHP quickly withdrew pcrelib 8.37, reverted and reuploaded without version change? ;)

So maybe someone could try on a Debian to verify.

Actions #5

Updated by Andreas Kienast almost 9 years ago

  • Status changed from New to Needs Feedback

dmaicher mentioned in this ticket that swiftmailer works fine in php-cli and is broken when using Apache.

Can you please verify whether this is your case, too?

Actions #6

Updated by Alexander Opitz almost 9 years ago

Looking in the git history of PHP shows that on branch PHP-5.4 was an zupdate from pcre 8.34 to 8.36

commit 23917b451bf4029e78082b4e0a56bc4c6f117990
Author: Stanislav Malyshev <stas@php.net>
Date:   Mon Apr 27 23:15:27 2015 -0700

    Upgrade PCRE to 8.36, it fixes some crashes

    We probably will need to go to 8.37 once it is released.

This was merged successive to PHP-5.5, PHP-5.6 and master. After this there was a new commit.

commit 95fa72799298300f310c630a6c854f511d083bcc
Author: Stanislav Malyshev <stas@php.net>
Date:   Wed Apr 29 22:25:02 2015 -0700

    Upgrade to PCRE 8.37 due to various bugfixes

which was also merged into the branches PHP-5.5, PHP-5.6 and master.
This second commit doesn't changed config.h of pcrelib, thats why pcrelib states it uses 8.36 instead of 8.37 and maybe they forgot more.

Actions #7

Updated by Alexander Opitz almost 9 years ago

Created bug report about the version mismatch https://bugs.php.net/bug.php?id=69689

Actions #8

Updated by Jochen R almost 9 years ago

Same issue here with Typo3 7.2, Debian 7.8 and latest PHP 5.5.25 release

Uncaught TYPO3 Exception
#1: PHP Warning: preg_match(): Compilation failed: internal error: previously-checked referenced subpattern not found at offset 1963 in /netsite/typo3/typo3_src-7.2.0/typo3/sysext/fluid/Classes/Core/Parser/TemplateParser.php line 811 (More information)

Actions #9

Updated by Markus Klein almost 9 years ago

  • Priority changed from Should have to Must have

Curiously changelog 5.5.25 does not mention anything regarding regex, but PHP 5.4.41 got PCRE 8.37 as well!

Hence I suspect that the changelog for 5.5.25 forgot to mention the PCRE changes and even worse 5.4.41 is affected too!

Major problem: All PHP updates were security updates and all of them break Fluid!

Actions #10

Updated by Markus Klein almost 9 years ago

According to https://github.com/gplessis/dotdeb-php5/issues/85 affected regex work just fine on CLI. It seems to be related to apache/mod_php

Actions #11

Updated by Benni Mack almost 9 years ago

I had this problem with servers running dotdeb packages. can you confirm? All other instances work fine. (wheezy+dotdeb => broken, upgrade to jessie+php5.6 out of the box - no problem)

Actions #12

Updated by Jochen R almost 9 years ago

@Benjamin Fischer: We are indeed using .deb packages

Actions #13

Updated by Benni Mack almost 9 years ago

OK. Since the original debian packages run with 5.6.7 and not 5.6.9 they are not yet affected, that's the reason the solution worked for me.

Actions #14

Updated by Markus Klein almost 9 years ago

Just updated my Fedora 21 dev server.

php.x86_64 0:5.6.9-1.fc21

# php -info
PHP 5.6.9 (cli) (built: May 15 2015 09:17:14)
PCRE Library Version => 8.35 2014-04-04

Seems that Fedora is shipping an even lower version of PCRE.

Actions #15

Updated by Alexander Opitz almost 9 years ago

The version issue mismatch is resolved in PHP git, but I don't know if this solves the issue here.

Actions #16

Updated by Bernhard Eckl almost 9 years ago

Same here. Debian Wheezy with Dotdeb PHP 5.6.9. Downgrade to Dotdeb PHP 5.6.8 solves the issue.

Actions #17

Updated by Andreas Kienast almost 9 years ago

dotdeb built new packages yesterday night. Can you please update to the latest version and check whether the bug still occurs?

http://packages.dotdeb.org/dists/wheezy-php56/php5/binary-amd64/

Actions #18

Updated by Ludwig Rafelsberger almost 9 years ago

Same here. Just tried updating php to the yesterday-released dotdeb versions: The PCRE Library is now reported as 8.36. The TYPO3 errors are still there.

$ apt-cache policy php5 | grep Installed
Installed: 5.6.9-1~dotdeb+7.2
$ php -info | grep 'PCRE Library'
PCRE Library Version => 8.36 2014-09-26

I'm on Debian Wheezy with all packages up to date and (trying to) use TYPO3 CMS 6.2.12.

Actions #19

Updated by Alexander Opitz almost 9 years ago

@Ludwig Rafelsberger

The PCRE Library version should be reported as 8.37. So the 5.6.9-1 package do not have this patch included. Normaly this change will be in 5.6.10.
But I don't know if only fixing version number fixes this issue.

Actions #20

Updated by Stefan Neufeind almost 9 years ago

Since we seem to have figured out it's a problem with that pcre-version: Do you think there is simply a bug in pcre (which will be fixed) or was there some change we'd need to take care of to keep things working with newer php/pcre-releases?

Actions #21

Updated by Markus Klein almost 9 years ago

It works with 5.6.9 on Fedora 21 here, so I don't think it's a bug in PCRE, but rather something in the debian packages.

Actions #22

Updated by Frank Nägler almost 9 years ago

Imo the problem is located in the PHP lib, can we can do anything in the core? If not, I would prefer to remove this issue from the Stab-Board.

Actions #23

Updated by Markus Klein almost 9 years ago

  • Target version deleted (6.2.13)
  • Sprint Focus deleted (Stabilization Sprint)

We can do nothing in Core! I already checked the regex, no sane way.

It works on lower PHP versions and on current versions on non-debian. So IMHO this needs to be fixed there.

Actions #24

Updated by Alexander Opitz almost 9 years ago

As it looks like, the issue only happens with php5_mod and not PHP cli we can do nothing here.
Maybe php5_mod collides with the false PCRE version number in latest PHP 5.x versions, so this should be controlled again if it is solved with PHP 5.6.10, 5.5.26, 5.4.41. If not, we can only open an issue report in PHPs bug tracking system.

Actions #25

Updated by Dirk Wildt almost 9 years ago

Don't use php package from dotdeb.org

Solve the TYPO3/PHP PCRE bug

I'm using Debian Wheezy too.
I used php from dotdeb.org.
I could solve the bug:
  • remove the dotdeb.org package from the source list (see snippet below)
  • reinstall php5
root@gera:/# nano /etc/apt/sources.list

deb http://http.debian.net/debian wheezy main
...
#150910, dwildt, TYPO3/PHP PCRE bug. See: https://forge.typo3.org/issues/67048, 2-
#deb http://packages.dotdeb.org wheezy-php55 all
#deb-src http://packages.dotdeb.org wheezy-php55 all
Actions #26

Updated by Alexander Opitz almost 9 years ago

@Dirk Why?

Actions #27

Updated by Frank Frewer almost 9 years ago

I don't know why but I can confirm that removing dotdeb php5 (5.5.25) and reinstalling the wheezy version (5.4.41-0+deb7u1) solved the problem.

Actions #28

Updated by Christian Kuhn almost 9 years ago

confirmed issue exists with debian wheezy dotdeb 5.5.25, no issue with 5.5.24.

Actions #29

Updated by Dirk Wildt almost 9 years ago

@Alexander

Sorry, but I don't know why it doesn't run with php from dotdeb.org and it runs with the php from default Debian packages.

Actions #30

Updated by Jonas Eberle almost 9 years ago

I can also confirm that the previous 5.5.24-1~dotdeb+wheezy.1 from dotdeb works.

It really seems that just the very latest dotdeb-Packages (5.6 and 5.5) are affected.

Do we have a simple testcase to reproduce this? Something to quickly run in the CLI or on a blank website to check? That way I could quickly produce a list of works/works not and recheck on PHP compiled from source.

Actions #31

Updated by Frank Gerards almost 9 years ago

This PHP COre bug seems fixed in all latest PHP versions now.
see e.g. http://php.net/ChangeLog-5.php#5.6.10

Actions #32

Updated by Alexander Opitz almost 9 years ago

@Frank Gerards

Where do you see the fix inside the ChangeLog?

Actions #33

Updated by Christian Kuhn almost 9 years ago

5.6.10 from dotdeb is still affected

Actions #34

Updated by Markus Klein almost 9 years ago

Please simply follow https://github.com/gplessis/dotdeb-php5/issues/85#issuecomment-111922723
A lot is going on there and there seems a solution on the horizon.

Actions #36

Updated by Heiko Kromm almost 9 years ago

Today I upgraded to 5.5.26-1~dotdeb+7.3, where this bug https://forge.typo3.org/issues/67048#note-6 has been fixed. But the errors still comes up.

Actions #37

Updated by Frederic Gaus almost 9 years ago

Heiko, die you cleared all caches? Also in the install tool or even remove all files in typo3temp/Cache/ ?

Actions #39

Updated by Alexander Opitz over 8 years ago

What is the state of this issue?

Actions #40

Updated by Frank Frewer over 8 years ago

ATM I'm working with PHP Version 5.5.29-1~dotdeb+7.1: No errors

Actions #41

Updated by Wouter Wolters over 8 years ago

  • Status changed from Needs Feedback to Closed

Not a TYPO3 error but in libpcre.

Actions

Also available in: Atom PDF