JDK-8221175 : Fix bad function case for controlled JVM crash on PPC64 big-endian
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: ppc
  • Submitted: 2019-03-20
  • Updated: 2021-05-26
  • Resolved: 2019-03-26
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 11 JDK 13
11.0.4Fixed 13 b14Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
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).
Comments
Fix Request This fix is low risk (controlled crasher code will only be available on fastbug / slowdebug builds) and although it touches a shared file it's a PPC64 BE-only change. Downporting it to jdk11u is ok since JDK-8220794 [0] is already downported and integrated to jdk11u. Change applies cleanly. [0] https://bugs.openjdk.java.net/browse/JDK-8220794
06-05-2019