-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8289002: Minimal x86_64 VM build fails with GCC 11: 'this' pointer is null #9718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Welcome back shade! A progress list of the required criteria for merging this PR into |
Webrevs
|
I can't help but feel that without INCLUDE_MANAGEMENT we should not be getting to the code concerned, so something seems amiss to me. But I don't have cycles at the moment to try and trace through this. |
Though it is also possible code changes have crept in that have not taken INCLUDE_MANAGEMENT into account. |
My initial patch was going in that direction: protecting some paths with |
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. |
The minimal VM build dates from the compact profiles defined in Java 8. The compact1 and compact2 profiles didn't have the j.l.management APIs so a minimal VM build of libjvm without the "management" code would have been okay. For Java 9+ then a minimal VM build without "management" only make sense when using jlink to create a run-time image that doesn't have the java.management module. |
Thanks Alan (@AlanBateman )! That is what I was reaching for. I guess we lost the actual constraint when we moved to 9 that the Minimal VM cannot be used when the management module is present, as we presumably have no specification for how that module behaves in that case. Now that doesn't help in the current situation where GCC complains about a NULL this ptr as it cannot know about the fact this code should be unreachable in practice. I'm tempted to say we should use guarantees in the VM code and abort if we encounter the NULL - would that satisfy GCC? It seems better to fail fast and completely with such a misconfigured runtime environment. |
I tried to put
That would be okay with you, @dholmes-ora? |
There wasn't any real constraint in JDK 8 either, it was just that the minimal VM build was for compact1 and compact2. It's a topic that I discussed a few times with Bob Vandette but it never rose to the level of something that the module system should support. A jlink plugin (or an update to ExcludeVMPlugin) could detect attempts to create a run-time image that contains both the minimal VM and the java.management module but may not be worth it. In any case, a run-time image with the minimal VM will fail with exceptions like this:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with this approach. Thanks.
@shipilev This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 92 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Thanks! Any other reviews? |
Ping? I would like to push it soon. Thanks! |
Thank you! /integrate |
Going to push as commit 37d3146.
Your commit was automatically rebased without conflicts. |
These build failures are specific to Minimal VM, because it disables "management" feature, and paths like these start to 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 fromMemoryManager::get_memory_manager_instance
, and handling the exception at its uses.Additional testing:
tier1
tier2
hotspot_serviceability
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9718/head:pull/9718
$ git checkout pull/9718
Update a local copy of the PR:
$ git checkout pull/9718
$ git pull https://git.openjdk.org/jdk pull/9718/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 9718
View PR using the GUI difftool:
$ git pr show -t 9718
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9718.diff