Last modified: 2014-04-30 01:43:15 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T60213, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 58213 - Warning with PCRE<7.2: preg_match(): Compilation failed: assertion expected after (?( at offset 115 in /var/www/html/w/includes/utils/IP.php on line 88
Warning with PCRE<7.2: preg_match(): Compilation failed: assertion expected a...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
1.22.0
All All
: Low normal (vote)
: 1.22.x release
Assigned To: Nobody - You can work on this!
:
: 58253 59765 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-09 15:04 UTC by Kevin Israel (PleaseStand)
Modified: 2014-04-30 01:43 UTC (History)
12 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---
legoktm.wikipedia: Backport_to_Stable+


Attachments

Description Kevin Israel (PleaseStand) 2013-12-09 15:04:58 UTC
When trying to install MediaWiki on CentOS 5 (using the packaged version of PHP 5.3.3), I got the following error:

Creating administrator user account... Warning: preg_match(): Compilation failed: assertion expected after (?( at offset 115 in /var/www/html/w/includes/utils/IP.php on line 88 Warning: preg_match(): Compilation failed: assertion expected after (?( at offset 115 in /var/www/html/w/includes/utils/IP.php on line 88 done

This is probably because of Gerrit change #66304, which rendered the regex
RE_IPV6_ADD incompatible with the PCRE 6.6 that comes with CentOS 5,
though CentOS 6 should be fine.

So we have two options:

* decide not to support PHP binaries that are built to use a system
  version of PCRE older than 7.2, adding to the installer a check for
  this; or

* revert the change.

In either case, the patch should be backported to 1.22.
Comment 1 Gerrit Notification Bot 2013-12-09 16:32:10 UTC
Change 100390 had a related patch set uploaded by PleaseStand:
Restore compatibility with curl < 7.16.2

https://gerrit.wikimedia.org/r/100390
Comment 2 Kevin Israel (PleaseStand) 2013-12-09 16:33:00 UTC
(In reply to comment #1)
> Change 100390 had a related patch set uploaded by PleaseStand:
> Restore compatibility with curl < 7.16.2
> 
> https://gerrit.wikimedia.org/r/100390

Wrong bug...
Comment 3 Antoine "hashar" Musso (WMF) 2013-12-09 19:31:16 UTC
I guess the CentOS version of PHP is compiled with a specific PCRE version which is most probably the one coming with the OS instead of the one bundled within PHP.



Kevin can you run `php -i` and paste there the 'pcre' section? Example output for me (Mac OS X):

  pcre
  
  PCRE (Perl Compatible Regular Expressions) Support => enabled
  PCRE Library Version => 8.02 2010-03-19

Directive => Local Value => Master Value
pcre.backtrack_limit => 1000000 => 1000000
pcre.recursion_limit => 100000 => 100000


On a Precise instance having php5 5.3.10-1ubuntu3.8+wmf2

PCRE Library Version => 8.12 2011-01-15


Can you also paste the result of `ldd /usr/bin/php |fgrep pcre`. Again on Precise that yields:

  libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f6a65e75000)

Then use readlink against the /lib.. file to find out the version:

 $ readlink /lib/x86_64-linux-gnu/libpcre.so.3
 libpcre.so.3.12.1
 $


And the version of libpcre has given by rpm or yum :-D



PHP 5.3.3 (out in July 2010) comes with bundled PCRE version 8.0.  Additionally CentOS package does not use the expected pcre version so I am afraid this bug is going to be a WONTFIX.
Comment 4 Kevin Israel (PleaseStand) 2013-12-10 00:34:02 UTC
(In reply to comment #3)
> Kevin can you run `php -i` and paste there the 'pcre' section? Example output
> for me (Mac OS X):

Configure Command =>  './configure'  '--build=i386-redhat-linux-gnu'
[...] '--with-pcre-regex=/usr' [...]

pcre

PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 6.6 06-Feb-2006

Directive => Local Value => Master Value
pcre.backtrack_limit => 100000 => 100000
pcre.recursion_limit => 100000 => 100000

So yes, the PCRE version is the problem.

> PHP 5.3.3 (out in July 2010) comes with bundled PCRE version 8.0. 
> Additionally
> CentOS package does not use the expected pcre version so I am afraid this bug
> is going to be a WONTFIX.

Agreed. I nevertheless filed this report so I have something to refer to when I add an installer check for it.
Comment 5 Kevin Israel (PleaseStand) 2013-12-10 07:48:05 UTC
*** Bug 58253 has been marked as a duplicate of this bug. ***
Comment 6 Kevin Israel (PleaseStand) 2013-12-10 08:59:37 UTC
So if we don't revert the change, for those who are stuck on RHEL/CentOS 5 and are using that distribution's php53 package, we would advise upgrading to PHP 5.4 using any of several unofficial RPMs/repos that don't use the system PCRE.

Would that be an acceptable answer, or is it in fact necessary to support the base install of this six-year-old distribution for a little while longer (until PHP 5.3 support is dropped)?
Comment 7 Brad Jorsch 2013-12-10 16:04:18 UTC
(In reply to comment #6)
> So if we don't revert the change, for those who are stuck on RHEL/CentOS 5
> and
> are using that distribution's php53 package, we would advise upgrading to PHP
> 5.4 using any of several unofficial RPMs/repos that don't use the system
> PCRE.

They could as well upgrade to a php53 package that wasn't compiled against the system PCRE.

It may even be possible that they could just upgrade their system PCRE.
Comment 8 MZMcBride 2013-12-10 19:32:59 UTC
Discussion is getting split between this bug and bug 58253.

Copying the Marks and bug 58253 is cross-referenced with [[mw:MediaWiki 1.22/Known issues]].
Comment 9 Gerrit Notification Bot 2013-12-17 07:14:45 UTC
Change 102081 had a related patch set uploaded by PleaseStand:
Check for very old PCRE versions in installer and updater

https://gerrit.wikimedia.org/r/102081
Comment 10 Markus Glaser 2014-01-03 17:47:58 UTC
The patch points to a MediaWiki page that is supposed to offer some explanation:
https://www.mediawiki.org/wiki/Manual:Errors_and_symptoms/PCRE

However, that page is empty. Is there a better article to point to?
Comment 11 Bartosz Dziewoński 2014-01-03 17:52:09 UTC
As explained in the comments on the patch, that page is currently a draft
located in user-space.
Comment 12 Andre Klapper 2014-01-07 15:00:54 UTC
*** Bug 59765 has been marked as a duplicate of this bug. ***
Comment 13 Gerrit Notification Bot 2014-01-21 22:39:34 UTC
Change 108843 had a related patch set uploaded by MarkAHershberger:
Check for very old PCRE versions in installer and updater

https://gerrit.wikimedia.org/r/108843
Comment 14 Gerrit Notification Bot 2014-01-21 22:44:08 UTC
Change 108843 merged by jenkins-bot:
Check for very old PCRE versions in installer and updater

https://gerrit.wikimedia.org/r/108843
Comment 15 Gerrit Notification Bot 2014-01-21 22:45:16 UTC
Change 102081 merged by jenkins-bot:
Check for very old PCRE versions in installer and updater

https://gerrit.wikimedia.org/r/102081
Comment 16 Andre Klapper 2014-01-22 00:15:55 UTC
Patch merged to 1.22.x and git master. Closing as FIXED.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links