Error in PluginMatcher.php causing memory leakage and thus the fatal error: Allowed memory size of X bytes exhausted (tried to allocate X bytes).
- Status
- Closed
- Subject
- Error in PluginMatcher.php causing memory leakage and thus the fatal error: Allowed memory size of X bytes exhausted (tried to allocate X bytes).
- Version
- 6.x
- Category
- Error
- Feature
- Wiki Plugin (extends basic syntax)
- Submitted by
- edwinbennink
- Lastmod by
- edwinbennink
- Rating
- Description
I discovered an error in the PluginMatcher.php, which parses text of a wikipage and searches for opening and closing tags. Saving a file with these tags often gave the known error:
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 77 bytes) in /usr/local/httpd/htdocs/tiki-6.2/lib/core/WikiParser/PluginMatcher.php on line 69
Looking at the size of the wiki-page (which was quite small), the problem was not in the memory_limit size in php.ini, which was set to 64MB.
Closing tags could not always be found (when it contained a nested tag), such that a cascade occurred (due to the recursive function call), resulting in an enormous amount of memory-use.
- Solution
Remove the "+ 1" in line 106 in the file <tikiwikiroot>/lib/core/WikiParser/PluginMatcher.php:
Replace in line 106:
$lookupStart = $candidate + 1;
With:
$lookupStart = $candidate;- Importance
- 9 high
- Priority
- 45
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 3831
- Created
- Monday 21 March, 2011 16:57:54 UTC
by edwinbennink - LastModif
- Wednesday 25 January, 2012 17:16:23 UTC