Last modified: 2012-02-16 23:32:19 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 T36428, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34428 - PHP version of DiffHistoryBlob::patch() computes incorrect base text checksum
PHP version of DiffHistoryBlob::patch() computes incorrect base text checksum
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
History/Diffs (Other open bugs)
1.19
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-16 00:34 UTC by Tim Starling
Modified: 2012-02-16 23:32 UTC (History)
1 user (show)

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


Attachments

Description Tim Starling 2012-02-16 00:34:08 UTC
Some revisions stored with DiffHistoryBlob in Wikimedia external storage cannot be decoded if xdiff_string_bpatch() is not available and thus the PHP port is used. Revision::getText() returns false.

The debug log shows "incorrect base checksum". If the checksum check is disabled, the revision appears to be decoded successfully. Perhaps an incorrect implementation of the adler32 checksum is at fault.
Comment 1 Tim Starling 2012-02-16 11:56:10 UTC
LibXDiff has an incorrect implementation of Adler-32. The byte order is wrong, and the state is initialised to 0 instead of 1. 

If a string can be found for which the Adler-32 hash is zero, then that could be used to initialise mhash() or hash() to simulate LibXDiff's Adler-32.
Comment 2 Tim Starling 2012-02-16 23:32:19 UTC
Fixed in r111701.

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


Navigation
Links