Skip to content

confusing-naming: keep seen packages per rule instance - #1963

Merged
alexandear merged 1 commit into
revive-lint:masterfrom
alexandear:fix/confusing-naming-leak
Nov 12, 2026
Merged

alexandear merged 1 commit into
revive-lint:masterfrom
alexandear:fix/confusing-naming-leak

Conversation

@alexandear

@alexandear alexandear commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Fixes #1964

The rule stored every linted package in the package-global allPkgs slice
and never released them. A long-lived process that lints repeatedly
(e.g. the FuzzLint fuzz target) kept every package's AST and type info
alive, so memory grew without bound and methodNames scanned an
ever-growing slice.

Store the packages on the rule instance instead, so they are released
together with the rule.

Found with fuzzing.
@alexandear
alexandear merged commit 456717b into revive-lint:master Nov 12, 2026
15 checks passed
@alexandear
alexandear deleted the fix/confusing-naming-leak branch November 12, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

confusing-naming: memory grows without bound when linting repeatedly in one process

1 participant