Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8234203

[lworld] Crash with substitutability test and C2

    XMLWordPrintable

Details

    Description

      VM crashes during a call involving a substitutability test.
      The crash doesn't always reproduce, but running the reproducer test a dozen of times is usually enough to get a crash.
      The crash occurs on both Linux and MacOSX.
      I haven't be able to reproduce it with debug or slowdebug builds, only with product builds.
      The crash seems to occur only C2 is enabled, I haven't been able to reproduce the crash in interpreted mode or with C1 only mode.
      Commenting the line with the assert using the substitutability test (and keeping asserts checking primitive fields directly) seems to prevent the crash from occurring.


      The stack trace:

      Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.dylib+0x1df3d3] SignatureStream::next()+0x7
      V [libjvm.dylib+0x73cf4d] Symbol::print_as_signature_external_return_type(outputStream*)+0x29
      V [libjvm.dylib+0x625be6] Method::print_external_name(outputStream*, Klass*, Symbol*, Symbol*)+0x22
      V [libjvm.dylib+0x55f3b0] LinkResolver::resolve_method(LinkInfo const&, Bytecodes::Code, Thread*)+0x3a4
      V [libjvm.dylib+0x55eff5] LinkResolver::resolve_method_statically(Bytecodes::Code, constantPoolHandle const&, int, Thread*)+0x18b
      V [libjvm.dylib+0x13eefd] Bytecode_invoke::static_target(Thread*)+0x8d
      V [libjvm.dylib+0x6e2010] SharedRuntime::find_callee_info_helper(JavaThread*, vframeStream&, Bytecodes::Code&, CallInfo&, Thread*)+0xd0
      V [libjvm.dylib+0x6e2894] SharedRuntime::find_callee_method(JavaThread*, Thread*)+0x2dc
      V [libjvm.dylib+0x6e35e7] SharedRuntime::reresolve_call_site(JavaThread*, bool&, bool&, bool&, Thread*)+0x24d
      V [libjvm.dylib+0x6dfefb] SharedRuntime::handle_wrong_method(JavaThread*)+0xc3
      v ~RuntimeStub::wrong_method_stub
      J 842 c2 jdk.test.lib.Asserts.assertEquals(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/String;)V (42 bytes) @ 0x00000001118087d0 [0x0000000111808780+0x0000000000000050]
      J 835% c1 C2SubstitutabilityTest.checkBehaviors()V (202 bytes) @ 0x000000010a3d6ebc [0x000000010a3d6040+0x0000000000000e7c]
      j C2SubstitutabilityTest.main([Ljava/lang/String;)V+9
      v ~StubRoutines::call_stub
      V [libjvm.dylib+0x3c25fb] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x2c1
      V [libjvm.dylib+0x6c9012] invoke(InstanceKlass*, methodHandle const&, Handle, bool, objArrayHandle, BasicType, objArrayHandle, bool, Thread*)+0x571
      V [libjvm.dylib+0x6c8a43] Reflection::invoke_method(oopDesc*, Handle, objArrayHandle, Thread*)+0xf5
      V [libjvm.dylib+0x449065] JVM_InvokeMethod+0x20b
      j jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 java.base
      j jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100 java.base
      j jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 java.base
      j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+59 java.base
      j com.sun.javatest.regtest.agent.MainWrapper$MainThread.run()V+172
      j java.lang.Thread.run()V+11 java.base
      v ~StubRoutines::call_stub
      V [libjvm.dylib+0x3c25fb] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x2c1
      V [libjvm.dylib+0x3c195e] JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, Thread*)+0xf6
      V [libjvm.dylib+0x3c1a1a] JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, Thread*)+0x62
      V [libjvm.dylib+0x445916] thread_entry(JavaThread*, Thread*)+0x78
      V [libjvm.dylib+0x780578] JavaThread::thread_main_inner()+0x86
      V [libjvm.dylib+0x7803b6] JavaThread::run()+0x124
      V [libjvm.dylib+0x77e1b9] Thread::call_run()+0x71
      V [libjvm.dylib+0x667e0c] thread_native_entry(Thread*)+0x129
      C [libsystem_pthread.dylib+0x32eb] _pthread_body+0x7e
      C [libsystem_pthread.dylib+0x6249] _pthread_start+0x42
      C [libsystem_pthread.dylib+0x240d] thread_start+0xd

      The full hs_error file is attached.

      A reproducer test is also attached below.

      Attachments

        Issue Links

          Activity

            People

              thartmann Tobias Hartmann
              fparain Frederic Parain
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: