Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

8261310: PPC64 Zero build fails with 'VMError::controlled_crash(int)::FunctionDescriptor functionDescriptor' has incomplete type and cannot be defined #147

Closed
wants to merge 1 commit into from

Conversation

shipilev
Copy link
Member

@shipilev shipilev commented Feb 8, 2021

$ 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);

Additional testing:

  • Linux Zero PPC64 fastdebug build

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8261310: PPC64 Zero build fails with 'VMError::controlled_crash(int)::FunctionDescriptor functionDescriptor' has incomplete type and cannot be defined

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk16 pull/147/head:pull/147
$ git checkout pull/147

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 8, 2021

👋 Welcome back shade! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 8, 2021
@openjdk
Copy link

openjdk bot commented Feb 8, 2021

@shipilev The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot label Feb 8, 2021
@mlbridge
Copy link

mlbridge bot commented Feb 8, 2021

Webrevs

Copy link
Member

@tstuefe tstuefe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is trivial and fine.

The way it is fixed may trip error handler tests on Zero which test that the pc is correctly displayed. But I don't think we have such a test. We have downstream but I ever brought it upstream. Its also not terribly important.

Also, function descriptors should be available with zero too of course, but I'm not sure its worth following up on that. Note that one could just do:

  void* fakefundes[2] = { 0xF, NULL };
  funcPtr = (const void(*)()) &fakefundes;

and it would probably work just fine.

Cheers, Thomas

@openjdk
Copy link

openjdk bot commented Feb 8, 2021

@shipilev This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8261310: PPC64 Zero build fails with 'VMError::controlled_crash(int)::FunctionDescriptor functionDescriptor' has incomplete type and cannot be defined

Reviewed-by: stuefe

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 8, 2021
@shipilev shipilev closed this Feb 8, 2021
@shipilev
Copy link
Member Author

shipilev commented Feb 8, 2021

Retargeted to 16u: openjdk/jdk16u#23

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hotspot ready Pull request is ready to be integrated rfr Pull request is ready for review
2 participants