JDK-8221482 : Initialize VMRegImpl::regName[] earlier to prevent assert during PrintStubCode
Type:Bug
Component:hotspot
Sub-Component:compiler
Affected Version:11,12,13
Priority:P4
Status:Resolved
Resolution:Fixed
OS:generic
CPU:generic
Submitted:2019-03-26
Updated:2020-05-18
Resolved:2019-04-03
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.
With -XX:+PrintStubCode, SharedRuntime::generate_stubs() fails with an assert deep down in VMRegImpl::print_on().
Reason: some stubs have oop maps attached. Printing them requires the regName[] array to be initialized.
Comments
jdk11 backport request
I would like to have the patch in OpenJDK11 as well, because the issue is present there too. The patch applies cleanly.
15-05-2020
Sorry, there is no standalone test case. The failure would be perfectly reproducible with a new enhancement I have under development. You just would have to specify -XX:+PrintStubCode. Here is the call stack:
Stack: [0x000003ff7d900000,0x000003ff7da00000], sp=0x000003ff7d9fe200, free space=1016k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x155fafa] VMRegImpl::print_on(outputStream*) const+0xaa
V [libjvm.so+0x111f2c6] ImmutableOopMapSet::print_on(outputStream*) const+0x24e
V [libjvm.so+0x6e78f8] RuntimeBlob::trace_new_stub(RuntimeBlob*, char const*, char const*)+0x210
V [libjvm.so+0x6e9cec] RuntimeStub::new_runtime_stub(char const*, CodeBuffer*, int, int, OopMapSet*, bool)+0x144
V [libjvm.so+0x130a5d0] SharedRuntime::generate_resolve_blob(unsigned char*, char const*)+0x680
V [libjvm.so+0x12e9144] SharedRuntime::generate_stubs()+0x2c
V [libjvm.so+0xb96fb0] init_globals()+0xe0
V [libjvm.so+0x144c21e] Threads::create_vm(JavaVMInitArgs*, bool*)+0x316
V [libjvm.so+0xd11098] JNI_CreateJavaVM+0x98
C [libjli.so+0x4c3e] JavaMain+0x96
The detail triggering the assert failure is that I added printing the oop maps associated with a stub, if any. As generating the stubs appears early during initialisation, the regName array wasn't initialised yet.
29-03-2019
Job: mach5-one-lucy-JDK-8221482-20190329-1139-1529295
BuildId: 2019-03-29-1137065.lutz.schmidt.source
No failed tests
29-03-2019
Hi [~lucy], Please add failure reproducible test case if any. Thanks.