|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-28 07:58 UTC] derick@php.net
[2004-01-29 00:29 UTC] sniper@php.net
[2004-01-29 13:43 UTC] pages at inrp dot fr
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 12:00:01 2025 UTC |
Description: ------------ After running the script bellow, /var/log/httpd/error_log says: [Wed Jan 28 00:19:30 2004] [notice] child pid 13744 exit signal Segmentation fault (11) It has been tested on 3 different system : - Red Hat 8.0 + Apache 2.0.40 + PHP 4.2.2 - Red Hat 9 + Apache 2.0.40 + PHP 4.2.2 - Fedora Core 1 + Apache 2.0.48 + 5.0.0b3 Some statistics : - with pattern "/(a)*/", it crashes with a subject length > 13800 - with pattern "/((a))*/", it crashes with a subject length > 9200 - with pattern "/(((a)))*/", it crashes with a subject length > 6900 - with pattern "/((((a))))*/", it crashes with a subject length > 5600 - with pattern "/(((((a)))))*/", it crashes with a subject length > 4600 - with pattern "/((((((a))))))*/", it crashes with a subject length > 4000 - etc... Reproduce code: --------------- <?php # This script crashes Apache : $subject = str_repeat("a",13800); preg_match("/(a)*/",$subject); echo "OK"; # NB: The length of $subject (here 13800) may depend on # your system. It seems to be related to the memory_limit # directive (mine is 8M) but not in the way that # one would expect (it doesn't seem to be something # like "If I give more memory, then I need a larger # subject to crash Apache"). # It doesn't crash if I use the pattern "/a*/" instead # of "/(a)*/". ?> Expected result: ---------------- No crash Actual result: -------------- Crash :-(