|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26171 using /(a)+/ to match a long string makes php crash
Submitted: 2003-11-07 22:53 UTC Modified: 2003-11-17 18:24 UTC
From: xuefer at 21cn dot com Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 4.3.4 OS: winxp
Private report: No CVE-ID: None
 [2003-11-07 22:53 UTC] xuefer at 21cn dot com
if just crash

Reproduce code:
preg_match('/(aa)+/', str_repeat('a', 1000));


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-08 12:50 UTC]
Please try using this CVS snapshot:
For Windows:

Works fine here with PHP4 & PHP5.
 [2003-11-08 13:20 UTC] xuefer at 21cn dot com
[Sun Nov 09 02:20:30 2003] [notice] Parent: child process exited with status 128 -- Restarting.
still crashing

but what system did u pass the test?
 [2003-11-10 20:14 UTC]
Do you have memory limit enabled?
 [2003-11-10 21:31 UTC] xuefer at 21cn dot com
; Resource Limits ;

max_execution_time = 30     ; Maximum execution time of each script, in seconds
max_input_time = 60	; Maximum amount of time each script may spend parsing request data
memory_limit = 8M      ; Maximum amount of memory a script may consume (8MB)
 [2003-11-12 13:05 UTC]
Try raising the memory limit to 20-30 megs.
 [2003-11-12 21:08 UTC] xuefer at 21cn dot com
sorry, but no use
still crash without winxp crashing notice
it just shown error in apache log so i get nothing in drwtsn32.exe
 [2003-11-17 18:24 UTC]
It's a PCRE limitation. Please try searching the bug db before submitting the 100th report about same issue..

PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC