Repository navigation
Conversation
Collaborator
|
Review requested:
|
When uv_dlopen() fails, the error message it allocates is only released by uv_dlclose(). DynamicLibrary::Close() skips uv_dlclose() when the handle is null, so each failed ffi.dlopen() leaked the message. Call uv_dlclose() on the failure path, as DLib::Open() does. Signed-off-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Assisted-by: claude:opus-5.5
trivikr
force-pushed
the
ffi-dlopen-failed-memory-leak
branch
from
October 25, 2026 22:21
81fd47c to
4719023
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #67007 +/- ##
==========================================
- Coverage 90.61% 90.59% -0.02%
==========================================
Files 797 797
Lines 278227 278228 +1
Branches 53486 53483 -3
==========================================
- Hits 252103 252064 -39
- Misses 16499 16550 +51
+ Partials 9625 9614 -11
🚀 New features to boost your workflow:
|
daeyeon
approved these changes
Oct 26, 2026
Collaborator
ShogunPanda
approved these changes
Oct 26, 2026
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.
Fixes: #67006
uv_dlopen()allocates an error message on failure, and onlyuv_dlclose()frees it.DynamicLibrary::Close()skipsuv_dlclose()when the handle is null, so every failedffi.dlopen()leaked about 1 KB. This callsuv_dlclose()on the failure path, asDLib::Open()does innode_binding.cc.There's no regression test because a JS test can't reliably catch a leak this size.
Assisted-by: claude:opus-5.5