Repository navigation
fix(uat): close the /proc stat files the process probes read - #18
Merged
Merged
Conversation
_members and _running opened /proc/<pid>/stat without closing it; CodeQL py/file-not-closed flagged both. CPython closes them when the reference drops, so this is hygiene rather than a leak in practice, but the probes run in a loop over every process on the machine. CodeQL (python-security-and-quality, run on 0.2.0 candidate, 277 files) triaged as [real 3 / noise rest]: this file, the dead assignments in cdp_guard.py and uat/batch.py, and an import cycle in native/ that is safe today and is logged for follow-up rather than changed here.
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.
CodeQL pre-release audit (python-security-and-quality, 277 files) found two unclosed
/proc/<pid>/statreads inuat/procs.py. Fixed withwith. Unit tests:pytest -k 'uat or procs'84 passed, 4 skipped.Triage of the remaining 181 results (noise unless noted):
cdp_guard.py,uat/batch.py.py/unsafe-cyclic-importinnative/context.py(22) andnative/page.py(1). Works today; import order is fragile.py/illegal-raise(GuardLost is an Exception),py/call/wrong-named-argument(name resolution), test/probe scripts (fixture secret in gate output, header echo in fixtures, TLSv1 in probe).