FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

inspector: fix session.disconnect crash by theanarkh · Pull Request #46942 · nodejs/node · GitHub

/ node Public

inspector: fix session.disconnect crash - #46942

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
theanarkh:fix_session_disconnect_crash
Mar 14, 2023
Merged

inspector: fix session.disconnect crash#46942
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
theanarkh:fix_session_disconnect_crash

Conversation

theanarkh commented Mar 3, 2023
edited
Loading

Copy link
Copy Markdown
Contributor

fix session.disconnect crash.

When worker calls session.disconnect(), JSBindingsSessionDelegate will be destroyed asynchronously, so we need to make sure that JSBindingsConnection is destroyed after JSBindingsSessionDelegate.

The test is as follows.

const { Session } = require('inspector');
const { Worker, isMainThread } = require('worker_threads'); 

if (isMainThread) {
  new Worker(__filename);
} else {
  const session = new Session();
  session.connectToMainThread();
  session.disconnect();
}

The error message is as follows.

../src/base_object-inl.h:52:virtual node::BaseObject::~BaseObject(): Assertion `(metadata->strong_ptr_count) == (0)' failed.
 1: 0x1029e5de8 node::Abort() [/usr/local/bin/node]
 2: 0x1029e5c36 node::AppendExceptionLine(node::Environment*, v8::Local<v8::Value>, v8::Local<v8::Message>, node::ErrorHandlingMode) [/usr/local/bin/node]
 3: 0x10294c6ec node::AsyncWrap::~AsyncWrap() [/usr/local/bin/node]
 4: 0x102aa77be node::inspector::(anonymous namespace)::JSBindingsConnection<node::inspector::(anonymous namespace)::MainThreadConnection>::~JSBindingsConnection() [/usr/local/bin/node]
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. inspector Issues and PRs related to the V8 inspector protocol needs-ci PRs that need a full CI run. labels Mar 3, 2023
theanarkh force-pushed the fix_session_disconnect_crash branch from c38daf7 to 626e3ce Compare March 3, 2023 20:07

juanarbol left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

cola119 added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 4, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 4, 2023

Copy link
Copy Markdown
Collaborator

theanarkh force-pushed the fix_session_disconnect_crash branch from 626e3ce to ee09149 Compare March 4, 2023 02:01
theanarkh added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 4, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 4, 2023

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Contributor Author

@addaleax Hi, can you help review this PR ? thanks !

Comment thread src/inspector_js_api.cc Outdated
Comment thread src/inspector_js_api.cc Outdated
theanarkh force-pushed the fix_session_disconnect_crash branch from ee09149 to 20c3a37 Compare March 14, 2023 16:28
theanarkh force-pushed the fix_session_disconnect_crash branch from 20c3a37 to eefabde Compare March 14, 2023 16:32
addaleax added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 14, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 14, 2023

Copy link
Copy Markdown
Collaborator

theanarkh added the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 14, 2023
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 14, 2023
nodejs-github-bot merged commit f543c05 into nodejs:main Mar 14, 2023

Copy link
Copy Markdown
Collaborator

Landed in f543c05

targos pushed a commit that referenced this pull request Mar 18, 2023
PR-URL: #46942
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
danielleadams pushed a commit that referenced this pull request Jul 6, 2023
PR-URL: #46942
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
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

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. inspector Issues and PRs related to the V8 inspector protocol needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL