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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Aleksey Shipilev-5
$ CONF=linux-ppc64-zero-fastdebug make hotspot


 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:
 - [x] Linux Zero PPC64 fastdebug build

-------------

Commit messages:
 - Special-case Zero when accessing FunctionDescriptor for PPC64

Changes: https://git.openjdk.java.net/jdk16/pull/147/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk16&pr=147&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8261310
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk16/pull/147.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk16 pull/147/head:pull/147

PR: https://git.openjdk.java.net/jdk16/pull/147
Reply | Threaded
Open this post in threaded view
|

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

Thomas Stuefe
On Mon, 8 Feb 2021 10:12:31 GMT, Aleksey Shipilev <[hidden email]> wrote:

> $ CONF=linux-ppc64-zero-fastdebug make hotspot
>
>
>  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:
>  - [x] Linux Zero PPC64 fastdebug build

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

-------------

Marked as reviewed by stuefe (Reviewer).

PR: https://git.openjdk.java.net/jdk16/pull/147
Reply | Threaded
Open this post in threaded view
|

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

Aleksey Shipilev-5
In reply to this post by Aleksey Shipilev-5
On Mon, 8 Feb 2021 10:12:31 GMT, Aleksey Shipilev <[hidden email]> wrote:

> $ CONF=linux-ppc64-zero-fastdebug make hotspot
>
>
>  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:
>  - [x] Linux Zero PPC64 fastdebug build

This pull request has been closed without being integrated.

-------------

PR: https://git.openjdk.java.net/jdk16/pull/147
Reply | Threaded
Open this post in threaded view
|

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

Aleksey Shipilev-5
In reply to this post by Thomas Stuefe
On Mon, 8 Feb 2021 10:33:48 GMT, Thomas Stuefe <[hidden email]> wrote:

>> $ CONF=linux-ppc64-zero-fastdebug make hotspot
>>
>>
>>  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:
>>  - [x] Linux Zero PPC64 fastdebug build
>
> 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

Retargeted to 16u: https://github.com/openjdk/jdk16u/pull/23

-------------

PR: https://git.openjdk.java.net/jdk16/pull/147