Page MenuHomePhabricator

Diff can cause httpd to hang and peg cpu
Closed, DeclinedPublic

Description

Author: wikimediatester

Description:
This is with mediawiki 1.8.2

If a spammer posts a page revision a with 2000 lines of spam links which are
enclosed in square brackets, then a subsequent 'diff' of that page with the
previous revision can cause mediawiki to hang and cause httpd to peg the CPU.

Repeated occurances of this on a server (even over a period of days) can cause
multiple httpd processes to hang, and can eventually cause total depletion of
the system's swap space.


Version: 1.8.x
Severity: minor
OS: Linux
Platform: Other

Details

Reference
bz7601

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 9:27 PM
bzimport set Reference to bz7601.
bzimport added a subscriber: Unknown Object (MLST).

wikimediatester wrote:

Under FC5 with apache-2.2.2 and php-5.1.4

pez wrote:

This problem quickly gets huge if such a diff is included in the rss feeds. I
had to disable recent changes feeds on my mediawiki site because it immediately
(after a httpd restart) started using up about all apache and system resources.

pez wrote:

Siteowners might be interested in knowing that using the wikidiff2 extension
dodges this bug.

robchur wrote:

This is because the built-in difference engine is rather slow and inefficient
when called multiple times; if wikis are large enough that a large number of
diff requests are anticipated, then the wikidiff2 extension should be installed,
which is a compiled form of the same algorithm, and works a lot faster.

  • Bug 14867 has been marked as a duplicate of this bug. ***

Reducing priority/severity, nobody cares.

It would be nice to have a) a faster default implementation and b) cleaner resource limits so ultra-long diffs can be aborted internally without killing the whole UI or RSS feed generation.

  • Bug 20041 has been marked as a duplicate of this bug. ***
  • Bug 9410 has been marked as a duplicate of this bug. ***

sumanah wrote:

Can anyone reproduce this on MediaWiki 1.17.0 or later? I just played around a bunch with 1.18 via a test wiki https://secure.wikimedia.org/wikipedia/test2/wiki/Why_is_there_an_article%3F and couldn't reproduce the issue. Please reopen if you can reproduce this problem on a recent version of MediaWiki.