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

Shenandoah: Fix racy update of update_watermark

    • gc
    • b23
    • generic
    • generic

        We're observing an assert in ShenandoahHeapRegion:get_update_watermark():

        assert(bottom() <= watermark && watermark <= top(), "within bounds");

        The trouble there is that arraycopy routines will get there concurrently with evacuating threads that update update_watermark under lock, but the read-access is not under lock. The observing thread can observe the updates to top and update_watermark in wrong order and thus trip that assert. It happens reliably on aarch64 with the following test:

        CONF=fastdebug LANG=C LOG=info make run-test TEST=compiler/types/correctness/OffTest.java TEST_VM_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive"

              rkennke Roman Kennke
              rkennke Roman Kennke
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: