RFR: 8260301: misc gc/g1/unloading tests fails with "RuntimeException: Method could not be enqueued for compilation at level N"
Vladimir Kozlov
kvn at openjdk.java.net
Tue Feb 2 15:49:11 UTC 2021
On return WB wait to acquire Compile_lock before checking compilation status
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/prims/whitebox.cpp#L988
This lock is used by ciEnv for compiled code publishing:
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/ci/ciEnv.cpp#L981
So while WB waits the lock compiler thread can finish compilation, register nmethod and clear method's queued_for_compilation bit.
The problem is that WB check `nm` value (compiled code) which it got before the lock and when method compilation is not finished.
The fix is to check compiled code again similar to check in CompileBroker:
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/compiler/compileBroker.cpp#L1501
Passed hs-tier1-4 testing and 100 x vmTestbase/gc/g1/unloading/tests/unloading_compilation_*.
-------------
Commit messages:
- 8260301: misc gc/g1/unloading tests fails with "RuntimeException: Method could not be enqueued for compilation at level N"
Changes: https://git.openjdk.java.net/jdk/pull/2356/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2356&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8260301
Stats: 9 lines in 1 file changed: 9 ins; 0 del; 0 mod
Patch: https://git.openjdk.java.net/jdk/pull/2356.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/2356/head:pull/2356
PR: https://git.openjdk.java.net/jdk/pull/2356
More information about the hotspot-dev
mailing list