inspector: fix crash when the IsolateData has no platform - #65818
Open
codebytere wants to merge 1 commit into
Open
inspector: fix crash when the IsolateData has no platform#65818codebytere wants to merge 1 commit into
codebytere wants to merge 1 commit into
Conversation
Collaborator
|
Review requested:
|
Collaborator
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #65818 +/- ##
==========================================
- Coverage 90.19% 90.19% -0.01%
==========================================
Files 770 770
Lines 264410 264413 +3
Branches 50243 50236 -7
==========================================
- Hits 238490 238477 -13
- Misses 16924 16964 +40
+ Partials 8996 8972 -24
🚀 New features to boost your workflow:
|
An embedder that creates its IsolateData without a MultiIsolatePlatform (allowed; node.h says only Workers need one) and keeps the inspector segfaulted on the first `console.log()`, `console.time()` or profiler use after a `node:inspector` session was connected: V8 calls the inspector client's `currentTimeMS()` there, and `NodeInspectorClient::currentTimeMS()` dereferenced `isolate_data()->platform()` unconditionally. Fall back to the wall clock when there is no platform, which is what `NodePlatform::CurrentClockTimeMillis()` returns anyway. Refs: nodejs#21917 Signed-off-by: Shelley Vohr <[email protected]>
codebytere
force-pushed
the
fix/embedder-inspector-null-platform
branch
from
September 5, 2026 17:56
da2dc82 to
7656a6f
Compare
Collaborator
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.
An embedder that creates its
IsolateDatawithout aMultiIsolatePlatform(node.h allows that and says only Workers need one) and keeps the inspector segfaults as soon as anode:inspectorsession is connected and the page logs: forconsole.log(),console.time()and the profilers V8 calls the inspector client'scurrentTimeMS(), andNodeInspectorClient::currentTimeMS()dereferencedisolate_data()->platform()unconditionally.It now falls back to the wall clock when there is no platform, which is what
NodePlatform::CurrentClockTimeMillis()returns anyway. This is the only place the inspector reaches for the platform; the Worker path already throwsERR_MISSING_PLATFORM_FOR_WORKER.Tests:
EnvironmentTest.InspectorWithoutPlatformcreates anIsolateDatawithout a platform, connects a session and callsconsole.time(); it segfaults before the change.Refs: #21917
Disclosure: the code, test and this description were written by Claude Code, directed and reviewed by @codebytere.