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

Fix bad function case for controlled JVM crash on PPC64 big-endian

XMLWordPrintable

    • b14
    • ppc
    • linux

        Currently runtime/ErrorHandling/ErrorHandler.java test and possible other tests that call VMError::controlled_crash() in order to crash the JVM in a controlled way will pass for case 13 (bad function pointer case) on big-endian machines - which default to ABI ELFv1 - but due to a _wrong reason_: in the current state it does not define correctly a function descriptor (only used on ABI ELFv1, but not on ABI ELFv2) and a SIGSEGV is generated before the bad function is effectively called.

        In the current state f = 0xF is taken on BE as a pointer to the function descriptor (obeying the ABI ELFv1) that will be used for loading the bad function pointer - from offset 0. It's that load instruction loading from offset 0 of address 0xF (ld r10, 0(0xf)) that triggers the SIGSEGV. That SIGSEGV is a Data Storage Interruption instead of a Instruction Data Interruption (which is triggered when a branch to a bad function happens).

        The issue can be simply solved by correctly defining a function descriptor which contains a bad function pointer at offset 0 and then calling the function using that function descriptor (only on PPC64 BE, which uses, by default, ABI ELFv1).

              gromero Gustavo Romero
              gromero Gustavo Romero
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: