Repository navigation
inspector: disconnect handles before releasing interfaces - #67281
Open
fatihguzeldev wants to merge 1 commit into
Open
fatihguzeldev wants to merge 1 commit into
fatihguzeldev wants to merge 1 commit into
Conversation
Collaborator
|
Review requested:
|
Disconnect the thread handle while NodeInspectorClient still owns the interface. This prevents cross-thread posts from calling shared_from_this() after the interface's last strong reference has been released. Add a regression test verifying handle expiration during owner teardown. Fixes: nodejs#67079 Signed-off-by: Fatih Güzel <fatihguzeldev@gmail.com>
fatihguzeldev
force-pushed
the
inspector-worker-teardown
branch
from
November 5, 2026 19:02
c2339b4 to
4331dc0
Compare
Contributor
Author
|
i haven't been able to reproduce the original crash. the test deliberately keeps the interface alive during owner teardown so its destructor cannot close the handle and hide the missing disconnect. this lets us check that the owner closes the handle without depending on hitting the race. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #67281 +/- ##
==========================================
+ Coverage 90.66% 90.67% +0.01%
==========================================
Files 797 797
Lines 279382 279513 +131
Branches 53746 53772 +26
==========================================
+ Hits 253306 253453 +147
+ Misses 16357 16354 -3
+ Partials 9719 9706 -13
🚀 New features to boost your workflow:
|
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.
the handle currently gets reset in the interface destructor. by then, the last strong reference is already gone, so a concurrent post can reach
shared_from_this()and fail withstd::bad_weak_ptr.this disconnects the handle while the inspector client still owns the interface. also adds a regression test that keeps the interface alive after client teardown and checks that the handle has expired and rejects further posts.
fixes: #67079