inspector: fix crash when the IsolateData has no platform · nodejs/node@843a277 · GitHub
Skip to content

Commit 843a277

Browse files
codebytereaduh95
authored andcommitted
inspector: fix crash when the IsolateData has no platform
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: #21917 Signed-off-by: Shelley Vohr <shelley.vohr@gmail.com> PR-URL: #65818 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 7a2f322 commit 843a277

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

‎src/inspector_agent.cc‎

Lines changed: 3 additions & 1 deletion

‎test/cctest/test_environment.cc‎

Lines changed: 28 additions & 0 deletions

0 commit comments

Comments
 (0)