Conversation
LinuxPids.Limit became a pointer when commit b521900 ("go.{mod,sum}: bump runtime-spec to v1.3.0.") moved to runtime-spec v1.3.0, and the check turned into a comparison of two pointers that are never equal. The pids limit check has failed for every runtime since, and the diagnostic printed two addresses instead of the limits. Dereference both sides, and report a limit that is missing on either of them as a diagnostic rather than dereferencing a nil pointer. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
ValidateLinuxResourcesPidscompareslpd.Limitwithconfig.Linux.Resources.Pids.Limitusing==. Those wereint64values when the check was written, butLinuxPids.Limitbecame*int64in runtime-spec v1.3.0, which came in with b521900, and the comparison silently became one between two pointers that are freshly allocated on each side and so are never equal.The result is that "pids limit is set correctly" has failed for every runtime on every cgroup hierarchy since that bump, in
linux_cgroups_pids,linux_cgroups_relative_pidsanddelete_resources, and the diagnostic printed two addresses rather than the limits, which is what makes it easy to miss:# expect: 55915624612248, actual: 55915627741456. This dereferences both sides, and reports a limit that is absent on either of them as a diagnostic instead of dereferencing a nil pointer.