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

SerialGC attempts to access the card table beyond the end of the heap during card table scan

XMLWordPrintable

    • gc
    • b27
    • Verified

      The following test failed in an adhoc test job:

      com/sun/jdi/EATests.java#id0

      Here's a snippet from the log file:

      ###(Debugger) Target has not yet entered the loop. Sleep 200ms.


      ###(Debugger) get field targetIsInLoop


      ###(Debugger) result : false


      ###(Debugger) Target has not yet entered the loop. Sleep 200ms.

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/opt/mach5/mesos/work_dir/slaves/afbc6042-3a24-4198-9369-18c663a3f74c-S26242/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/a0c33d3f-e84e-4668-a74f-8209c1f36077/runs/f91f0af1-191b-48b5-a1aa-df63a5dcc5e3/workspace/open/src/hotspot/share/gc/shared/cardTable.hpp:120), pid=1124482, tid=1124488
      # assert(_whole_heap.contains(p)) failed: Attempt to access p = 0x0000000100000000 out of bounds of card marking array's _whole_heap = [0x00000000f0000000,0x0000000100000000)
      #
      # JRE version: Java(TM) SE Runtime Environment (22.0) (fastdebug build 22-internal-2023-12-01-2236432.daniel.daugherty.8321069forjdk22.git)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 22-internal-2023-12-01-2236432.daniel.daugherty.8321069forjdk22.git, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, serial gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x86a95b] CardTableRS::non_clean_card_iterate(TenuredSpace*, MemRegion, OopIterateClosure*, CardTableRS*)+0x80b
      #
      # Core dump will be written. Default location: Core dumps may be processed with "/opt/core.sh %p" (or dumping to /opt/mach5/mesos/work_dir/slaves/0db9c48f-6638-40d0-9a4b-bd9cc7533eb8-S9910/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/f827b904-784e-48e0-8f4f-73e70d8b0a29/runs/fdd5a08b-0071-4ec6-b73b-e6d8c5df2978/testoutput/test-support/jtreg_open_test_jdk_jdk_jdi/scratch/0/core.1124482)
      #
      Unsupported internal testing APIs have been used.

      # An error report file with more information is saved as:
      # /opt/mach5/mesos/work_dir/slaves/0db9c48f-6638-40d0-9a4b-bd9cc7533eb8-S9910/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/f827b904-784e-48e0-8f4f-73e70d8b0a29/runs/fdd5a08b-0071-4ec6-b73b-e6d8c5df2978/testoutput/test-support/jtreg_open_test_jdk_jdk_jdi/scratch/0/hs_err_pid1124482.log

      ###(Debugger) get field targetIsInLoop

      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      #
      ----------System.err:(64/3877)----------
      [1ms] run args: [-XX:+UnlockDiagnosticVMOptions, -Xms256m, -Xmx256m, -Xbootclasspath/a:., -XX:CompileCommand=dontinline,*::dontinline_*, -XX:+WhiteBoxAPI, -Xbatch, -XX:+DoEscapeAnalysis, -XX:+EliminateAllocations, -XX:-EliminateLocks, -XX:+EliminateNestedLocks, -XX:LockingMode=1, EATestsTarget]
      [555ms] EAMaterializeLocalVariableUponGet: passed
      [601ms] EAGetWithoutMaterialize: passed
      [644ms] EAMaterializeLocalAtObjectReturn: passed
      [665ms] EAMaterializeLocalAtObjectPollReturnReturn: passed
      [706ms] EAMaterializeIntArray: passed
      [744ms] EAMaterializeLongArray: passed
      [783ms] EAMaterializeFloatArray: passed
      [820ms] EAMaterializeDoubleArray: passed
      [860ms] EAMaterializeObjectArray: passed
      [911ms] EAMaterializeObjectWithConstantAndNotConstantValues: passed
      [948ms] EAMaterializeObjReferencedBy2Locals: passed
      [989ms] EAMaterializeObjReferencedBy2LocalsAndModify: passed
      [1027ms] EAMaterializeObjReferencedBy2LocalsInDifferentVirtFrames: passed
      [1073ms] EAMaterializeObjReferencedBy2LocalsInDifferentVirtFramesAndModify: passed
      [1113ms] EAMaterializeObjReferencedFromOperandStack: passed
      [1153ms] EAMaterializeLocalVariableUponGetAfterSetInteger: passed
      [1197ms] EARelockingSimple: passed
      [1260ms] EARelockingSimpleWithAccessInOtherThread: passed
      [1300ms] EARelockingRecursive: passed
      [1340ms] EARelockingNestedInflated: passed
      [1388ms] EARelockingNestedInflated_02: passed
      [1429ms] EARelockingArgEscapeLWLockedInCalleeFrame: passed
      [1472ms] EARelockingArgEscapeLWLockedInCalleeFrame_2: passed
      [1517ms] EARelockingArgEscapeLWLockedInCalleeFrameNoRecursive: passed
      [1542ms] EAGetOwnedMonitors: passed
      [1562ms] EAEntryCount: passed
      [1823ms] EARelockingObjectCurrentlyWaitingOn: passed
      [1863ms] EADeoptFrameAfterReadLocalObject_01: passed
      [1901ms] EADeoptFrameAfterReadLocalObject_01B: passed
      [1944ms] EADeoptFrameAfterReadLocalObject_02: passed
      [1997ms] EADeoptFrameAfterReadLocalObject_02B: passed
      [2032ms] EADeoptFrameAfterReadLocalObject_02C: passed
      [2073ms] EADeoptFrameAfterReadLocalObject_03: passed
      [2110ms] EAPopFrameNotInlined: passed
      [3676ms] EAPopFrameNotInlinedReallocFailure: passed
      java.lang.RuntimeException: Unexpected exception in test case EAPopInlinedMethodWithScalarReplacedObjectsReallocFailure
      at jdk.test.lib.Asserts.fail(Asserts.java:657)
      at EATestCaseBaseDebugger.run(EATests.java:474)
      at EATests.runTests(EATests.java:398)
      at TestScaffold.startTests(TestScaffold.java:468)
      at EATests.main(EATests.java:308)
      at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
      at java.base/java.lang.reflect.Method.invoke(Method.java:580)
      at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
      at java.base/java.lang.Thread.run(Thread.java:1570)
      Caused by: com.sun.jdi.VMDisconnectedException
      at jdk.jdi/com.sun.tools.jdi.TargetVM.waitForReply(TargetVM.java:304)
      at jdk.jdi/com.sun.tools.jdi.VirtualMachineImpl.waitForTargetReply(VirtualMachineImpl.java:1176)
      at jdk.jdi/com.sun.tools.jdi.PacketStream.waitForReply(PacketStream.java:89)
      at jdk.jdi/com.sun.tools.jdi.JDWP$ObjectReference$GetValues.waitForReply(JDWP.java:4516)
      at jdk.jdi/com.sun.tools.jdi.JDWP$ObjectReference$GetValues.process(JDWP.java:4486)
      at jdk.jdi/com.sun.tools.jdi.ObjectReferenceImpl.getValues(ObjectReferenceImpl.java:229)
      at jdk.jdi/com.sun.tools.jdi.ObjectReferenceImpl.getValue(ObjectReferenceImpl.java:183)
      at EATestCaseBaseDebugger.getField(EATests.java:739)
      at EATestCaseBaseDebugger.targetHasEnteredEndlessLoop(EATests.java:759)
      at EATestCaseBaseDebugger.waitUntilTargetHasEnteredEndlessLoop(EATests.java:768)
      at EAPopInlinedMethodWithScalarReplacedObjectsReallocFailure.runTestCase(EATests.java:2664)
      at EATestCaseBaseDebugger.run(EATests.java:469)
      ... 7 more

      JavaTest Message: Test threw exception: java.lang.RuntimeException
      JavaTest Message: shutting down test

      result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Unexpected exception in test case EAPopInlinedMethodWithScalarReplacedObjectsReallocFailure

      Here's the crashing thread's stack:

      --------------- T H R E A D ---------------

      Current thread (0x00007ff8e00f6e70): VMThread "VM Thread" [id=1124488, stack(0x00007ff8e4058000,0x00007ff8e4158000) (1024K)]

      Stack: [0x00007ff8e4058000,0x00007ff8e4158000], sp=0x00007ff8e4155f88, free space=1015k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x86a95b] CardTableRS::non_clean_card_iterate(TenuredSpace*, MemRegion, OopIterateClosure*, CardTableRS*)+0x80b (cardTable.hpp:120)
      V [libjvm.so+0x15ee72a] SerialHeap::young_process_roots(OopClosure*, OopIterateClosure*, CLDClosure*)+0x5a (serialHeap.cpp:103)
      V [libjvm.so+0xaab70c] DefNewGeneration::collect(bool, bool, unsigned long, bool)+0x49c (defNewGeneration.cpp:781)
      V [libjvm.so+0xd68012] GenCollectedHeap::collect_generation(Generation*, bool, unsigned long, bool, bool, bool)+0x342 (genCollectedHeap.cpp:400)
      V [libjvm.so+0xd691bb] GenCollectedHeap::do_collection(bool, bool, unsigned long, bool, GenCollectedHeap::GenerationType)+0x92b (genCollectedHeap.cpp:464)
      V [libjvm.so+0xd696f6] GenCollectedHeap::satisfy_failed_allocation(unsigned long, bool)+0x76 (genCollectedHeap.cpp:598)
      V [libjvm.so+0xd54f37] VM_GenCollectForAllocation::doit()+0x47 (gcVMOperations.cpp:203)
      V [libjvm.so+0x186ed95] VM_Operation::evaluate()+0xf5 (vmOperations.cpp:73)
      V [libjvm.so+0x18908a7] VMThread::evaluate_operation(VM_Operation*)+0xc7 (vmThread.cpp:281)
      V [libjvm.so+0x18912e3] VMThread::inner_execute(VM_Operation*)+0x3c3 (vmThread.cpp:435)
      V [libjvm.so+0x18914c4] VMThread::loop()+0x84 (vmThread.cpp:502)
      V [libjvm.so+0x18915d4] VMThread::run()+0x94 (vmThread.cpp:175)
      V [libjvm.so+0x178cc36] Thread::call_run()+0xb6 (thread.cpp:220)
      V [libjvm.so+0x1496ea7] thread_native_entry(Thread*)+0x127 (os_linux.cpp:787)

      This particular failure mode has been seen in other adhoc test
      jobs unrelated to the fix that I'm testing. I have not yet seen it
      in a CI job set.

            tschatzl Thomas Schatzl
            dcubed Daniel Daugherty
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: