-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
8287073: NPE from CgroupV2Subsystem.getInstance() #8803
Closed
Closed
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Looking at implementation of CgroupV2Subsystem.getInstance(...), it seems that it always returns != null ...
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.
CgroupV1Subsystem.getInstance(...)
also claims that it never returnsnull
, but has a code-path that actually returnsnull
(when there is no active controller). Is this a possible outcome?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.
@plevart Are you asking about the reason for the crash or about the changes?
If it's the former, then I believe that the crash comes not from
getInstance()
returningnull
, but from further down the stack becausenull
is being passed togetInstance()
. I could be wrong in interpreting the report, though.If the question's about the changes, then those are restricted to CgroupV2, so I'm not sure how
CgroupV1Subsystem.getInstance(...)
returning null is related. FWIW, I also don't think we are going to get here if there are no active controllers. There's this code a few lines above: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 was just contemplating the code around the change as it appears to have unnecessary checks which result in dead code. From the point of fixing just this concrete NPE, they are irrelevant. So while this code might benefit from cleanup, perhaps this PR is not the place to do it. Perhaps it is a matter of another issue and PR.
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.
@plevart I think I now understand what you meant and removed the unnecessary checks. Please, have a look.