#47689 [NEW]: Apache crash with certain regular expression
From: vrana@php.net
Operating system: Windows
PHP version: 5.2.9
PHP Bug Type: PCRE related
Bug description: Apache crash with certain regular expression
Description:
------------
Apache 2.2.11 crashes with PHP 5.2.9-1 on the following code. The same
script run from CLI executes without crash.
Reproduce code:
---------------
<?php
$contents = '/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/';
// shortest possible example, omitting last line causes no crash
$contents = preg_replace('@/\\*(?:.|[\\n\\r])*?\\*/@', '', $contents);
?>
Expected result:
----------------
Empty string in $contents.
Actual result:
--------------
Apache crash.
--
Edit bug report at http://bugs.php.net/?id=47689&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47689&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47689&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47689&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=47689&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47689&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=47689&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=47689&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=47689&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=47689&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=47689&r=support
Expected behavior: http://bugs.php.net/fix.php?id=47689&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=47689&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=47689&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=47689&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47689&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47689&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=47689&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=47689&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=47689&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=47689&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=47689&r=mysqlcfg
Thread (17 messages)
- vrana@php.net
- iliaa@php.net#47689 [Opn->Fbk]: Apache crash with certain regular expression
- vrana@php.net#47689 [Fbk->Opn]: Apache crash with certain regular expression
- felipe@php.net#47689 [Opn]: Apache crash with certain regular expression
- vrana@php.net#47689 [Opn]: Apache crash with certain regular expression
- nlopess@php.net#47689 [Opn->Asn]: crash with certain regular expression
- pajoye@php.net#47689 [Asn->Fbk]: crash with certain regular expression
- vrana@php.net#47689 [Fbk->Opn]: crash with certain regular expression
- pajoye@php.net#47689 [Opn->Fbk]: crash with certain regular expression
- vrana@php.net#47689 [Fbk->Opn]: crash with certain regular expression
- jani@php.net#47689 [Opn->Asn]: crash with certain regular expression
- pajoye@php.net#47689 [Asn]: crash with certain regular expression
- peter dot swietoslawski at me dot com#47689 [Com]: crash with certain regular expression
- pajoye@php.net#47689 [Asn->Bgs]: crash with certain regular expression
- ferenczy at volny dot czBug #47689 [Com]: crash with certain regular expression
- pajoye@php.netBug #47689 [Bgs]: crash with certain regular expression
- djokodonev at gmail dot comBug #47689 [Com]: crash with certain regular expression