php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55035 pcre_exec() deadlock causing Segmentation fault (11)
Submitted: 2011-06-11 15:52 UTC Modified: 2011-06-11 17:10 UTC
From: jimmy dot axenhus at gmail dot com Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 5.3.6 OS: Ubuntu 11.04 and Trisquel 4.5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jimmy dot axenhus at gmail dot com
New email:
PHP Version: OS:

 

 [2011-06-11 15:52 UTC] jimmy dot axenhus at gmail dot com
Description:
------------
It appears that PHP can deadlock in pcre_exec(), repeatingly calling a function(itself?).

Was converting a vBulletin forum to phpBB, therefore might be hard to reproduce. Despite that I managed to reproduce it on three different computers.

I spent several hours debugging this, and will dig deeper into the code that caused this problem to find the specific string causing this. Expect more debug data soon.

Test script:
---------------
phpBB 3.0.8, converting from vBulletin 3.8.x, with code attached to http://www.phpbb.com/community/viewtopic.php?f=65&t=1722325#p10391895
You also need a database to convert.

Expected result:
----------------
Normal phpBB progress when converting (php deliving an HTML page)

Actual result:
--------------
PHP delivered a blank php script file to the browser and apache logged a segfault (11). After a very long session trying to debug this I finally managed to generate a stacktrace with gdb. The resource below will be accessible as long as this bug is unresolved.
http://jimmy.axenhus.com/gdb.txt

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-06-11 16:52 UTC] felipe@php.net
-Status: Open +Status: Bogus
 [2011-06-11 16:52 UTC] felipe@php.net
Try setting a bigger pcre.backtrack_limit and pcre.recursion_limit.

See http://docs.php.net/manual/en/pcre.configuration.php
 [2011-06-11 17:10 UTC] jimmy dot axenhus at gmail dot com
That does not solve the problem, still get a segfault :(
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 15:01:34 2025 UTC