Bug: Treeview plugin can cause apache to hang
If a twiki user creates a loop of topic parents, the display of tree view outline mode causes apache to hang due to out of memory error.
Reported error in apache log:
[Tue Mar 29 07:17:11 2005] view: Deep recursion on
subroutine "TWiki::Plugins::TreePlugin::ImgNodeFormatter::isNodeLast" at ../lib/TWiki/Plugins/TreePlugin/ImgNodeFormatter.pm line 247., referer: http://twiki.corp.purisma.com/do/search/Howto/?search=CategoryDevEnv&web=Howto&scope=all
Test case
Create three topics:
- CategoryOne has topic parent of CategoryTwo
- CategoryTwo has topic parent of CategoryThree
- CategoryThree has topic parent of CategoryOne
Now the tree view of this is not possible: it is an infinite loop.
The code in Cairo release of
TreePlugin does not detect this case and does an infinite recursion. Using apache+speedycgi, twiki hangs with cpu at 100% until apache is killed.
The specific treeview we used was this:
%TREEVIEW{topic="CategoryTwo" stoplevel="3" formatting="imageoutline:thread"}%
NOTE: once this kind of rendering problem is introduced, twiki 'search' is not usable since it also seems to trigger the bug.
Environment
--
StanleyKnutson - 30 Mar 2005
Impact and Available Solutions
Follow up
Fix record
Discussion