Bug 115379

Summary: pcre conflict between httpd and php
Product: Red Hat Enterprise Linux 3 Reporter: Joe Orton <jorton>
Component: httpdAssignee: Joe Orton <jorton>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: allen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-03-23 09:48:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joe Orton 2004-02-11 17:29:44 UTC
Duplicate of bug 98056 as this issue also affects Red Hat Enterprise
Linux 3:

Additional Comment #9 From Allen Smith on 2004-02-10 14:00 -------
Private Comment

I am seeing this on a RHEL3 box. httpd-2.0.46-26.ent Doesn't matter if
I run threaded or prefork. It happens whenever I hit a file in the
directory that has rewrite rules in the .htaccess. Only 4 lines of
rewrite rules.

Here is a partial backtrace from gdb.

#66 0x08087419 in pcre_compile ()
#67 0x08087f9f in pcre_compile ()
#68 0x08087960 in pcre_compile ()
#69 0x08087419 in pcre_compile ()
#70 0x08087f9f in pcre_compile ()
#71 0x08087e89 in pcre_compile ()
#72 0x08086256 in pcre_compile ()
#73 0x08088373 in pcre_exec ()
#74 0x08083724 in regexec ()

Comment 1 Allen Smith 2004-02-11 18:26:57 UTC
I worked around this by simplifying the regular expressions I was
using. The new regexps work fine on apache2, but fail on our older
boxes (1.3.2x). 

Comment 2 Joe Orton 2004-02-11 19:41:05 UTC
Can you give an example .htaccess which failed?


Comment 3 Allen Smith 2004-02-11 19:58:51 UTC
sure:
This one fails:

RewriteEngine On
RewriteCond %{HTTP_REFERER}
!^http(s)?://([a-z0-9-]+.)*falconstudios.com/ [NC] RewriteCond
%{HTTP_REFERER} !^http(s)?://([a-z0-9-]+.)*joshweston.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://66.28.50.194/ [NC]
RewriteRule /* http://www.falconstudios.com/error.htm [R,L]

This one is fine:
RewriteEngine On
RewriteCond %{HTTP_REFERER}
!^http(s)?://([a-z0-9-.])+falconstudios.com/ [NC] RewriteCond
%{HTTP_REFERER} !^http(s)?://([a-z0-9-.])+joshweston.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://66.28.50.194/ [NC]
RewriteRule /* http://www.falconstudios.com/error.htm [R,L]


Comment 4 Joe Orton 2004-02-12 14:21:18 UTC
A request with what Referer header will trigger the failure?  We're
having trouble reproducing the problem here.

(the presence of and solution to the bug are clear but we'd like to
find a precise repro case so we can ensure the fix is tested properly)


Comment 5 Allen Smith 2004-02-13 16:22:20 UTC
Here is an apache log of a request iwth the source IP stripped.

[13/Feb/2004:08:23:57 -0800] "GET
/pix/EFF1C7B9D3A08/MVP062/Watermarked/Thumbnailed/70/5711_T.jpg
HTTP/1.1" 200 3498
"http://www.falconstudios.com/falconxxx/showGalleryList.do"
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) 

Comment 6 Joe Orton 2004-02-26 15:13:27 UTC
We couldn't manage to reproduce this problem unfortunately. If you
could try the test update packages in which httpd uses the system pcre
library:

http://people.redhat.com/jorton/Taroon-httpd/

with the example configuration which gave a segfault that would be great.

Comment 7 Mark J. Cox 2004-03-23 09:48:57 UTC
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2004-084.html