JDK-8289002 : Minimal x86_64 VM build fails with GCC 11: 'this' pointer is null
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 20
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • CPU: x86_64
  • Submitted: 2022-06-22
  • Updated: 2022-08-11
  • Resolved: 2022-08-10
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 20
20 b10Fixed
Related Reports
Duplicate :  
Description
This is only partially solved by JDK-8289046. The remaining error is:

```
In file included from /home/test/shipilev-jdk/src/hotspot/share/oops/arrayKlass.hpp:28,
                 from /home/test/shipilev-jdk/src/hotspot/share/oops/typeArrayKlass.hpp:28,
                 from /home/test/shipilev-jdk/src/hotspot/share/oops/typeArrayOop.hpp:29,
                 from /home/test/shipilev-jdk/src/hotspot/share/oops/constantPool.hpp:34,
                 from /home/test/shipilev-jdk/src/hotspot/share/oops/fieldInfo.hpp:28,
                 from /home/test/shipilev-jdk/src/hotspot/share/oops/instanceKlass.hpp:31,
                 from /home/test/shipilev-jdk/src/hotspot/share/classfile/javaClasses.hpp:29,
                 from /home/test/shipilev-jdk/src/hotspot/share/precompiled/precompiled.hpp:35:
In member function 'bool Klass::is_instance_klass() const',
    inlined from 'static const InstanceKlass* InstanceKlass::cast(const Klass*)' at /home/test/shipilev-jdk/src/hotspot/share/oops/instanceKlass.hpp:1006:5,
    inlined from 'static InstanceKlass* InstanceKlass::cast(Klass*)' at /home/test/shipilev-jdk/src/hotspot/share/oops/instanceKlass.hpp:1001:43,
    inlined from 'static void DCmdFactory::send_notification_internal(JavaThread*)' at /home/test/shipilev-jdk/src/hotspot/share/services/diagnosticFramework.cpp:465:58:
/home/test/shipilev-jdk/src/hotspot/share/oops/klass.hpp:623:134: error: 'this' pointer is null [-Werror=nonnull]
  623 | bool is_instance_klass() const { return assert_same_query(_kind <= InstanceStackChunkKlassKind, is_instance_klass_slow()); }
      | ~~~~~~~~~~~~~~~~~~~~~~^~ 
```

This is specific to Minimal VM, because it disables "management" feature, and paths like these start to return NULL:

```
  static InstanceKlass* com_sun_management_internal_DiagnosticCommandImpl_klass(TRAPS)
      NOT_MANAGEMENT_RETURN_(NULL);
```
Comments
Changeset: 37d3146c Author: Aleksey Shipilev <shade@openjdk.org> Date: 2022-08-10 13:26:56 +0000 URL: https://git.openjdk.org/jdk/commit/37d3146cca2c40dd53fcebd9cb78595f018b3489
10-08-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/9718 Date: 2022-08-02 18:11:33 +0000
02-08-2022