Skip to content

Fix Bug 1180: CRC checksum algorithm changed between 18.2.7 and 19.2.5, all volumes fail#412

Merged
arogge merged 3 commits intobareos:masterfrom
arogge:dev/arogge/master/fix-1180
Feb 10, 2020
Merged

Fix Bug 1180: CRC checksum algorithm changed between 18.2.7 and 19.2.5, all volumes fail#412
arogge merged 3 commits intobareos:masterfrom
arogge:dev/arogge/master/fix-1180

Conversation

@arogge
Copy link
Member

@arogge arogge commented Feb 7, 2020

On FreeBSD the new CRC library misdetected endianess. This lead to the big endian variant of the algorighm being used on little endian machines.
While this is still a worthy checksumming algorithm it doesn't lead to the same result as the previous one did.

As this worked its way through automated testing, this PR updates the automated tests for crc32 to catch such an error.
This PR also fixes the underlying problem by adding detection for the endianess on FreeBSD.

Bug bareos#1180: CRC checksum algorithm changed between 18.2.7 and 19.2.5

Previously the crc32 tests did only rudimentary changes, but did not
check with a real bareos block. This patch now adds a dumped label block
from a test-installation and calculates the checksum for that.
This patch also changes the pattern for another test, so it triggers on
an endianess problem too.
Fixes bareos#1180: CRC checksum algorihm changed between 18.2.7 and 19.2.5

Previously crc32.cc did not detect when it couldn't
find out what endianess the machine was. This is now
fixed so that
1. FreeBSD detects endianess correctly
2. the compile fails when there is no __BYTE_ORDER
@franku franku self-requested a review February 7, 2020 19:30
@franku
Copy link
Contributor

franku commented Feb 7, 2020

You may want to move the variables to their scope, this would increase readability. Why malloc and not use a std::array?

@arogge arogge merged commit bc70185 into bareos:master Feb 10, 2020
@arogge arogge deleted the dev/arogge/master/fix-1180 branch August 10, 2020 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants