JDK-8200290 : Scratch buffer creation fails with "assert(!current_thread_in_native()) failed: must not be in native" on SPARC
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • CPU: sparc
  • Submitted: 2018-03-27
  • Updated: 2018-08-16
  • Resolved: 2018-03-28
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 11
11 b10Fixed
Related Reports
Relates :  
Relates :  
Description
Running java -XX:-TieredCompilation -Xcomp -version on SPARC fails with:

#  Internal Error (/opt/mach5/mesos/work_dir/dad84d60-43ed-43c1-9bcf-edc21fbc9d77/workspace/open/src/hotspot/share/runtime/jniHandles.inline.hpp:54), pid=14314, tid=13
#  assert(!current_thread_in_native()) failed: must not be in native

Current CompileTask:
C2:    338    1    b        java.lang.invoke.MethodHandle::<clinit> (30 bytes)

Stack: [0xffffffff6a400000,0xffffffff6a500000],  sp=0xffffffff6a4fab20,  free space=1002k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1de4ae0]  void VMError::report_and_die(int,const char*,const char*,void*,Thread*,unsigned char*,void*,void*,const char*,int,unsigned long)+0x940
V  [libjvm.so+0x1de412c]  void VMError::report_and_die(Thread*,const char*,int,const char*,const char*,void*)+0x3c
V  [libjvm.so+0xd6d248]  void report_vm_error(const char*,int,const char*,const char*,...)+0x78
V  [libjvm.so+0x1794e24]  AddressLiteral MacroAssembler::constant_oop_address(_jobject*)+0x104
V  [libjvm.so+0x713218]  void loadConP_setNode::emit(CodeBuffer&,PhaseRegAlloc*)const+0x228
V  [libjvm.so+0xcb7ec0]  unsigned Compile::scratch_emit_size(const Node*)+0x350
V  [libjvm.so+0x19d388c]  void Compile::shorten_branches(unsigned*,int&,int&,int&)+0x4dc
V  [libjvm.so+0x19d65a4]  CodeBuffer*Compile::init_buffer(unsigned*)+0x374
V  [libjvm.so+0x19d2d10]  void Compile::Output()+0x7c0
V  [libjvm.so+0xcc4fd0]  void Compile::Code_Gen()+0x560
V  [libjvm.so+0xcb9370]  Compile::Compile #Nvariant 1(ciEnv*,C2Compiler*,ciMethod*,int,bool,bool,bool,DirectiveSet*)+0x1350
V  [libjvm.so+0xa9d684]  void C2Compiler::compile_method(ciEnv*,ciMethod*,int,DirectiveSet*)+0x124
V  [libjvm.so+0xcde138]  void CompileBroker::invoke_compiler_on_method(CompileTask*)+0x708
V  [libjvm.so+0xcdcf0c]  void CompileBroker::compiler_thread_loop()+0x2ec
V  [libjvm.so+0x1cfe1b4]  void JavaThread::thread_main_inner()+0x2e4
V  [libjvm.so+0x1cfdea4]  void JavaThread::run()+0x374
V  [libjvm.so+0x19b7854]  thread_native_entry+0x2e4

Comments
http://cr.openjdk.java.net/~thartmann/8200290/webrev.00/
27-03-2018

This is basically the same problem as JDK-8193699.
27-03-2018

ILW = Assert during scratch buffer creation (regression in JDK 11), on old SPARC machines but easy to reproduce, disable compilation = HMM = P2
27-03-2018