FS#9601 - pcre no longer compiled with PCRE_UTF8

Attached to Project: Arch Linux
Opened by barry o'rourke (barry) - Sunday, 17 February 2008, 19:58 GMT
Last edited by Pierre Schmitz (Pierre) - Saturday, 08 March 2008, 12:41 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Pierre Schmitz (Pierre)
Eric Belanger (Snowman)
Architecture x86_64
Severity High
Priority Normal
Reported Version 2007.08-2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Ever since the recent update to pcre 7.6-3 my drupal based website hasn't worked properly on my archlinux box.

I'm recieving the error message "this version of PCRE is not compiled with PCRE_UTF8 support at offset 0"

Additional info:
* package version(s)
* config and/or log files etc.


Steps to reproduce:

Installing drupal [drupal.org] should do the job.
This task depends upon

Closed by  Pierre Schmitz (Pierre)
Saturday, 08 March 2008, 12:41 GMT
Reason for closing:  Fixed
Additional comments about closing:  apache 2.2.8-2 and php 5.2.5-8 should be fine now.
Comment by Eric Belanger (Snowman) - Sunday, 17 February 2008, 23:55 GMT
pcre is compile with utf8 support:
$ pacman -Q pcre
pcre 7.6-3
$ pcretest -C
PCRE version 7.6 2008-01-28
Compiled with
UTF-8 support
Unicode properties support
Newline sequence is LF
\R matches all Unicode newlines
Internal link size = 2
POSIX malloc threshold = 10
Default match limit = 10000000
Default recursion depth limit = 10000000
Match recursion uses stack


From this thread: http://drupal.org/node/40961
it seems to be a problem with pcre/php.
Comment by Pierre Schmitz (Pierre) - Monday, 18 February 2008, 07:17 GMT
Do you have a test case for this issue? The following code works for me:

