JDK-8307093 : s390 crossbuild fails with "warning: 'this' pointer is null"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 21
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • CPU: s390x
  • Submitted: 2023-04-28
  • Updated: 2023-05-08
  • Resolved: 2023-05-08
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.
Other
tbdResolved
Related Reports
Duplicate :  
Description
Trying to do a crossbuild for s390 fails:

```
Creating ct.sym classes                                                                                                                   
In file included from /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/asm/assembler.hpp:491,                                                                                                                                                                              
                 from /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/asm/macroAssembler.hpp:28,                                                                                                                                                                          
                 from /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/asm/macroAssembler.inline.hpp:28,                                                                                                                                                                   
                 from /shared/projects/openjdk/jdk-jdk/source/src/hotspot/cpu/s390/macroAssembler_s390.cpp:28:                                                                                                                                                                      
In static member function 'static long int Assembler::reg(Register, int, int)',                                                           
    inlined from 'static long int Assembler::regt(Register, int, int)' at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/cpu/s390/assembler_s390.hpp:1753:60,                                                                                                                  
    inlined from 'static int64_t Assembler::rsymaskt_48(int64_t, Register)' at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/cpu/s390/assembler_s390.hpp:1651:120,
    inlined from 'void Assembler::z_rll(Register, Register, int64_t, Register)' at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/cpu/s390/assembler_s390.inline.hpp:386:134,
    inlined from 'void MacroAssembler::rotate_then_mask(Register, Register, int, int, int, bool, bool, bool)' at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/cpu/s390/macroAssembler_s390.cpp:500:12:
/shared/projects/openjdk/jdk-jdk/source/src/hotspot/cpu/s390/assembler_s390.hpp:1752:60: error: 'this' pointer is null [-Werror=nonnull]                                                                                                                                            
 1752 |   static long reg( Register r, int s, int len) { return reg(r->encoding(), s, len); }                                                                                                                                                                                       
      |                                                         ~~~^~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                          
In file included from /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/asm/register.hpp:236,                                                                                                                                                                               
                 from /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/code/vmreg.hpp:28,                                                                                                                                                                                  
                 from /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/compiler/oopMap.hpp:29,                                                                                                                                                                             
                 from /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/runtime/frame.hpp:29,                                                                                                                                                                               
                 from /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/runtime/javaThread.hpp:33,                                                                                                                                                                          
                 from /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/oops/constantPool.hpp:36,                                                                                                                                                                           
                 from /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/oops/instanceKlass.hpp:31,                                                                                                                                                                          
                 from /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/classfile/javaClasses.hpp:29,                                                                                                                                                                       
                 from /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/precompiled/precompiled.hpp:35:                                                                                                                                                                     
/shared/projects/openjdk/jdk-jdk/source/src/hotspot/cpu/s390/register_s390.hpp: In member function 'void MacroAssembler::rotate_then_mask(Register, Register, int, int, int, bool, bool, bool)':
/shared/projects/openjdk/jdk-jdk/source/src/hotspot/cpu/s390/register_s390.hpp:83:9: note: in a call to non-static member function 'int RegisterImpl::encoding() const'
   83 |   int   encoding() const      { assert(is_valid(), "invalid register"); return value(); }                                                                                                                                                                                   
      |         ^~~~~~~~  
```

Even with --disable-warnings-as-errors

Conguration:

```
using configure arguments '--with-boot-jdk=/shared/projects/openjdk/jdks/sapmachine20 --with-build-jdk=../output-release/images/jdk --with-debug-level=fastdebug --with-devkit=/shared/projects/openjdk/devkits/x86_64-linux-gnu-to-s390x-linux-gnu --openjdk-target=s390x-linux-gnu'.

Configuration summary:
* Name:           /shared/projects/openjdk/jdk-jdk/output-fastdebug-s390
* Debug level:    fastdebug
* HS debug level: fastdebug
* JVM variants:   server
* JVM features:   server: 'cds compiler1 compiler2 epsilongc g1gc jfr jni-check jvmti management parallelgc serialgc services vm-structs' 
* OpenJDK target: OS: linux, CPU architecture: s390, address length: 64
* Version string: 21-internal-adhoc.thomas.source (21-internal)
* Source date:    1682668381 (2023-04-28T07:53:01Z)

Tools summary:
* Boot JDK:       openjdk version "20-ea" 2023-03-21 OpenJDK Runtime Environment SapMachine (build 20-ea+32) OpenJDK 64-Bit Server VM SapMachine (build 20-ea+32, mixed mode, sharing) (at /shared/projects/openjdk/jdks/sapmachine20)
* Toolchain:      gcc (GNU Compiler Collection)
* Devkit:         gcc-11.3.0 - Fedora_21 (/shared/projects/openjdk/devkits/x86_64-linux-gnu-to-s390x-linux-gnu)
* C Compiler:     Version 11.3.0 (at /shared/projects/openjdk/devkits/x86_64-linux-gnu-to-s390x-linux-gnu/bin/s390x-linux-gnu-gcc)
* C++ Compiler:   Version 11.3.0 (at /shared/projects/openjdk/devkits/x86_64-linux-gnu-to-s390x-linux-gnu/bin/s390x-linux-gnu-g++)

Build performance summary:
* Build jobs:     24
* Memory limit:   64231 MB
```

Comments
Hi Thomas, This issue has been fixed by JDK-8307423. So closing this now.
08-05-2023

Lutz, do you think we need to port a change similar to JDK-8276563 ? JDK-8278525 also shows similar issues, In the PR they have pointed out that "Register is a class, but it would be assigned numerical value. Sometime this value could be 0, Thus we need to ignore -Wnonnull."
02-05-2023

Build is indeed failing with gcc 11.3.0. I'm attaching build & configure log files from my z15 machine.
02-05-2023

Can't immediately confirm compiling (fast debug) with gcc 8.2.1. I don't have a gcc11.3.0 readily at hand. Will contact Amit Kumar (IBM's OpenJDK on System z specialist). Maybe he can help.
28-04-2023

Will have a look into it over the (long) weekend as time permits.
28-04-2023

Feel free to reassign/close as needed. Cheers, Thomas
28-04-2023