From:             o dot veujoz at free dot fr
Operating system: Windows XP
PHP version:      5.1.5
PHP Bug Type:     PCRE related
Bug description:  RegExp cause server crash

Description:
------------
Since php 5.1.5 & 5.1.6 the following piece of code cause a server crash,
either on IIS 5.1 / Apache 2.0.59 (under windows XP, not tried on other
platform).

The regexp is from Pear::Wiki_Text library and was working with older PHP
versions (including 5.1.4).

Under IIS, I've got the message : "PHP has encountered a Stack overflow"

No message with Apache...

I read a lot of things on this error (such as bad regexp writing), but
this time it is not a specific IIS case.

Removing the PCRE_DOTALL regexp option and the script works (but the
result is not what expected...).

I read the bug #28317 and was wondering if it wasn't the same compilation
problem ("Thus NO_RECURSE should be set in win32 compiler options").

Best regards,
Olivier (from France, sorry for the spelling faults)

Reproduce code:
---------------
<?php
// Uncomment one line and it works again ??
$text  = '<code type="php">
include_once("adodb/session/adodb-session2.php");
ADOdb_Session::config($driver=\'mysql\', $host, $user, $password,
$database,$options=false);
ADOdb_Session::config($driver=\'mysql\', $host, $user, $password,
$database,$options=false);
ADOdb_Session::config($driver=\'mysql\', $host, $user, $password,
$database,$options=false);
ADOdb_Session::config($driver=\'mysql\', $host, $user, $password,
$database,$options=false);
ADOdb_Session::config($driver=\'mysql\', $host, $user, $password,
$database,$options=false);
ADOdb_Session::config($driver=\'mysql\', $host, $user, $password,
$database,$options=false);
ADOdb_Session::config($driver=\'mysql\', $host, $user, $password,
$database,$options=false);
session_start();
</code>';

$regex = ';^<code(\s[^>]*)?>((?:(?R)|.)*?)\n</code>(\s|$);msi';

preg_match_all($regex, $text, $match);

print '<xmp>';
print_r($match);
print '</xmp>';
?>


-- 
Edit bug report at http://bugs.php.net/?id=38594&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=38594&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=38594&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=38594&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=38594&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=38594&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=38594&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=38594&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=38594&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=38594&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=38594&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=38594&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=38594&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=38594&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=38594&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=38594&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=38594&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=38594&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=38594&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=38594&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=38594&r=mysqlcfg

Reply via email to