Fix nil pointer dereference in Windows memory eviction threshold notifier#1
Open
Fix nil pointer dereference in Windows memory eviction threshold notifier#1
Conversation
The methods Close for mockRuntimeService in CPUManager and MemoryManager tests are not used and are not part of the `runtimeService interface` They were added during improving of passing context to CRI client: "CRI client: pass context to Close and use contextual logging", but are not part of that feature. Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
This commit expands the validation test coverage for the +k8s:minimum tag: - Adds short-circuit tests to verify nil pointer handling for optional and required pointers. - Adds test coverage for changing from one invalid value to another different invalid value. - Adds typedef test coverage for optional and required structs.
…rd stat failure Signed-off-by: Stanislav Láznička <slznika@microsoft.com>
…nager dir to recover it Signed-off-by: Stanislav Láznička <slznika@microsoft.com>
…ndows too Signed-off-by: Mark Rossetti <marosset@microsoft.com>
…p-coredns-1.14.3 Revert "bump coredns to v1.14.3"
Fix 1.36 changelog terminology for DRA Node Allocatable Resources
…ize_node_selectors_fg Drop `AuthorizeNodeWithSelectors` and `AuthorizeWithSelectors` feature gates
…text-close Remove unused Close methods of mockRuntimeService in kubelet tests
…nittest-fix Fixing prune-junit-xml directory walking so labels get applied for Windows too
…Finalization apiextensions-apiserver: forbid CR create/apply while CRD is deleting
…tigate e2e node conformance: fix the EnsureCredentialPulledImages test flakes
Add tests for minimum with required and optional
…chval-case feat(validation-gen): add eachVal + maxBytes validation for resource string values
…fier When GetPerformanceInfo() fails, the error is logged but execution continues, causing a nil pointer dereference on the next line when accessing perfInfo.CommitLimitPages. Add an early return after the error log to prevent the panic. Also fix the typo in variable name: commmiLimitBytes -> commitLimitBytes.
9cbb1e2 to
c957c96
Compare
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.
What this PR does
Fixes a nil pointer dereference bug in the Windows memory eviction threshold notifier.
Bug
In
checkMemoryUsage()(memory_threshold_notifier_windows.go), whenGetPerformanceInfo()fails, the error is logged but execution continues. The next line dereferencesperfInfo(which is nil), causing a panic:Fix
commmiLimitBytes→commitLimitBytes(triple 'm').Testing
This is a minimal, targeted fix. The nil dereference is evident from code inspection —
GetPerformanceInfo()returns(*PerformanceInformation, error)and on error the pointer is nil.