Hi,
I've got a large post(~100kb text) with highly-nested bbcode which is making php-workers near crash. It's actually a horribly encoded post by a user with at least ~17 layers of nesting, which I've instructed them how to avoid.
But I would prefer it couldn't crash the php-fpm worker processes with what appears to be a stack overflow.
I'm using php 5.5 from the IUS repos on CentoOS 6.5
"php -v" output:
On my forum it can be posted, and on a local dev instance (Linux+nginx+php-fpm+mariadb stack, same versions of software as live) I can edit/reply to it with TinyMCE off (but not on!). I had some users report they could reply to it on the actual forums with the addon being active but it failed for me.
Originally I thought it was a problem with a the TinyMCE Quattro addon, but with help from @cclaerhout (here) it looks like an issue with stock Xenforo as well.
Is there any way to narrow down why this is occurring? The only error I can see from the php-fpm logs are;
I've got the post on hand, but haven't had a chance to reduce it down to just the bbcode to see exactly what limits I'm running into.
Editing the DB to remove 17 layers of nested [font=trebuchet ms] around the bulk of the post stopped the issue. The [center] tag appears to reset the font, so the user was just adding a new open font tag after a center, and kept doing that for 17 chunks.
Using xdebug, I can verify that recursion from bbcode parsing is only hitting ~147 functions deep. Which isn't that bad.
I've got a large post(~100kb text) with highly-nested bbcode which is making php-workers near crash. It's actually a horribly encoded post by a user with at least ~17 layers of nesting, which I've instructed them how to avoid.
But I would prefer it couldn't crash the php-fpm worker processes with what appears to be a stack overflow.
I'm using php 5.5 from the IUS repos on CentoOS 6.5
"php -v" output:
Code:
PHP 5.5.14 (cli) (built: Jun 27 2014 12:26:01)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
On my forum it can be posted, and on a local dev instance (Linux+nginx+php-fpm+mariadb stack, same versions of software as live) I can edit/reply to it with TinyMCE off (but not on!). I had some users report they could reply to it on the actual forums with the addon being active but it failed for me.
Originally I thought it was a problem with a the TinyMCE Quattro addon, but with help from @cclaerhout (here) it looks like an issue with stock Xenforo as well.
Is there any way to narrow down why this is occurring? The only error I can see from the php-fpm logs are;
[27-Jul-2014 08:15:39] WARNING: [pool www] child 23811 exited on signal 11 (SIGSEGV) after 5458.336405 seconds from start
[27-Jul-2014 08:15:39] NOTICE: [pool www] child 32674 started
I've got the post on hand, but haven't had a chance to reduce it down to just the bbcode to see exactly what limits I'm running into.
Editing the DB to remove 17 layers of nested [font=trebuchet ms] around the bulk of the post stopped the issue. The [center] tag appears to reset the font, so the user was just adding a new open font tag after a center, and kept doing that for 17 chunks.
Using xdebug, I can verify that recursion from bbcode parsing is only hitting ~147 functions deep. Which isn't that bad.
Last edited: