RFR: 8289002: Minimal x86_64 VM build fails with GCC 11: 'this' pointer is null

David Holmes dholmes at openjdk.org
Wed Aug 3 08:20:45 UTC 2022


On Tue, 2 Aug 2022 18:11:33 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> These build failures are 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);
> ``` 
> 
> I propose we handle the `NULL`-s properly and throwing early when those are detected. We return/throw what similar code in the affected methods do. I went back and forth with the patch, and settled on throwing from `MemoryManager::get_memory_manager_instance`, and handling the exception at its uses.
> 
> Additional testing:
>  - [x] Linux x86_64 fastdebug minimal build with GCC 11.3.0
>  - [x]  Linux x86_64 fastdebug server with GCC 9.3.0, `tier1`
>  - [x]  Linux x86_64 fastdebug server with GCC 9.3.0, `tier2`
>  - [x]  Linux x86_64 fastdebug server with GCC 9.3.0, `hotspot_serviceability`

But the higher-level API's must be aware that management support may not exist and they should then be specified to behave a certain way when that is true. That specified behaviour may not be throwing your new exceptions. If the APIs do not account for the management interface not being available, then that is a significant bug that needs fixing.

That said I have to refresh my memory as to whether the Minimal VM is only supported by certain compact profiles (which would exclude the high-level API's we are discussing). It may simply be an invalid configuration to have a Minimal VM but a full set of Java API's.

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

PR: https://git.openjdk.org/jdk/pull/9718


More information about the hotspot-dev mailing list