92 Star 502 Fork 187

GVPopenEuler / bishengjdk-8

 / 详情

优化循环可能会导致错误的输出

Confirmed
Bug
Opened this issue  
2022-07-19 22:47

环境信息

我们发现了一个有执行问题的测试用例。为了便于分析,我们简化了测试用例,简化的类文件可以在附件中找到。

Windows 10:

Microsoft Windows 10 Professional
10.0.19044 Build 19044
AMD Ryzen 5 5600G with Radeon Graphics 3.90 GHz
Memory 32 GB

为了方便进行测试,我们在Win10中创建了一个虚拟机,用来运行Ubuntu 16.04。

下面是我们在虚拟机中使用 Java -version 的输出

openjdk version "1.8.0_322"
OpenJDK Runtime Environment BiSheng (build 1.8.0_322-b06)
OpenJDK 64-Bit Server VM BiSheng (build 25.322-b06, mixed mode)
openjdk version "11.0.14" 2022-01-18
OpenJDK Runtime Environment BiSheng (build 11.0.14+9)
OpenJDK 64-Bit Server VM BiSheng (build 11.0.14+9, mixed mode)

程序总结

当我们尝试使用bishengjdk来执行测试用例时,我们可能会得到不正确的输出。在测试用例中,我们在循环中计算checksum,但是优化循环可能会导致我们得到错误的输出。测试用例执行结果不是固定的。

此外,我们尝试在执行时设置-Xint标志,可以获得正确的输出,所以我们认为这个问题可能与JIT优化有关。

附件

https://ningmo.oss-cn-beijing.aliyuncs.com/img/testCase14.zip

Comments (2)

ningmo created缺陷

Hi travor, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Compiler, and any of the maintainers: @Noah , @eastb233 , @kuen , @HsError , @Peilin Guo , @Ryan Peng , @guoge , @cf-zhao

openeuler-ci-bot added
 
sig/Compiler
label

感谢。
同样的class文件(篡改后),解释器和C2执行结果不一致,C2存在问题的可能性是有的,毕昇JDK开发者需要进一步分析研讨,也欢迎毕昇JDK社区开发者基于issue提供的信息进行分析解决;

kuen changed issue state from 待办的 to 已确认

Sign in to comment

Status
Assignees
Projects
Milestones
Pull Requests
Successfully merging a pull request will close this issue.
Branches
Planed to start   -   Planed to end
-
Top level
Priority
Duration (hours)
参与者(3)
5329419 openeuler ci bot 1632792936 8099221 kuenking111 1666658674
Java
1
https://gitee.com/openeuler/bishengjdk-8.git
git@gitee.com:openeuler/bishengjdk-8.git
openeuler
bishengjdk-8
bishengjdk-8

Search