JDK-8261310 : PPC64 Zero build fails with 'VMError::controlled_crash(int)::FunctionDescriptor functionDescriptor' has incomplete type and cannot be defined
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11,16.0.1
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-02-08
  • Updated: 2021-05-26
  • Resolved: 2021-02-15
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 15 JDK 16
11.0.11Fixed 15.0.3Fixed 16.0.1 b06Fixed
Related Reports
Relates :  
Relates :  
Description
$ CONF=linux-ppc64-zero-fastdebug make hotspot

/home/shade/trunks/jdk16/src/hotspot/share/utilities/vmError.cpp: In static member function 'static void VMError::controlled_crash(int)':
/home/shade/trunks/jdk16/src/hotspot/share/utilities/vmError.cpp:1799:29: error: aggregate 'VMError::controlled_crash(int)::FunctionDescriptor functionDescriptor' has incomplete type and cannot be defined
 1799 |   struct FunctionDescriptor functionDescriptor;
      |                             ^~~~~~~~~~~~~~~~~~

`FunctionDescriptor` is from `src/hotspot/cpu/ppc/assembler_ppc.hpp`, and obviously not available for Zero.

The affected code was removed by JDK-8252148 in 17, so this issue affects versions below it.
While not exactly the regression for 16, it would be nice to have this fixed for 16 and lower, to get clean builds on all platform configurations, including JDK 16 GA.

The fix is trivial:

diff --git a/src/hotspot/share/utilities/vmError.cpp b/src/hotspot/share/utilities/vmError.cpp
index 9b0dc413bcd..476fdc48e43 100644
--- a/src/hotspot/share/utilities/vmError.cpp
+++ b/src/hotspot/share/utilities/vmError.cpp
@@ -1795,7 +1795,7 @@ void VMError::controlled_crash(int how) {
   char * const dataPtr = NULL;  // bad data pointer
   const void (*funcPtr)(void);  // bad function pointer
 
-#if defined(PPC64) && !defined(ABI_ELFv2)
+#if defined(PPC64) && !defined(ABI_ELFv2) && !defined(ZERO)
   struct FunctionDescriptor functionDescriptor;
 
   functionDescriptor.set_entry((address) 0xF);

Comments
The troublesome code was introduced by JDK-8221175: "Fix bad function case for controlled JVM crash on PPC64 big-endian", which is not in 8u, so this fix is not applicable there.
26-05-2021

Fix Request (15u) Same reason as for 11u: unbreaks PPC64 Zero builds. Patch applies cleanly to 15u.
03-03-2021

Fix Request (11u) Fixes a trivial build issue. Patch from 16u applies to 11u cleanly. PPC64 Zero build is broken without the patch, fixed with the patch.
15-02-2021

Changeset: cc3417dc Author: Aleksey Shipilev <shade@openjdk.org> Date: 2021-02-15 18:17:01 +0000 URL: https://git.openjdk.java.net/jdk16u/commit/cc3417dc
15-02-2021

Fix Request (16u) This resolves the trivial build issue. While not exactly the regression, it would be nice to have JDK 16 GA built cleanly in all configurations. 16u PR: https://github.com/openjdk/jdk16u/pull/23
08-02-2021

OK, I shall retarget to 16.0.1: https://github.com/openjdk/jdk16u/pull/23
08-02-2021

Since Zero on ppc isn't a tier1 platform for anyone, I don't think this is a P1.
08-02-2021

We are in RC phase for JDK 16. Only P1 fixes are allowed: http://openjdk.java.net/jeps/3#rc You can retarget fix to 16update or rise priority.
08-02-2021

Fix Request (16) This resolves the trivial build issue. While not exactly the regression, it would be nice to have JDK 16 GA built cleanly in all configurations. PR: https://github.com/openjdk/jdk16/pull/147
08-02-2021