Page MenuHomePhabricator

Abysmal parser performance with certain kind of recursive input
Closed, ResolvedPublic

Description

Recent commits surfaced abysmal parser performance bug with certain kind of input. Basically it is a template, which uses {{int}} to fetch few messages, which call the template again. This seems to avoid all depth and size related checks that should prevent this kind of thing happening.

Will commit a minimal parser test that demonstrates the problem.


Version: 1.20.x
Severity: normal

Details

Reference
bz31098

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:48 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz31098.

Parser test committed in r97821.

Performance bug? That looks like an *infinite* loop. Even worse, I suspect it may be possible to also trigger it from some extensions.
The easy way to fix this is to add a static variable to top reenterin intfunction, but it may not be generic enough.

Fixed in r101291.
You may want to add some tests for templates inside int messages. Doesn't seem to be tested right now (other than the ad-hoc tests I did to verify I fixed it right, of course).

This bug has been present since 1.14 (1.13 used wfMsgReal instead and is not affected). Good work.

It was introduced in r39412

Change 903331 had a related patch set uploaded (by DDesouza; author: DDesouza):

[design/blog@master] layout: use figure include in post header

https://gerrit.wikimedia.org/r/903331

Change 903331 abandoned by DDesouza:

[design/blog@master] layout: use figure include in post header

Reason:

cause a side effect on index.html, tricky to solve, unjustified complexity

https://gerrit.wikimedia.org/r/903331

Change 903335 had a related patch set uploaded (by DDesouza; author: DDesouza):

[design/blog@master] layout: add caption to post header image

https://gerrit.wikimedia.org/r/903335

Change 903331 restored by DDesouza:

[design/blog@master] layout: use figure include in post header

https://gerrit.wikimedia.org/r/903331