php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37978 Php makes Apache crash with preg_match
Submitted: 2006-06-30 22:14 UTC Modified: 2006-07-08 01:00 UTC
Votes:6
Avg. Score:4.5 ± 0.8
Reproduced:6 of 6 (100.0%)
Same Version:1 (16.7%)
Same OS:4 (66.7%)
From: benoit dot beraud at gmail dot com Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 5CVS-2006-06-30 (snap) OS: Win XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: benoit dot beraud at gmail dot com
New email:
PHP Version: OS:

 

 [2006-06-30 22:14 UTC] benoit dot beraud at gmail dot com
Description:
------------
When executing the reproduce code, the function preg_match makes APache restart with the 'traditionnal' error ("[notice] Parent: child process exited with status 3221225477 -- Restarting.")

The script makes Apache crash with php 5.1.4 and the snapshot of php 5.2.0-2006-06-30. together with apache 2.0.58

Everything is ok with php 4.3.10 with apache 1.3.33

I've seen some corresponding bug in the DB but they do not seem to apply, as in my case it was working in previous version of php (and probably PECR) and now it does not work. Strange ...

I don't have any idea if it really comes from php or if it's an issue of the PECR library or of apache 2.

I would have been happy to provide a bugtrace but my knowledge of php compilation is still to limited to do it.

Thanks in advance for your help.

Reproduce code:
---------------
// 'Well-formed UTF-8'
$goodUtf8 =  '^([\x00-\x7f]|[\xc2-\xdf][\x80-\xbf]|\xe0[\xa0-\xbf][\x80-\xbf]|[\xe1-\xec][\x80-\xbf]{2}|\xed[\x80-\x9f][\x80-\xbf]|[\xee-\xef][\x80-\xbf]{2}|f0[\x90-\xbf][\x80-\xbf]{2}|[\xf1-\xf3][\x80-\xbf]{3}|\xf4[\x80-\x8f][\x80-\xbf]{2})*$';
// ISO-10646 'UCS'
$ucsUtf8 = '^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3}|[\xf8-\xfb][\x80-\xbf]{4}|[\xfc-\xfd][\x80-\xbf]{5})*$';
$inStr = "Complex models, such as activated sludge model No. 1 (ASM1), have rarely been used in practice for process control or optimization. One major reason for this is the computational effort demanded by these models for both parameter estimation and simulation. Therefore, a linearized version of the ASM1 model is developed and applied to the control and optimization of a bench-scale alternating aerobic/anoxic activated sludge system. The model prediction was used to optimize the aeration time by manipulating tc (total cycle time) and fa (fraction of aeration cycle time) while meeting the permit requirement of the effluent ammonia concentration. The linear nature of the model facilitates its use for on-line calculations, and error feedback is used to counteract problems of model inaccuracy. The model was applied to two cases in which the influent compositions were either known currently or only the previous day\'s information was available. The average optimized fa was found to be 0.30 for the first case and 0.37 for the second case, when the maximum effluent NH4+?N concentration was set at 1 mg/l. The efficiency of nitrogen removal was 76% for both test cases since nitrate could almost completely be removed through adequate anoxic cycle ratios resulting from the fa optimization.";
preg_match("/$goodUtf8|$ucsUtf8/",$inStr);

Expected result:
----------------
The function preg_match should check if the variable inStr is goodUtf or ISO-10646 'UCS'.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-30 22:16 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2006-07-01 00:01 UTC] judas dot iscariote at gmail dot com
not reproducible here in current 5_2 CVS.

php -d display_errors=1 preg.php

Warning: preg_match(): Compilation failed: range out of order in character class at offset 71 in....
 [2006-07-08 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 21:01:36 2024 UTC