JDK-8257803 : Add -Xbatch to compiler/blackhole tests
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 16
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-12-06
  • Updated: 2021-01-13
  • Resolved: 2020-12-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16 b28Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
Samples:

compiler/blackhole/BlackholeStaticTest.java#c2-no-coops
Linux-x64-debug

java.lang.IllegalStateException: Should not have been entered: bh_s_boolean_0
	at compiler.blackhole.BlackholeTarget.shouldNotBeEntered(BlackholeTarget.java:51)
	at compiler.blackhole.BlackholeStaticTest.runTries(BlackholeStaticTest.java:118)
	at compiler.blackhole.BlackholeStaticTest.main(BlackholeStaticTest.java:79)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:831)

---

compiler/blackhole/BlackholeInstanceTest.java#c2-no-coops
Linux-aarch64-debug

java.lang.IllegalStateException: Should not have been entered: bh_i_boolean_0
	at compiler.blackhole.BlackholeTarget.shouldNotBeEntered(BlackholeTarget.java:51)
	at compiler.blackhole.BlackholeInstanceTest.runTries(BlackholeInstanceTest.java:118)
	at compiler.blackhole.BlackholeInstanceTest.main(BlackholeInstanceTest.java:79)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:831)

---

Other failure variants:

java.lang.IllegalStateException: Should not have been entered: bh_i_Object_0
	at compiler.blackhole.BlackholeTarget.shouldNotBeEntered(BlackholeTarget.java:51)
	at compiler.blackhole.BlackholeInstanceTest.runTries(BlackholeInstanceTest.java:118)
	at compiler.blackhole.BlackholeInstanceTest.main(BlackholeInstanceTest.java:87)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:831)

java.lang.IllegalStateException: Should not have been entered: bh_i_long_2
	at compiler.blackhole.BlackholeTarget.shouldNotBeEntered(BlackholeTarget.java:51)
	at compiler.blackhole.BlackholeInstanceTest.runTries(BlackholeInstanceTest.java:118)
	at compiler.blackhole.BlackholeInstanceTest.main(BlackholeInstanceTest.java:105)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:831)


Failures seen on Windows. macOS and Linux.
Comments
Changeset: 05dac03f Author: Aleksey Shipilev <shade@openjdk.org> Date: 2020-12-07 06:43:34 +0000 URL: https://git.openjdk.java.net/jdk/commit/05dac03f
07-12-2020

I should wake up in about 7 hours from now, and if everything is good (testing, reviews, etc), I'll be ready to integrate then.
06-12-2020

Sounds good.
06-12-2020

PR posted.
06-12-2020

Okay, I passed a few rounds of hotspot:tier1 with JDK-8257805 and addition of -Xbatch. I will co-opt this bug report to add -Xbatch, and if that does not help, we can open another bug, ok?
06-12-2020

Nevermind, they sometimes fail for me when run with other tests in parallel, e.g. with JDK-8257805. This seems to be a compilation timing issue, probably just -Xbatch is missing. I am testing this patch: https://github.com/openjdk/jdk/compare/master...shipilev:JDK-8257803-bh-batch
06-12-2020

[~shade] jtr file attached. Test configurations are: -XX:+CreateCoredumpOnCrash -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:+TieredCompilation -XX:+CreateCoredumpOnCrash -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:-TieredCompilation
06-12-2020

Could you please attach a sample .jtr failure? All my {x86_32, x86_64, aarch64} hosts are currently passing these tests.
06-12-2020