Page MenuHomePhabricator

PHP version of DiffHistoryBlob::patch() computes incorrect base text checksum
Closed, ResolvedPublic

Description

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.


Version: 1.19
Severity: normal

Details

Reference
bz34428

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:16 AM
bzimport set Reference to bz34428.
bzimport added a subscriber: Unknown Object (MLST).

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.