-
Notifications
You must be signed in to change notification settings - Fork 729
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
JDK11 OpenJ9 Gives Non-deterministic Results #17033
Comments
@connglli, I haven't been able to reproduce the failure. I'll keep trying, but in case I am unable, may I ask you to try producing a log file with the following command invocation? ./OpenJ9/jdk11/bin/java '-Xjit:{T.foo(ZI)V}(optlevel=hot,traceFull,log=issue17033.log)' T |
|
@connglli, thank you for uploading the log file. May I ask you to try reproducing the failure with this invocation? You can try it with a variety of optLevel settings, if you have the opportunity.
|
I took the latest build and I'm able to reproduce it often, although I couldn't with 11.0.18. I can reproduce it with |
I destroyed my shared cache for jdk-11.0.18, and on the 9th run the problem started to occur. |
@hzongaro See the following logs. Hope they can help! For optlevel=hot: see issue17033.hot.2223504.66143.20230329.130223.2223504.log
For optlevel=veryhot: see issue17033.veryhot.2223590.66155.20230329.130235.2223590.log
For optlevel=scorching: see issue17033.scorching.2223674.66166.20230329.130246.2223674.log
|
Thanks, Peter @pshipton . I was eventually able to reproduce the failure. I've found that once the failure occurs, I can reproduce it with
That appears to correspond to Store Sinking:
I'll continue to investigate |
Hi Henry @hzongaro, could you please explain the |
Hi, @connglli. The You can read more about it in the Problem Determination guide. It's not something that should be relied upon outside of the context of investigating failures. |
Looking at the transformations that are happening in Store Sinking, beforehand we see this in the IL:
That corresponds to this assignment at the start of
After Store Sinking, we see this - the
|
Digging into things a bit more, the problem lies with the way Store Sinking has propagated the Blocks 169 and 170 are predecessors of the loop that appears in the method. The problem is that the stores that have been propagated to those later blocks look like this:
That is, they multiply by itself the value of |
@hzongaro : should this still be targeted to 0.40? Please advise. |
@0xdaryl, I haven't been able to spend time on it. Although Peter mentioned above that he wasn't able to reproduce the failure with 11.0.18, I don't see any changes in Store Sinking that would indicate that this is a recent regression. I think it's safe to defer it beyond 0.40. |
Thanks. Moving to 0.41 (I mis-spoke about the release in my earlier comment). |
No further progress - moving to the 0.43 release. |
Following is a slightly modified version of the test case with which I can more reliably reproduce the failure:
Before general store sinking:
After general store sinking:
I think what's happening is that general store sinking doesn't take into account the possibility that a store to a local might occur between the point at which a commoned load first appears and the candidate for store sinking where the commoned load is actually used. In this example, After store sinking, |
I have a fix in progress for this that I hope to complete for the 0.44 release. |
I haven't managed to progress my prototype fix for this problem, but I'd like to try to get this fixed. Moving it to the 0.48 release. |
I'm going to push this out to the "Future" release for now, but I have marked it as high priority, as I have a fix that I have prototyped. |
Java version
Javac version
Code and summary of the problem
The following test makes OpenJ9 (with above version) generate different result every time you run it.
Results of OpenJ9: every time you run it, OpenJ9 gives a different result
The correct answer is 0:
Diagnosis
I have reported a similar bug in #15306, but I reported this bug in a new thread because (1) this one looks different from 15306, (2) 15306 is marked as fixed, and (3) this one is generated in a very recent development trunk.
I have tried a little bit, and noticed that the non-determinisn starts from
optlevel=hot
with methodT.foo()
. See belowThe text was updated successfully, but these errors were encountered: