Bug Hunting Session
Bug 93532 - Image / CRC32 not enough ...
Summary: Image / CRC32 not enough ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
5.0.0.0.beta1
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.1.0 target:5.0.2
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-19 12:46 UTC by Michael Meeks
Modified: 2016-09-16 04:03 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2015-08-19 12:46:03 UTC
CRC32 is a great hash to check for large-scale data-corruption, but not to ensure uniqueness - and LibreOffice builds a fair bit of its image comparison foo on the idea that it is unique.

A crc32 hash is prone to collisions (due to its small size, any 32-bit hash couldn't be better): it has 1/2 odds to loose an image for ~77000 comparisons: http://preshing.com/20110504/hash-collision-probabilities (so, quite a real number of real documents are expected to suffer).

We should use CRC64, or better - though the exact algorithm is fairly immaterial - but having more precision would help, while keeping this a single integer type rather than a more complex wrapper task.

Marco is looking into this.
Comment 1 Michael Meeks 2015-08-20 10:01:51 UTC
If hashes collide - you loose (one of) your images =)
Comment 2 Commit Notification 2015-09-01 15:20:38 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=07254e701fe8cbb7babbfaaf1f096b1afbd5eaf2

tdf#93532 -  Bitmap CRC unit tests.

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2015-09-02 07:22:59 UTC
Marco Cecchetti committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f85ed94f46e9f1b15cb42d66380e666ce7ee71ee&h=libreoffice-5-0

tdf#93532 - Switching to 64-bit checksum

It will be available in 5.0.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2015-09-02 09:15:19 UTC
Michael Meeks committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=072f5090e57ddbc2954efafa38b57056a5e52abb&h=libreoffice-5-0

tdf#93532 -  Bitmap CRC unit tests.

It will be available in 5.0.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 5 Xisco Faulí 2016-09-15 22:14:16 UTC
Hello,
Is this bug fixed?
If so, could you please close it as RESOLVED FIXED?
Comment 6 Michael Meeks 2016-09-16 04:03:56 UTC
Yes; a 64bit CRC is now implemented everywhere.