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

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T2932, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 932 - MediaWiki unable to compute page diff
MediaWiki unable to compute page diff
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
History/Diffs (Other open bugs)
unspecified
All All
: Normal major with 3 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/w/wiki.phtml?...
:
Depends on:
Blocks:
  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: ---


Attachments

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 
message:

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
See 

http://en.wikipedia.org/w/index.php?
title=User_talk:172.167.41.108&diff=17682235&oldid=15415533

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 srv5.wikimedia.org
(squid/2.5.STABLE9.wp20050410.S9plus[icpfix,nortt,htcpclr]) 


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.


Navigation
Links