php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39607 preg_match_all Segmentation fault
Submitted: 2006-11-23 14:21 UTC Modified: 2006-11-24 14:19 UTC
From: dimanjy23 at mail dot ru Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 5.2.0 OS: Linux Fedora Core 5
Private report: No CVE-ID: None
 [2006-11-23 14:21 UTC] dimanjy23 at mail dot ru
Description:
------------
I installed the latest snapshot of PHP 5.2.0-dev compilen 2006-11-22.
Sometimes (not always) preg_match_all couses the "Segmentation fault" error while processing some content.

Reproduce code:
---------------
<?php
echo "Start\n";

// preg_match_all crashes on this file
$content = file_get_contents("http://makl.ru/content.txt");

// Regexp
$pattern="/<form[^<>]*>((.(?!\/form>))+)<\/form>/si";

$res = array();
preg_match_all($pattern,$content,$res);

echo "\n\nDone!";
var_dump($res);

?>

Expected result:
----------------
Expecting the part of text from content.txt between
<form> ... </form> tags.

Actual result:
--------------
Start
Segmentation fault


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-24 09:01 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.

Cannot reproduce.
 [2006-11-24 14:19 UTC] nlopess@php.net
Stack overflow problem. Not a bug in PHP (you may limit the recursion limit. please check the manual for more info)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 09:01:31 2024 UTC