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
Scala.Tuple incorrect work after JIT optimization #9828
Comments
Imported From: https://issues.scala-lang.org/browse/SI-9828?orig=1
|
Alexey Tsiunchik (alexey.tsiunchik-at-gmail.com) said: |
@soc said: |
Alexey Tsiunchik (alexey.tsiunchik-at-gmail.com) said: |
@lrytz said: I simplified the example quite a lot and managed to make it independent of the Scala library. I pushed the code on this github repository: https://github.com/lrytz/jit-bug/tree/master. Now we just need to find a way to report that bug to Oracle.. Usually Twitter or StackOverflow work better than trying to go through the contact forms on their website. |
@lrytz said: |
Alexey Tsiunchik (alexey.tsiunchik-at-gmail.com) said (edited on Jun 27, 2016 9:44:17 AM UTC): |
@lrytz said: |
Wile constructing Tuple6 inside lambda I'm observing null value passing into the Tuple instead on not null value. This issue occurs only on "warmed-up" JVM after hot spots compilations, which is resulting in hardly trackable, not always reproducible bugs.
Code snippet which causes issue is below:
The issue is that in resulting Set we may get Tuples with null values on third position, which is not possible since viewingPeriod is enum, where id is always not null value specified in constructor, and not modifiable.
Note: Issue is not reproduced if replace Collection.forEach with old style for expression.
Note: Issue is not reproduced if we replace Tuple with any Java Parametrized collection (Map for example)
Note: Issue is not reproduced if we disable JIT
Note: Issue is reproduced in random manner, and we noticed it is more often reproduced in case computer is running under load caused by some other tasks. We started build process for our project in parallel.
Test project: both sources and executable jar is in attachment.
How issue could be observed:
Just run attached executable jar using java -jar and check output.
At some point it starts showing message like: Start reproducing: Thread at step res: <Tuple content, on which issue was detected>.
Here step - is step in loop on which issue starts reproducing.
Sometimes it is necessary to run application several times (up to 10-20 to get this error), we only notice it appears faster in case computer is working under load.
The text was updated successfully, but these errors were encountered: