[wp-trac] [WordPress Trac] #16892: make_clickable segfault

WordPress Trac wp-trac at lists.automattic.com
Sat Mar 19 17:37:40 UTC 2011


#16892: make_clickable segfault
-----------------------------------------+------------------------------
 Reporter:  westi                        |       Owner:
     Type:  defect (bug)                 |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Formatting                   |     Version:  3.1
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch reporter-feedback  |
-----------------------------------------+------------------------------

Comment (by hakre):

 I found out that you can prevent PHP from segfaulting by reducing the
 PCRE's recursion limit, e.g. `ini_set('pcre.recursion_limit', 1000);`
 (default is 100 000, for me the highest non-crashing is 20 903 with the
 patch applied and an URL repetition count of 2 091). This will prevent PHP
 from segfaulting and `make make_clickable()` return an empty string.

 > PCRE's recursion limit. Please note that if you set this value to a high
 number you may consume all the available process stack and eventually
 crash PHP (due to reaching the stack size limit imposed by the Operating
 System).
 from: [http://php.net/manual/en/pcre.configuration.php PCRE Configuration
 Options]

 The provided patch just reduces the limit to 10 000 (a tenth of the
 default value), executes the regex. If it fails, it falls back to the
 original string, on success will take over the one with the replacements.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16892#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list