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

Failed JfrVersionSystem invariant when VM built with -fno-elide-constructors

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 17
    • Component/s: hotspot
    • Subcomponent:
      jfr
    • Resolved In Build:
      b06

      Description

      If the VM is built with -fno-elide-constructors (for example, by configuring with --with-extra-cxxflags=-fno-elide-constructors), running hotspot:tier1 tests gets the following test failure due to a failed assertion:

      compiler/intrinsics/klass/CastNullCheckDroppingsTest.java fails with
      # Internal Error (../../src/hotspot/share/jfr/utilities/jfrVersionSystem.inline.hpp:98), pid=31086, tid=31713
      # assert(node->_live) failed: invariant

      This suggests there is a problem with a copy-ctor or assignment operator that is otherwise (without -fno-elide-constructors) optimized away. We shouldn't be relying on copy elision until C++17 makes it mandatory.

      Stack trace for the crash:

      Stack: [0x00007fdb172fa000,0x00007fdb173fb000], sp=0x00007fdb173f8960, free space=1018k
      Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0xf1f0bb] JfrConcurrentLinkedListHost<JfrConcurrentQueue<JfrBuffer, JfrCHeapObj>, HeadNode, JfrCHeapObj>::insert_tail(JfrBuffer*, JfrBuffer*
      , JfrBuffer*, JfrBuffer const*) const+0xeb
      V [libjvm.so+0xfac707] JfrStorage::initialize()+0x3d7
      V [libjvm.so+0xf95879] JfrRecorder::create_components()+0x359
      V [libjvm.so+0xf95db2] JfrRecorder::create(bool)+0x42
      V [libjvm.so+0xf5c0cf] jfr_create_jfr+0x3df
      j jdk.jfr.internal.JVM.createJFR(Z)Z+0 jdk.jfr@17-internal
      j jdk.jfr.internal.JVM.createNativeJFR()V+3 jdk.jfr@17-internal
      j jdk.jfr.internal.PlatformRecorder.<init>()V+48 jdk.jfr@17-internal
      j jdk.jfr.FlightRecorder.getFlightRecorder()Ljdk/jfr/FlightRecorder;+25 jdk.jfr@17-internal
      j jdk.jfr.Recording.<init>(Ljava/util/Map;)V+14 jdk.jfr@17-internal
      j jdk.jfr.Recording.<init>()V+8 jdk.jfr@17-internal
      j compiler.intrinsics.klass.CastNullCheckDroppingsTest.runTest(Ljava/lang/reflect/Method;ZLjava/lang/Object;)V+27
      j compiler.intrinsics.klass.CastNullCheckDroppingsTest.main([Ljava/lang/String;)V+155
      v ~StubRoutines::call_stub
      V [libjvm.so+0xed9b5e] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x5ae
      V [libjvm.so+0x17c964a] invoke(InstanceKlass*, methodHandle const&, Handle, bool, objArrayHandle, BasicType, objArrayHandle, bool, Thread*) [clone .constprop.0]+0xfda
      V [libjvm.so+0x17cacaf] Reflection::invoke_method(oop, Handle, objArrayHandle, Thread*)+0x1bf
      V [libjvm.so+0x10b462f] JVM_InvokeMethod+0x21f
      j jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 java.base@17-internal
      j jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+146 java.base@17-internal
      j jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 java.base@17-internal
      j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+59 java.base@17-internal
      j com.sun.javatest.regtest.agent.MainWrapper$MainThread.run()V+172
      j java.lang.Thread.run()V+11 java.base@17-internal
      v ~StubRoutines::call_stub
      V [libjvm.so+0xed9b5e] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x5ae
      V [libjvm.so+0xeda549] JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, Thread*)+0x4b9
      V [libjvm.so+0xedaa72] JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, Thread*)+0xb2
      V [libjvm.so+0x108e5b3] thread_entry(JavaThread*, Thread*)+0x143
      V [libjvm.so+0x19f91db] JavaThread::thread_main_inner()+0x40b
      V [libjvm.so+0x1a00080] Thread::call_run()+0x100
      V [libjvm.so+0x16b0e66] thread_native_entry(Thread*)+0x116

      Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
      j jdk.jfr.internal.JVM.createJFR(Z)Z+0 jdk.jfr@17-internal
      j jdk.jfr.internal.JVM.createNativeJFR()V+3 jdk.jfr@17-internal
      j jdk.jfr.internal.PlatformRecorder.<init>()V+48 jdk.jfr@17-internal
      j jdk.jfr.FlightRecorder.getFlightRecorder()Ljdk/jfr/FlightRecorder;+25 jdk.jfr@17-internal
      j jdk.jfr.Recording.<init>(Ljava/util/Map;)V+14 jdk.jfr@17-internal
      j jdk.jfr.Recording.<init>()V+8 jdk.jfr@17-internal
      j compiler.intrinsics.klass.CastNullCheckDroppingsTest.runTest(Ljava/lang/reflect/Method;ZLjava/lang/Object;)V+27
      j compiler.intrinsics.klass.CastNullCheckDroppingsTest.main([Ljava/lang/String;)V+155
      v ~StubRoutines::call_stub
      j jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 java.base@17-internal
      j jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+146 java.base@17-internal
      j jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 java.base@17-internal
      j java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+59 java.base@17-internal
      j com.sun.javatest.regtest.agent.MainWrapper$MainThread.run()V+172
      j java.lang.Thread.run()V+11 java.base@17-internal
      v ~StubRoutines::call_stub

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mgronlun Markus Grönlund
              Reporter:
              kbarrett Kim Barrett
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: