php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60419 PCRE segfault
Submitted: 2011-11-30 16:23 UTC Modified: 2011-11-30 16:28 UTC
From: mikemc-phpbug at terabytemedia dot com Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 5.3.8 OS: linux
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: mikemc-phpbug at terabytemedia dot com
New email:
PHP Version: OS:

 

 [2011-11-30 16:23 UTC] mikemc-phpbug at terabytemedia dot com
Description:
------------
Tested this on my custom built 5.3.8 and the standard 5.3.8 that ships with FC 15 - same result in both so I assume it is not specific to my build.  Run the test code - it will segfault.  Not sure if this is PHP related (PHP hooks into PCRE) or solely lives inside PCRE.

Test script:
---------------
<?php

$input = "
................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. ................................................................................................................................................................................................. .................................................................................................................................................................................................
";
echo preg_replace('/(\.\s?){3,}/', '...', $input);

Expected result:
----------------
Not to dump core

Actual result:
--------------
Dumped core

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-30 16:27 UTC] mikemc-phpbug at terabytemedia dot com
Removing the "\s?" from the pattern alleviates the issue (no crashing), but of course, then the pattern does not serve a purpose for me.
 [2011-11-30 16:28 UTC] felipe@php.net
-Status: Open +Status: Bogus
 [2011-11-30 16:28 UTC] felipe@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Not a PHP bug. Check out other already PCRE related bugs or the PCRE documentation. I.e. it's a known behavior from PCRE lib.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 16:01:29 2024 UTC