RFR: 8289002: Minimal x86_64 VM build fails with GCC 11: 'this' pointer is null
Aleksey Shipilev
shade at openjdk.org
Tue Aug 2 18:17:23 UTC 2022
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
- [ ] Linux x86_64 fastdebug server with GCC 9.3.0, `tier1`
- [ ] Linux x86_64 fastdebug server with GCC 9.3.0, `tier2`
- [x] Linux x86_64 fastdebug server with GCC 9.3.0, `hotspot_serviceability`
-------------
Commit messages:
- Drop comment
- Fix
Changes: https://git.openjdk.org/jdk/pull/9718/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9718&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8289002
Stats: 11 lines in 3 files changed: 9 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/9718.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/9718/head:pull/9718
PR: https://git.openjdk.org/jdk/pull/9718
More information about the hotspot-dev
mailing list