Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compressVerify fails on ARM #713

Closed
mbakke opened this issue May 9, 2020 · 6 comments
Closed

compressVerify fails on ARM #713

mbakke opened this issue May 9, 2020 · 6 comments
Assignees

Comments

@mbakke
Copy link

mbakke commented May 9, 2020

compressVerify from testHuf.cpp fails on ARMv7 and AAarch64:

verifying compressed checksum hash = 2013380646
IlmImfTest: /tmp/guix-build-openexr-2.5.0.drv-0/openexr-2.5.0-checkout/OpenEXR/IlmImfTest/testHuf.cpp:213: void {anonymous}::compressVerify(const short unsigned int*, int, unsigned int): Assertion `compressedHash == dekHash' failed.
@peterhillman peterhillman self-assigned this May 10, 2020
@peterhillman
Copy link
Contributor

@arkellr do you have an opinion on this
PR #717 has a proposed fix. The issue appears to be that on the ARM, 8 bit signed values are not sign-extended when converting to 32 bit unsigned, but on x86 that does happen. The change should force all architectures to work the same way as the ARM, which might have been what is intended. The precomputed checksums have been updated to the new values.
It might also be possible to update the code so the ARM works the same way as the x86, but I don't know the best approach.

None of this effects the core operation of the library itself: the data was being compressed identically, it's only the test itself that was erroneously reporting an issue

@arkellr
Copy link
Contributor

arkellr commented May 10, 2020 via email

@arkellr
Copy link
Contributor

arkellr commented May 10, 2020 via email

@peterhillman
Copy link
Contributor

I've updated the PR as suggested. It's slightly messier because it needs to go through the user-defined conversion operator() from Array to const char* first.

@arkellr
Copy link
Contributor

arkellr commented May 10, 2020 via email

@peterhillman
Copy link
Contributor

It would be good to have a CI test for ARM, though it took my raspberry pi more than five hours to run the full IlmImfTest, so it might not be possible to do that very often.

OpenEXR is built for a lot of different processors and OSes, more than could be supported by a single CI. Perhaps folks who regularly build for more unusual systems do frequent build and tests of the master branch between releases. Flagging up any issues caused by the latest commits would mean they could be addressed before the next release.

cary-ilm pushed a commit to cary-ilm/openexr that referenced this issue May 11, 2020
…um (AcademySoftwareFoundation#717)

* cast to unsigned in testHuf checksum to avoid architectures sign extending differently

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
cary-ilm pushed a commit that referenced this issue May 11, 2020
* cast to unsigned in testHuf checksum to avoid architectures sign extending differently

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
smartin-13 pushed a commit to smartin-13/openexr that referenced this issue Jul 23, 2020
…um (AcademySoftwareFoundation#717)

* cast to unsigned in testHuf checksum to avoid architectures sign extending differently

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: smartin-13 <61707536+smartin-13@users.noreply.github.com>
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

No branches or pull requests

3 participants