Last modified: 2006-02-02 20:39:58 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 932 - MediaWiki unable to compute page diff
MediaWiki unable to compute page diff
Product: MediaWiki
Classification: Unclassified
History/Diffs (Other open bugs)
All All
: Normal major with 3 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2004-11-23 11:21 UTC by Gdr
Modified: 2006-02-02 20:39 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Gdr 2004-11-23 11:21:16 UTC
See the quoted URL. MediaWiki is unable to compute this diff. When I try to load this page I get the error 

Fatal error [host=]: Maximum execution time of 30 seconds exceeded in /usr/local/apache/common-
local/php-new/includes/DifferenceEngine.php on line 436

On my local machine a "diff" of the corresponding page sources takes 0.03 seconds. This suggests that 
there is a bug in the MediaWiki diff implementation.

The effect of this bug is that it may be impossible to figure out what has changed between two revisions 
of a page. A clever vandal could exploit this bug to cover their tracks.
Comment 1 Brion Vibber 2004-11-23 12:05:14 UTC
Testing this page on my test box at home (Athlon XP 2400+) in MediaWiki 1.4:

Using the new wikidiff module (C++ reimplementation of the diff code), the diff 
takes about 0.5 second (on top of the page rendering overhead), which is slower 
than it could be but not too awful. The PHP version (roughly the same code as in 
1.3) takes a whopping *41.5* seconds if allowed to run to completion.

They don't give exactly the same output, but both are highlighting a huge number 
of changed lines; looking closer, the first revision in that diff has a space at the end 
of nearly every line; in the second it's been removed. Thus some couple of thousand 
lines get individually diff'ed up.
Comment 2 Gdr 2004-11-23 15:09:28 UTC
Perhaps it's not sensible to do this kind of heavy processing in PHP?
Comment 3 Brion Vibber 2004-11-24 00:16:19 UTC
(In reply to comment #2)
> Perhaps it's not sensible to do this kind of heavy processing in PHP?

Hence the C++ plugin version. It's probably possible to make the PHP code 
much more efficient, though.

Note that this is a pathological case: thousands of paragraphs/lines 
changed where typically one gets just a few. Even a longish article like 
[[Zuiderzee Works]] is under two hundred lines, and a massive change 
(removal of all link brackets) on that page diffs in about 0.7 seconds on the 
PHP version on the same box. This particular diff has one order of 
magnitude more lines, but takes two orders of magnitude longer to run.
Comment 4 Brion Vibber 2004-11-26 00:56:08 UTC
Most of the time on this diff is spent in the loop in _DiffEngine::_diag(), 
when it's running over a couple of massive chunks of adjacent lines.
Comment 5 Gdr 2005-01-02 15:19:20 UTC
MediaWiki 1.4 still can't show the diff. However, it now shows how far it got
(about three quarters of the way through the page), before producing the error:

Fatal error: Maximum execution time of 30 seconds exceeded in /usr/local/apache/common-local/php-1.4/
includes/DifferenceEngine.php on line 614
Comment 6 David Benbennick 2005-06-29 17:25:44 UTC

for another failed page diff.  The page shrank by 1.3 MBytes, 
and the diff fails almost immediately with

Fatal error: Allowed memory size of 100000000 bytes exhausted

Presumably diffing a 1MB file shouldn't require 100MB of memory?
Comment 7 Zigger 2005-06-29 19:06:51 UTC
Trying the [[List_of_Royal_Navy_ship_names]] example link gave the page text:

Sorry- we have a problem...
The wikimedia web server didn't return any response to your request.
To get information on what's going on you can visit #wikipedia.
An "offsite" status page is hosted on OpenFacts.
Generated Wed, 29 Jun 2005 18:47:49 GMT by

But trying to view the source of the error page shows this instead:

<br />
<b>Parse error</b>:  parse error, unexpected '=', expecting ')' in
<b>/usr/local/apache/common-local/php-1.5/InitialiseSettings.php</b> on line
<b>54</b><br />
Comment 8 Zigger 2005-06-30 18:04:16 UTC
(In reply to comment #7)
> <b>Parse error</b>:  parse error, unexpected '=', expecting ')' in
> <b>/usr/local/apache/common-local/php-1.5/InitialiseSettings.php</b> on line
> <b>54</b><br />

The parse error has since been reported by Guy M at bug 2617.
Comment 9 Gdr 2005-10-11 16:26:38 UTC
MediaWiki 1.5 can now display the diff! Thank you.

Note You need to log in before you can comment on or make changes to this bug.