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

G1 crash during concurrent root region scan.

    Details

    • Type: Bug
    • Status: In Progress
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 8u60, 9
    • Fix Version/s: 10
    • Component/s: hotspot
    • Subcomponent:
      gc
    • Understanding:
      Fix Understood
    • CPU:
      generic
    • OS:
      generic

      Description

      We have seen crashes with G1 during concurrent root region scan.
      It turned out that the reason for the crashes was reloading an oop after a null check.
      The compiler may legally do this, as the pointer is not declared as volatile.
      The code runs concurrently to mutator threads.


      template <class T>
      inline void G1RootRegionScanClosure::do_oop_nv(T* p) {
        T heap_oop = oopDesc::load_heap_oop(p); // 1. load
        if (!oopDesc::is_null(heap_oop)) {
          oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); // 2. Compiler decides to reload
          HeapRegion* hr = _g1h->heap_region_containing((HeapWord*) obj);
          _cm->grayRoot(obj, obj->size(), _worker_id, hr);
        }
      }


      We have seen the problem on AIX with the xlC compiler. However, we have seen similar optimizations on other platforms.

      As this code pattern is used quite often throughout the whole jvm, I would suggest a global fix in oopDesc::load_heap_oop(p).

        Activity

        Hide
        jwilhelm Jesper Wilhelmsson added a comment -
        Further info from Axel:

        We have seen the bug on aix ppc. It affects 8u and 9.
        The crash happened sporadically, but we were able to identify the root cause by analyzing the assembly generated by the xlC compiler.
        Though, we have seen crashes on just this one platform, there could be a problem on other platforms, if the compiler decides to optimize in the described way.
        Show
        jwilhelm Jesper Wilhelmsson added a comment - Further info from Axel: We have seen the bug on aix ppc. It affects 8u and 9. The crash happened sporadically, but we were able to identify the root cause by analyzing the assembly generated by the xlC compiler. Though, we have seen crashes on just this one platform, there could be a problem on other platforms, if the compiler decides to optimize in the described way.
        Show
        simonis Volker Simonis added a comment - Axel posted a webrev for this issue here: http://cr.openjdk.java.net/~asiebenborn/8129440/webrev.00/ And this is the mail thread where the issue has been discussed: http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/2015-June/thread.html#13924 http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/2015-July/thread.html#14078

          People

          • Assignee:
            asiebenborn Axel Siebenborn
            Reporter:
            asiebenborn Axel Siebenborn
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: