René's URL Explorer Experiment


Title: inspector: abort (no message) when the main thread posts to an exiting Worker's connectToMainThread() session · Issue #67079 · nodejs/node · GitHub

Open Graph Title: inspector: abort (no message) when the main thread posts to an exiting Worker's connectToMainThread() session · Issue #67079 · nodejs/node

X Title: inspector: abort (no message) when the main thread posts to an exiting Worker's connectToMainThread() session · Issue #67079 · nodejs/node

Description: Version v24.21.0, v24.22.1. src/inspector/main_thread_interface.cc is unchanged through v26.12.1 and main (ec7a28f). Platform Linux x64 (Ubuntu 24.04), official nodejs.org binaries Subsystem inspector, worker What steps will reproduce th...

Open Graph Description: Version v24.21.0, v24.22.1. src/inspector/main_thread_interface.cc is unchanged through v26.12.1 and main (ec7a28f). Platform Linux x64 (Ubuntu 24.04), official nodejs.org binaries Subsystem inspec...

X Description: Version v24.21.0, v24.22.1. src/inspector/main_thread_interface.cc is unchanged through v26.12.1 and main (ec7a28f). Platform Linux x64 (Ubuntu 24.04), official nodejs.org binaries Subsystem inspec...

Opengraph URL: https://github.com/nodejs/node/issues/67079

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"inspector: abort (no message) when the main thread posts to an exiting Worker's connectToMainThread() session","articleBody":"### Version\n\nv24.21.0, v24.22.1. `src/inspector/main_thread_interface.cc` is unchanged through v26.12.1 and `main` (ec7a28f2).\n\n### Platform\n\nLinux x64 (Ubuntu 24.04), official nodejs.org binaries\n\n### Subsystem\n\ninspector, worker\n\n### What steps will reproduce the bug?\n\nA Worker opens `new inspector.Session().connectToMainThread()` and exits while the main thread still has something to post back to that session: a protocol reply or event, or the delete it sends when the main-thread side of the session is destroyed after `session.disconnect()`.\n\n[`test/parallel/test-inspector-connect-to-main-thread.js`](https://github.com/nodejs/node/blob/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de/test/parallel/test-inspector-connect-to-main-thread.js#L16-L19) is the minimal form: connect, disconnect, exit.\n\n### How often does it reproduce? Is there a required condition?\n\nRarely. It needs a narrow native interleaving, and there is no deterministic JS reproduction. Seen twice in CI, in a suite that repeatedly connects, pauses and disconnects Worker sessions to the main thread. Node's CI has seen the test above crash with exit code -6 and no output (#54804, closed as a duplicate of #40611). With no native stack there, I can't confirm it is this bug.\n\nRequired condition: the main thread posts to the Worker's handle, while the Worker's request queue is empty, after the Worker's `MainThreadInterface` use count reaches zero and before `~MainThreadInterface` resets the handle.\n\n### What is the expected behavior? Why is that the expected behavior?\n\nNo crash. Posting to a thread that is going away is meant to be tolerated: `MainThreadHandle::Post` returns `false` once the handle is reset ([main_thread_interface.cc#L317-L323](https://github.com/nodejs/node/blob/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de/src/inspector/main_thread_interface.cc#L317-L323)), and `~AnotherThreadObjectReference` posts unconditionally, noting \"Disappearing thread may cause a memory leak\" ([#L101-L104](https://github.com/nodejs/node/blob/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de/src/inspector/main_thread_interface.cc#L101-L104)). The test above says \"Do not crash\".\n\n### What do you see instead?\n\nSIGABRT, with no Node error message. Main thread, v24.21.0 (gdb on the core):\n\n```text\n#2  abort ()\n#3  node::inspector::MainThreadInterface::Post(...) [clone .cold]\n#4  node::inspector::(anonymous namespace)::ThreadSafeDelegate::SendMessageToFrontend(...)\n#5  node::inspector::(anonymous namespace)::ChannelImpl::sendResponse(...)\n...\n#8  v8_inspector::protocol::Debugger::DomainDispatcherImpl::pause(...)\n...\n#14 node::inspector::MainThreadInterface::DispatchMessages() [clone .part.0]\n```\n\nThe Worker's thread at the same moment:\n\n```text\n#2  uv_mutex_lock\n#3  node::inspector::MainThreadInterface::~MainThreadInterface()\n#4  std::_Sp_counted_base\u003c...>::_M_release_last_use_cold()\n#5  node::inspector::NodeInspectorClient::~NodeInspectorClient()\n...\n#7  node::Environment::~Environment()\n#9  node::FreeEnvironment(node::Environment*)\n#10 node::worker::Worker::Run()\n```\n\nOn v24.22.1 the Worker's thread is the same, and the main thread's post comes from the session's deletion instead: `MainThreadInterface::RemoveObject` → `~SameThreadInspectorSession` → `~ChannelImpl` → `~ThreadSafeDelegate` → `MainThreadInterface::Post [clone .cold]` → `abort`.\n\n### Additional information\n\nCause, at ec7a28f2:\n\n- `MainThreadHandle::Post` holds `block_lock_` and forwards only while `main_thread_` is set ([L317-L323](https://github.com/nodejs/node/blob/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de/src/inspector/main_thread_interface.cc#L317-L323)). `main_thread_` is cleared only by `~MainThreadInterface` ([L202-L205](https://github.com/nodejs/node/blob/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de/src/inspector/main_thread_interface.cc#L202-L205)), which runs after the interface's only long-lived owner, `NodeInspectorClient::interface_` ([inspector_agent.cc#L840](https://github.com/nodejs/node/blob/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de/src/inspector_agent.cc#L840)), has dropped the use count to zero.\n- In that window, `MainThreadInterface::Post` calls `shared_from_this()` when its queue is empty ([L213](https://github.com/nodejs/node/blob/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de/src/inspector/main_thread_interface.cc#L213)). Node builds with `-fno-exceptions` ([common.gypi#L605](https://github.com/nodejs/node/blob/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de/common.gypi#L605)), so the expired `shared_from_this()` aborts instead of throwing `std::bad_weak_ptr`. In the official v24.21.0 linux-x64 binary, `Post`'s cold block (`0x7812c0`: `call abort@plt`) is reached only from that call's two `bad_weak_ptr` branches, and the captured return address is `0x7812c5`. The Worker above is waiting in `Reset()` for `block_lock_`, which the main thread holds.\n- `disconnect()` returns once the delete is queued on the main thread (the delegate is \"destroyed asynchronously\", #46942), and nothing tells the Worker when the main thread is done with the session. A Worker that exits right after `disconnect()`, as the test does, can hit this.\n\nEvery cross-thread post to a Worker's interface goes through these two functions, so a fix there covers the reply, event and delete paths. Fix idea: reset the handle while the interface is still owned, for example in `~NodeInspectorClient` before `interface_` is released, so a racing post takes the existing `return false` path. Using `weak_from_this()` at L213 would also remove the abort.\n\nDisclosure: this report was drafted and posted by an AI coding agent (Claude Code) at the direction of @nick-inkeep, who decided to file it. Before posting, a second, independent agent re-checked every linked source line at ec7a28f2, the duplicate searches, both stacks (symbol-mapped against the official v24.21.0 and v24.22.1 linux-x64 binaries) and the disassembly.\n","author":{"url":"https://github.com/nick-inkeep","@type":"Person","name":"nick-inkeep"},"datePublished":"2026-10-28T08:44:34Z","url":"https://github.com/nodejs/node/issues/67079"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d020c579-2ae3-0fe8-f0b1-09191b82c22b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id801E:FBBFE:743779:96DCD5:6B06288A
html-safe-noncec61b167906ee53036c7a7b87ffbe557cb29339ffbead3334d413b4fb086e46ab
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDFFOkZCQkZFOjc0Mzc3OTo5NkRDRDU6NkIwNjI4OEEiLCJ2aXNpdG9yX2lkIjoiMTE1OTgxMzA1NjMwNjc1MTYyNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac874c5f8f4a0798c0f4535836fbeb8b492b5855e62acee83ece7b00985b95b119
hovercard-subject-tagissue:6075557690
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/67079/issue_layout
twitter:imagehttps://opengraph.githubassets.com/cd7a5128d955994bd954d135f2c295d59045ee397e237d2160c0568c7fdb0be6/nodejs/node/issues/67079
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/cd7a5128d955994bd954d135f2c295d59045ee397e237d2160c0568c7fdb0be6/nodejs/node/issues/67079
og:image:altVersion v24.21.0, v24.22.1. src/inspector/main_thread_interface.cc is unchanged through v26.12.1 and main (ec7a28f). Platform Linux x64 (Ubuntu 24.04), official nodejs.org binaries Subsystem inspec...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamenick-inkeep
hostnamegithub.com
expected-hostnamegithub.com
None9e10bb0ecc0bd0f8692aa89586ee9b54e498d7ab9f244a44cdb5b93653a125ce
turbo-cache-controlno-preview
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release32e57d5cc2ce6ce92ec6dceb65858344750c27c2
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/67079#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F67079
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F67079
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/issues/67079
Reloadhttps://github.com/nodejs/node/issues/67079
Reloadhttps://github.com/nodejs/node/issues/67079
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues630 (630)https://github.com/nodejs/node/issues
Pull requests660 (660)https://github.com/nodejs/node/pulls
Actionshttps://github.com/nodejs/node/actions
Projectshttps://github.com/nodejs/node/projects
Security and qualityhttps://github.com/nodejs/node/security
Insightshttps://github.com/nodejs/node/insights
https://github.com/nodejs/node
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/67079
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/67079
#67281https://github.com/nodejs/node/pull/67281
inspector: abort (no message) when the main thread posts to an exiting Worker's connectToMainThread() sessionhttps://github.com/nodejs/node/issues/67079#top
#67281https://github.com/nodejs/node/pull/67281
https://github.com/nick-inkeep
nick-inkeephttps://github.com/nick-inkeep
on Oct 28, 2026https://github.com/nodejs/node/issues/67079#issue-6075557690
ec7a28fhttps://github.com/nodejs/node/commit/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de
test/parallel/test-inspector-connect-to-main-thread.jshttps://github.com/nodejs/node/blob/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de/test/parallel/test-inspector-connect-to-main-thread.js#L16-L19
#54804https://github.com/nodejs/node/issues/54804
#40611https://github.com/nodejs/node/issues/40611
main_thread_interface.cc#L317-L323https://github.com/nodejs/node/blob/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de/src/inspector/main_thread_interface.cc#L317-L323
#L101-L104https://github.com/nodejs/node/blob/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de/src/inspector/main_thread_interface.cc#L101-L104
ec7a28fhttps://github.com/nodejs/node/commit/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de
L317-L323https://github.com/nodejs/node/blob/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de/src/inspector/main_thread_interface.cc#L317-L323
L202-L205https://github.com/nodejs/node/blob/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de/src/inspector/main_thread_interface.cc#L202-L205
inspector_agent.cc#L840https://github.com/nodejs/node/blob/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de/src/inspector_agent.cc#L840
L213https://github.com/nodejs/node/blob/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de/src/inspector/main_thread_interface.cc#L213
common.gypi#L605https://github.com/nodejs/node/blob/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de/common.gypi#L605
inspector: fix session.disconnect crash #46942https://github.com/nodejs/node/pull/46942
@nick-inkeephttps://github.com/nick-inkeep
ec7a28fhttps://github.com/nodejs/node/commit/ec7a28f2e074f0ea16ecd4d2a3511b334fa4b0de
ymichaelhttps://github.com/ymichael
on Oct 30, 2026https://github.com/nodejs/node/issues/67079#event-34740359083
Drain inspector cleanup before exiting CPU profiling workers (#6733)https://github.com/get-bb/bb/commit/fa39bbed10e3376a5e75f80415faa698d3ec0c2f
#6733https://github.com/get-bb/bb/pull/6733
fa39bbehttps://github.com/get-bb/bb/commit/fa39bbed10e3376a5e75f80415faa698d3ec0c2f
fatihguzeldevhttps://github.com/fatihguzeldev
on Nov 5, 2026https://github.com/nodejs/node/issues/67079#event-35276343342
inspector: disconnect handles before releasing interfaceshttps://github.com/fatihguzeldev/node/commit/4331dc04c5710ad81c19ad282fb0725d8864b3b3
4331dc0https://github.com/fatihguzeldev/node/commit/4331dc04c5710ad81c19ad282fb0725d8864b3b3
nodejs-github-bothttps://github.com/nodejs-github-bot
completedhttps://github.com/nodejs/node/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
f4e89e7https://github.com/nodejs/node/commit/f4e89e70dd3622570b70562a7a2132e9b32d50c4
on Nov 12, 2026https://github.com/nodejs/node/issues/67079#event-35952053911
jasnellhttps://github.com/jasnell
on Nov 12, 2026https://github.com/nodejs/node/issues/67079#event-35953188798
inspector: disconnect handles before releasing interfaceshttps://github.com/jasnell/node/commit/f4e89e70dd3622570b70562a7a2132e9b32d50c4
f4e89e7https://github.com/jasnell/node/commit/f4e89e70dd3622570b70562a7a2132e9b32d50c4
aduh95https://github.com/aduh95
on Nov 19, 2026https://github.com/nodejs/node/issues/67079#event-36667019134
inspector: disconnect handles before releasing interfaceshttps://github.com/nodejs/node/commit/28cb3cbcc93a7b979e1101e3bb1b08afd9dddf64
28cb3cbhttps://github.com/nodejs/node/commit/28cb3cbcc93a7b979e1101e3bb1b08afd9dddf64
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/67079
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/67079
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.