Bug 158729 - preg_match: internal pcre_fullinfo() error -3
preg_match: internal pcre_fullinfo() error -3
Status: CLOSED WORKSFORME
Product: Fedora
Classification: Fedora
Component: php (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-05-25 05:51 EDT by Martin West
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-05-25 06:49:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Martin West 2005-05-25 05:51:51 EDT
Description of problem:

Seems php was built with external pcre 
See http://bugs.php.net/bug.php?id=31501&edit=2
for more details

Version-Release number of selected component (if applicable):


How reproducible:

See http://bugs.php.net/bug.php?id=31501&edit=2

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Martin West 2005-05-25 05:54:43 EDT
ps phpinfo() output ...
 './configure' '--build=i386-redhat-linux' '--host=i386-redhat-linux'
'--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr'
'--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin'
'--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include'
'--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var'
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--cache-file=../config.cache'
'--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d'
'--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath'
'--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl'
'--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr'
'--with-gd=shared' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext'
'--with-ncurses=shared' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr'
'--with-openssl' '--with-png' '--with-pspell' '--with-xml'
'--with-expat-dir=/usr' '--with-dom=shared,/usr' '--with-dom-xslt=/usr'
'--with-dom-exslt=/usr' '--with-xmlrpc=shared' '--with-pcre-regex=/usr'
'--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif'
'--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem'
'--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-yp'
'--enable-wddx' '--with-pear=/usr/share/pear' '--with-imap=shared'
'--with-imap-ssl' '--with-kerberos' '--with-ldap=shared'
'--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr'
'--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr'
'--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx'
'--enable-dio' '--enable-mbstring=shared' '--enable-mbstr-enc-trans'
'--enable-mbregex' '--with-mime-magic=/usr/share/file/magic.mime' '--with-pic'
'--with-apxs2=/usr/sbin/apxs'
Comment 2 Joe Orton 2005-05-25 06:04:46 EDT
Please give the output of:

rpm -q pcre php

and give a precise reproduction case (a test script which will fail when run by
/usr/bin/php, preferably). 

The script sample in the upstream bug works fine for me in FC3.
Comment 3 Martin West 2005-05-25 06:35:50 EDT
Thanks for the super quick response

rpm -q pcre php

pcre-4.5-3
php-4.3.11-2.5

The script sample in the upstream bug works fine for me in FC3.
I get 

preg_match_all test
PHP version : --
Example
, ,

should produce ...

example: ,
this is a test
example: , this is a test 

from 


<html>
<body>
<h1>preg_match_all test</h1>
<?php

preg_match('@([0-9]{1,2}).([0-9]{1,2}).([0-9]{1,2})@', phpversion(),
$match);
echo 'PHP version : '.$match[1].'-'.$match[2].'-'.$match[3];

echo "\n<h2>Example</h2>\n";
preg_match_all("|<[^>]+>(.*)</[^>]+>|U",
   "<b>example: </b><div align=left>this is a test</div>",
   $out, PREG_PATTERN_ORDER);
echo $out[0][0] . ", " . $out[0][1] . "\n";
echo $out[1][0] . ", " . $out[1][1] . "\n";

echo "<p>should produce ...<p>";
echo "<b>example: </b>, <div align=left>this is a test</div>
example: , this is a test";

?>

</body>
</html>

which is at http://thecla.homeftp.net/phptest/test1.php

and I get 

[client 10.0.0.128] PHP Warning:  preg_match: internal pcre_fullinfo() error -3
in /var/www/html/phptest/test1.php on line 8
[client 10.0.0.128] PHP Notice:  Undefined offset:  1 in
/var/www/html/phptest/test1.php on line 9
[client 10.0.0.128] PHP Notice:  Undefined offset:  2 in
/var/www/html/phptest/test1.php on line 9
[client 10.0.0.128] PHP Notice:  Undefined offset:  3 in
/var/www/html/phptest/test1.php on line 9
[client 10.0.0.128] PHP Warning:  preg_match_all: internal pcre_fullinfo() error
-3 in /var/www/html/phptest/test1.php on line 14
[client 10.0.0.128] PHP Notice:  Undefined offset:  0 in
/var/www/html/phptest/test1.php on line 15
[client 10.0.0.128] PHP Notice:  Undefined offset:  0 in
/var/www/html/phptest/test1.php on line 15
[client 10.0.0.128] PHP Notice:  Undefined offset:  1 in
/var/www/html/phptest/test1.php on line 16
[client 10.0.0.128] PHP Notice:  Undefined offset:  1 in
/var/www/html/phptest/test1.php on line 16

in the apache log

standalone testcase to come ...
Comment 4 Martin West 2005-05-25 06:41:52 EDT
Hmmm, standalone test works so 

<?php
echo "test for 158729\n";

preg_match('@([0-9]{1,2}).([0-9]{1,2}).([0-9]{1,2})@', phpversion(),
$match);
echo 'PHP version : '.$match[1].'-'.$match[2].'-'.$match[3];

echo "\n";

?>

produces

Content-type: text/html
X-Powered-By: PHP/4.3.11

test for 158729
PHP version : 4-3-11

So must be something wrong with my apache, its self compiled.

Back to the drawing board, Thanks
Comment 5 Joe Orton 2005-05-25 06:49:14 EDT
> So must be something wrong with my apache, its self compiled

That's likely your problem.  The Fedora httpd package is patched to use the
system pcre library - otherwise another bundled copy of pcre gets linked in.

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