|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-01-29 19:47 UTC] johannes@php.net
[2012-01-29 19:47 UTC] johannes@php.net
-Status: Open
+Status: Bogus
[2012-01-29 20:39 UTC] johannes@php.net
[2012-01-29 20:39 UTC] johannes@php.net
-Status: Bogus
+Status: Not a bug
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 16 06:00:02 2025 UTC |
Description: ------------ Using recursive functions for preg_replace_callback that never ends PHP will exit with a SEGFAULT (unexpected signal 11) due to a function stack overflow. It's expected that it should never end and therefore PHP should abort the execution. However PHP should output a helpful error message rather than just aborting it. Depending on your code this could be a major issue to debug. (I was using Drupal and it look me hours to find the source.) Test script: --------------- <?php function a() { b(); } function b() { a(); } preg_replace_callback("/0/s", 'a', "0"); echo "We made it my friend!"; Expected result: ---------------- Some sort of error message that the callback stack limit has been reached. Actual result: -------------- A 500 Internal Server error (Apache with mod_fcgid) and a SEGFAULT in the error log.