<?php
if (!preg_match('/\p{L}/', 'ö')) {
echo 'not OK';
} else {
echo 'OK';
}
?>
Comment by Pierre Schmitz (Pierre) - Monday, 18 February 2008, 14:53 GMT
I installed drupal 6.0 without any problems. What do I need to do in order to reproduce this error? Even all related php tests passed. (did run make test before uploading the package to testing.
Comment by barry o'rourke (barry) - Monday, 18 February 2008, 16:14 GMT
I'll try a fresh install when I get home from work.

All that I can really say at the moment is that the site worked up until around the time of the pcre & php updates, and afterwards it reports back that error. I'll post an update in a couple of hours.
Comment by barry o'rourke (barry) - Monday, 18 February 2008, 17:47 GMT
I've tested the snippit of code that you posted above on both my home machine and my server. It sadly returns not OK on both occasions.

hubert httpd: PHP Warning: preg_match() [<a href='function.preg-match'>function.preg-match</a>]: Compilation failed: support for \P, \p, and \X has not been compiled at offset 1 in /home/httpd/html/pcre.php on line 2

cumberdale httpd: PHP Warning: preg_match() [<a href='function.preg-match'>function.preg-match</a>]: Compilation failed: support for \P, \p, and \X has not been compiled at offset 1 in /home/httpd/html/pcre.php on line 2

[barry@hubert ~]$ pacman -Q php
php 5.2.5-4
[barry@hubert ~]$ pacman -Q pcre
pcre 7.6-3
Comment by barry o'rourke (barry) - Monday, 18 February 2008, 17:58 GMT
To make things really strange, I've just pulled this out of phpinfo()

'--with-pcre-regex=/usr' is included in Configure Command

PCRE (Perl Compatible Regular Expressions) Support enabled
PCRE Library Version 5.0 13-Sep-2004

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


Comment by Pierre Schmitz (Pierre) - Monday, 18 February 2008, 18:19 GMT
Quite strange. I just tested the script above on a clear chroot (i686 and x86_64): No problems. Your phpinfo output seems really wrong to me. It should be like this:

pacman -Q php pcre
php 5.2.5-4
pcre 7.6-3

php -i | grep -i pcre
Configure Command => './configure' '--prefix=/usr' '--sysconfdir=/etc/php' '--with-layout=GNU' '--with-config-file-path=/etc/php' '--with-config-file-scan-dir=/etc/php/conf.d' '--enable-inline-optimization' '--disable-debug' '--disable-rpath' '--disable-static' '--enable-shared' '--with-pcre-regex=/usr' '--disable-cgi' '--with-readline' '--enable-pcntl' '--with-pear=/usr/share/pear' '--with-openssl=shared' '--with-zlib=shared' '--enable-bcmath=shared' '--with-bz2=shared' '--enable-calendar=shared' '--with-curl=shared' '--enable-dba=shared' '--without-db2' '--without-db3' '--with-db4=shared' '--with-gdbm=shared' '--enable-dbase=shared' '--enable-exif=shared' '--enable-ftp=shared' '--with-gd=shared' '--enable-gd-native-ttf' '--with-jpeg-dir=shared,/usr' '--with-png-dir=shared,/usr' '--with-gettext=shared' '--with-imap=shared' '--with-imap-ssl=shared' '--with-ldap=shared' '--enable-mbstring=shared' '--with-mcrypt=shared' '--with-mysql=shared' '--with-mysql-sock=/tmp/mysql.sock' '--with-mysql=shared' '--with-mysqli=shared' '--with-ncurses=shared' '--with-unixODBC=shared,/usr' '--enable-pdo=shared' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-pgsql=shared' '--with-sqlite=shared' '--with-pgsql=shared' '--enable-shmop=shared' '--with-snmp=shared' '--enable-soap=shared' '--enable-sqlite-utf8=shared' '--enable-sysvmsg=shared' '--enable-sysvsem=shared' '--enable-sysvshm=shared' '--with-tidy=shared' '--with-xsl=shared' '--enable-zip=shared' '--enable-posix=shared' '--enable-sockets=shared' '--enable-xml' '--with-ttf=shared' '--enable-session=shared' '--with-regex=php' '--enable-mbstring=all' '--enable-mbregex' '--enable-json=shared' '--with-iconv=shared' '--with-xmlrpc=shared' '--with-pspell=shared' '--with-freetype-dir=shared,/usr' '--with-mime-magic=shared'
pcre
PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 7.6 2008-01-28
pcre.backtrack_limit => 100000 => 100000
pcre.recursion_limit => 100000 => 100000

Perhaps you should reinstall both packages and try the same with a fresh php.ini. I really do not know why you have an pcre lib from 2004.
Comment by barry o'rourke (barry) - Monday, 18 February 2008, 18:36 GMT
It gets even stranger, I was getting my information from http://orodor.net/test.php which just calls phpinfo().

When I run the same command as you on the console I get the same result you did -

[root@hubert /home/httpd/html]$ php -i | grep -i pcre
Configure Command => './configure' '--prefix=/usr' '--sysconfdir=/etc/php' '--with-layout=GNU' '--with-config-file-path=/etc/php' '--with-config-file-scan-dir=/etc/php/conf.d' '--enable-inline-optimization' '--disable-debug' '--disable-rpath' '--disable-static' '--enable-shared' '--with-pcre-regex=/usr' '--disable-cgi' '--with-readline' '--enable-pcntl' '--with-pear=/usr/share/pear' '--with-openssl=shared' '--with-zlib=shared' '--enable-bcmath=shared' '--with-bz2=shared' '--enable-calendar=shared' '--with-curl=shared' '--enable-dba=shared' '--without-db2' '--without-db3' '--with-db4=shared' '--with-gdbm=shared' '--enable-dbase=shared' '--enable-exif=shared' '--enable-ftp=shared' '--with-gd=shared' '--enable-gd-native-ttf' '--with-jpeg-dir=shared,/usr' '--with-png-dir=shared,/usr' '--with-gettext=shared' '--with-imap=shared' '--with-imap-ssl=shared' '--with-ldap=shared' '--enable-mbstring=shared' '--with-mcrypt=shared' '--with-mysql=shared' '--with-mysql-sock=/tmp/mysql.sock' '--with-mysql=shared' '--with-mysqli=shared' '--with-ncurses=shared' '--with-unixODBC=shared,/usr' '--enable-pdo=shared' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-pgsql=shared' '--with-sqlite=shared' '--with-pgsql=shared' '--enable-shmop=shared' '--with-snmp=shared' '--enable-soap=shared' '--enable-sqlite-utf8=shared' '--enable-sysvmsg=shared' '--enable-sysvsem=shared' '--enable-sysvshm=shared' '--with-tidy=shared' '--with-xsl=shared' '--enable-zip=shared' '--enable-posix=shared' '--enable-sockets=shared' '--enable-xml' '--with-ttf=shared' '--enable-session=shared' '--with-regex=php' '--enable-mbstring=all' '--enable-mbregex' '--enable-json=shared' '--with-iconv=shared' '--with-xmlrpc=shared' '--with-pspell=shared' '--with-freetype-dir=shared,/usr' '--with-mime-magic=shared'
pcre
PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 7.6 2008-01-28
pcre.backtrack_limit => 100000 => 100000
pcre.recursion_limit => 100000 => 100000
Comment by Pierre Schmitz (Pierre) - Monday, 18 February 2008, 18:41 GMT
Ah, good hint. php-cli and php-cgi (which I use) seems fine, but the apache module is broken. I'll look into this. I wonder what the hell was going on :-)
Comment by Tom (reztho) - Monday, 18 February 2008, 19:28 GMT
I confirm the apache module is compiled against a pcre without utf-8 support and have the same version of 2004. I have a MediaWiki broken in my system because of that.
Comment by Pierre Schmitz (Pierre) - Monday, 18 February 2008, 23:08 GMT
I have put an updated version of php into [testing]. (You should be able to use that without enabling the whole testing.repo) Would be nice if you could check if this fixes the problem. If you cannot wait for the mirrors to sync, grab the packages from http://users.archlinux.de/~pierre/packages/

What I did:

I patched the builtin version of pcre to 7.6 and recompiled php statically with that version. This is more or less a wuick solution till I know why Apache/mod_php does not work with system pcre.
Comment by Tom (reztho) - Tuesday, 19 February 2008, 10:59 GMT
That package fixes my problems.
Comment by Pierre Schmitz (Pierre) - Tuesday, 19 February 2008, 12:43 GMT
Allright, I have moved this package to [extra]. I still need to figure out what went wrong.
Comment by barry o'rourke (barry) - Tuesday, 19 February 2008, 12:54 GMT
I've given it a quick test run on a clean drupal installation and it looks fine. Will test it on the box that gave me the initial problem when I get home tonight.
Comment by barry o'rourke (barry) - Tuesday, 19 February 2008, 19:38 GMT
Looking good from home too, it also helped me find a bug in my code :)
Comment by Pierre Schmitz (Pierre) - Saturday, 08 March 2008, 12:40 GMT
This issue should finally be fixed now. The problem was not php but apache which did use an really outdated pcre lib. I have rebuilt apache and php to use the system lib now. Both packages are in testing now:

apache 2.2.8-2
php 5.2.5-8

Loading...