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

Non-deterministic behavior of SimpleGrayscaleImage.blur() due to JIT in OpenJDK 14.0.1 #4

Open
TheSentry opened this issue May 4, 2020 · 0 comments

Comments

@TheSentry
Copy link

Today we found out that there seems to be a bug in the JIT implementation of OpenJDK 14.0.1 that makes the behavior of at least one method - SimpleGrayscaleImage.blur() - non-deterministic.

You can test and verify this by running the JUnit tests of this project with using OpenJDK 14.0.1 and the following tests "flicker", i.e. sometimes pass, but often don't pass. If you run all tests in RadialHashAlgorithmTest, then testHashEarth2 and testHashSerialization will flicker. If you run each of those test methods isolated by itself, it will succeed.

Also, the hash is not stable:

Exp :a3ff195b0048ac9be693c3a394a1bcb7ab9bb5b4baababa8c0a4b19daa9eb2a7aba2aea7af97ada3
Run1:a5ff1c5b0049ae9de895c5a596a3bdb8ad9db8b6bcadaea9c2a6b39faca0b4a9ada3b0a9b199afa5
Run5:a5fe1b5b0049ae9de895c5a596a3bdb8ad9db8b6bcadaea9c2a6b39eaca0b4a9ada3b0a9b199afa5

Both tests will pass consistently if the following VM parameters are passed when testing:

-XX:CompileCommand=exclude,com/pragone/jphash/image/SimpleGrayscaleImage,blur

Alternatively, you can use OpenJDK 13.

(Other JUnit tests fail, too, but they also fail with OpenJDK 13, so that is probably not related to JIT.)

We'll probably submit a bug report to OpenJDK soon.

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

1 participant