JDK-8232730 : Shenandoah: Traversal should not CAS the roots
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 11-shenandoah,14
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-10-21
  • Updated: 2020-02-28
  • Resolved: 2019-10-21
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 14
14 b20Fixed
Related Reports
Relates :  
Description
This is captured by asserts from JDK-8232729 with hotspot_gc_shenandoah on x86_64:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/shade/trunks/jdk-jdk/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp:133), pid=10196, tid=10214
#  assert(is_aligned(addr, HeapWordSize)) failed: Address should be aligned: 0x00007f9c04e7eaf6
#
# JRE version: OpenJDK Runtime Environment (14.0) (fastdebug build 14-internal+0-adhoc.shade.jdk-jdk)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 14-internal+0-adhoc.shade.jdk-jdk, mixed mode, sharing, tiered, compressed oops, shenandoah gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x13bfa67]  ShenandoahHeap::cas_oop(oop, oop*, oop)+0xb7
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P" (or dumping to /home/shade/trunks/jdk-jdk/build/linux-x86_64-server-fastdebug/test-support/jtreg_test_hotspot_jtreg_hotspot_gc_shenandoah/scratch/2/core.10196)
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

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

Current thread (0x00007f9bec001000):  GCTaskThread "Shenandoah GC Threads#4" [stack: 0x00007f9bfd9ef000,0x00007f9bfdaef000] [id=10214]

Stack: [0x00007f9bfd9ef000,0x00007f9bfdaef000],  sp=0x00007f9bfdaed940,  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+0x13bfa67]  ShenandoahHeap::cas_oop(oop, oop*, oop)+0xb7
V  [libjvm.so+0x16b1266]  void ShenandoahTraversalGC::process_oop<oop, false, false>(oop*, Thread*, Padded<BufferedOverflowTaskQueue<ObjArrayChunkedTask, (MemoryType)5, 131072u>, 128ul>*, ShenandoahMarkingContext*) [clone .constprop.488]+0x146
V  [libjvm.so+0x139df94]  nmethod::oops_do(OopClosure*, bool)+0x1d4
V  [libjvm.so+0xdfde63]  MarkingCodeBlobClosure::do_code_blob(CodeBlob*)+0x43
V  [libjvm.so+0x16068d1]  void ShenandoahCodeRootsIterator::fast_parallel_blobs_do<true>(CodeBlobClosure*)+0x131
V  [libjvm.so+0x16b8e21]  ShenandoahRootScanner<ShenandoahCsetCodeRootsIterator>::roots_do(unsigned int, OopClosure*, CLDClosure*, CodeBlobClosure*, ThreadClosure*)+0x1f1
V  [libjvm.so+0x16b9183]  ShenandoahInitTraversalCollectionTask::work(unsigned int)+0x203
V  [libjvm.so+0x1969480]  GangWorker::loop()+0xe0
V  [libjvm.so+0x182f816]  Thread::call_run()+0xf6
V  [libjvm.so+0x142c26e]  thread_native_entry(Thread*)+0x10e                                                

The underlying reason for this is trying to CAS the roots that are not aligned to the pointer size, notably code roots. Normal concurrent cycle avoids this by updating the roots with plain stores, Traversal should do the same.
Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/15f4471787b9 User: shade Date: 2019-10-21 20:45:16 +0000
21-10-2019