[lworld] RFR: 8276538: [lworld] [AArch64] LIR_Assembler::emit_profile_inline_type temporary register conflict

Nick Gasson ngasson at openjdk.java.net
Fri Nov 5 05:20:22 UTC 2021


On Thu, 4 Nov 2021 16:04:33 GMT, Frederic Parain <fparain at openjdk.org> wrote:

>> LIR_Assembler::as_Address() may use rscratch1 as a temporary register
>> for the address offset if it's too large to fit in an immediate, but
>> rscratch1 is also used at the same time to hold the updated MDO value.
>> See the discussion on JDK-8276108.
>
> I've tested this patch with the current patch proposed for JDK-8276108 and got several crashes due to SIGSEGV in ciObjectFactory::create_new_metadata(Metadata*), from both C1 and C2 code.
> 
> For instance, with compiler/valhalla/inlinetypes/TestArrays.java:
> 
> Current CompileTask:
> C1:   8816 1128    b  3       compiler.valhalla.inlinetypes.TestArrays::verify (36 bytes)
> 
> Stack: [0x0000fffbf8380000,0x0000fffbf8580000],  sp=0x0000fffbf857cb20,  free space=2034k
> Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
> V  [libjvm.so+0x921f14]  ciObjectFactory::create_new_metadata(Metadata*)+0x70
> V  [libjvm.so+0x922d08]  ciObjectFactory::get_metadata(Metadata*)+0x1f8
> V  [libjvm.so+0x8f3d10]  ciMethod::ensure_method_data(methodHandle const&)+0x180
> V  [libjvm.so+0x8fb8e0]  ciMethod::ensure_method_data()+0x110
> V  [libjvm.so+0x73ff5c]  GraphBuilder::try_inline_full(ciMethod*, bool, bool, Bytecodes::Code, Instruction*)+0x28c
> V  [libjvm.so+0x7410a8]  GraphBuilder::try_inline(ciMethod*, bool, bool, Bytecodes::Code, Instruction*)+0x194
> V  [libjvm.so+0x741bfc]  GraphBuilder::invoke(Bytecodes::Code)+0xa8c
> V  [libjvm.so+0x742850]  GraphBuilder::iterate_bytecodes_for_block(int)+0x640
> V  [libjvm.so+0x744518]  GraphBuilder::iterate_all_blocks(bool)+0xa8
> V  [libjvm.so+0x740518]  GraphBuilder::try_inline_full(ciMethod*, bool, bool, Bytecodes::Code, Instruction*)+0x848
> V  [libjvm.so+0x7410a8]  GraphBuilder::try_inline(ciMethod*, bool, bool, Bytecodes::Code, Instruction*)+0x194
> V  [libjvm.so+0x741bfc]  GraphBuilder::invoke(Bytecodes::Code)+0xa8c
> V  [libjvm.so+0x742850]  GraphBuilder::iterate_bytecodes_for_block(int)+0x640
> V  [libjvm.so+0x744518]  GraphBuilder::iterate_all_blocks(bool)+0xa8
> V  [libjvm.so+0x740518]  GraphBuilder::try_inline_full(ciMethod*, bool, bool, Bytecodes::Code, Instruction*)+0x848
> V  [libjvm.so+0x7410a8]  GraphBuilder::try_inline(ciMethod*, bool, bool, Bytecodes::Code, Instruction*)+0x194
> V  [libjvm.so+0x741bfc]  GraphBuilder::invoke(Bytecodes::Code)+0xa8c
> V  [libjvm.so+0x742850]  GraphBuilder::iterate_bytecodes_for_block(int)+0x640
> V  [libjvm.so+0x744504]  GraphBuilder::iterate_all_blocks(bool)+0x94
> V  [libjvm.so+0x7456b4]  GraphBuilder::GraphBuilder(Compilation*, IRScope*)+0x504
> V  [libjvm.so+0x7550c0]  IRScope::IRScope(Compilation*, IRScope*, int, ciMethod*, int, bool)+0x3c0
> V  [libjvm.so+0x7552d4]  IR::IR(Compilation*, ciMethod*, int)+0xd0
> V  [libjvm.so+0x71adfc]  Compilation::build_hir() [clone .part.0]+0x22c
> V  [libjvm.so+0x71f574]  Compilation::compile_java_method()+0x1b0
> V  [libjvm.so+0x7203c8]  Compilation::compile_method()+0x1d8
> V  [libjvm.so+0x720da4]  Compilation::Compilation(AbstractCompiler*, ciEnv*, ciMethod*, int, BufferBlob*, bool, DirectiveSet*)+0x324
> V  [libjvm.so+0x722348]  Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x158
> V  [libjvm.so+0xa2b798]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x8b8
> V  [libjvm.so+0xa2c1fc]  CompileBroker::compiler_thread_loop()+0x2dc
> V  [libjvm.so+0x1826384]  JavaThread::thread_main_inner()+0x284
> V  [libjvm.so+0x182c928]  Thread::call_run()+0xf8
> V  [libjvm.so+0x1533394]  thread_native_entry(Thread*)+0x104
> C  [libpthread.so.0+0x7738]  start_thread+0x198
> 
> 
> or with compiler/valhalla/inlinetypes/TestLWorld.java:
> 
> Current CompileTask:
> C2:   9975 1071    b  4       compiler.valhalla.inlinetypes.TestLWorld::test136 (30 bytes)
> 
> Stack: [0x0000fffd15000000,0x0000fffd15200000],  sp=0x0000fffd151fc440,  free space=2033k
> Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
> C  0x00400f61f940f260
> V  [libjvm.so+0x922d08]  ciObjectFactory::get_metadata(Metadata*)+0x1f8
> V  [libjvm.so+0x8f3d10]  ciMethod::ensure_method_data(methodHandle const&)+0x180
> V  [libjvm.so+0x8fb8e0]  ciMethod::ensure_method_data()+0x110
> V  [libjvm.so+0xa1c1f4]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, bool, DirectiveSet*)+0x10d4
> V  [libjvm.so+0x83509c]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1a8
> V  [libjvm.so+0xa2b798]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x8b8
> V  [libjvm.so+0xa2c1fc]  CompileBroker::compiler_thread_loop()+0x2dc
> V  [libjvm.so+0x1826384]  JavaThread::thread_main_inner()+0x284
> V  [libjvm.so+0x182c928]  Thread::call_run()+0xf8
> V  [libjvm.so+0x1533394]  thread_native_entry(Thread*)+0x104
> C  [libpthread.so.0+0x7738]  start_thread+0x198

@fparain how can I reproduce that? I tried:

1. Latest lworld branch + this patch + openjdk/jdk#6212 
2. Your c1_cleanup branch + this patch + openjdk/jdk#6212 

But both are passing all the hotspot_valhalla tests.

-------------

PR: https://git.openjdk.java.net/valhalla/pull/577



More information about the valhalla-dev mailing list