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

AArch64: Incorrect C2 patterns cause system register corruption

    Details

    • Subcomponent:
    • Resolved In Build:
      b163
    • CPU:
      aarch64
    • OS:
      generic

      Backports

        Description

        A rare crash was tracked down to badly-written patterns in aarch64.ad which use iRegX rather than iRegXNoSp as tmp and/or output operands. At times of extreme register pressure, C2 uses system registers such as Rheapbase as scratch. This causes system corruption and crashing.

        It is hard to write reproducible test cases for these crashes because it depends on exactly what inlining gets done, and in turn that depends on runtime profile data.

          Activity

          Hide
          zmajo Zoltan Majo added a comment -
          ILW=crash, rare, no workaround = HLH = P2
          Show
          zmajo Zoltan Majo added a comment - ILW=crash, rare, no workaround = HLH = P2
          Hide
          adinn Andrew Dinn added a comment -
          Fix Request

          Importance:
          This bug can crash high-performance server apps running on the AArch64 port

          Nature of Fix:
          The fix corrects a small number of rules in the AD file for AArch64 to stop the compiler allocating special, VM-dedicated registes as though they were general purpose registers.

          Risk:
          Very low -- it only changes the AD rules that re broken and only so as to restrict the opportunities for registers to be allocated.

          Test Coverage:
          1) Basic smoke testing (java Hello, javac Hello.java)
          2) The test which originally manifested this problem with a crash passed after incorporating the change for the specific rule found to be causing the bad allocation
          Otherwise it is very hard to test this more generally (as explained above)

          Reviewed:
          Andrew Haley, Vladimir Kozlov

          Webrev:
          http://cr.openjdk.java.net/~adinn/8177661/webrev.02
          Show
          adinn Andrew Dinn added a comment - Fix Request Importance: This bug can crash high-performance server apps running on the AArch64 port Nature of Fix: The fix corrects a small number of rules in the AD file for AArch64 to stop the compiler allocating special, VM-dedicated registes as though they were general purpose registers. Risk: Very low -- it only changes the AD rules that re broken and only so as to restrict the opportunities for registers to be allocated. Test Coverage: 1) Basic smoke testing (java Hello, javac Hello.java) 2) The test which originally manifested this problem with a crash passed after incorporating the change for the specific rule found to be causing the bad allocation Otherwise it is very hard to test this more generally (as explained above) Reviewed: Andrew Haley, Vladimir Kozlov Webrev: http://cr.openjdk.java.net/~adinn/8177661/webrev.02
          Hide
          kvn Vladimir Kozlov added a comment -
          Fix approved for JDK 9.
          Show
          kvn Vladimir Kozlov added a comment - Fix approved for JDK 9.
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/dev/hotspot/rev/983fe2075557
          User: adinn
          Date: 2017-03-27 16:41:56 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/hotspot/rev/983fe2075557 User: adinn Date: 2017-03-27 16:41:56 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/983fe2075557
          User: lana
          Date: 2017-03-29 21:57:41 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/983fe2075557 User: lana Date: 2017-03-29 21:57:41 +0000

            People

            • Assignee:
              adinn Andrew Dinn
              Reporter:
              aph Andrew Haley
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: