mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 18:25:13 +08:00
Requiring `node:trace_events` and calling `createTracing()` aborted the process, and `getEnabledCategories()` dereferenced a null pointer, when Node.js runs on an embedder's own platform (`kNoInitializeNodeV8Platform`): no `tracing::Agent` exists then, and `lib/trace_events.js` only checked the compile-time `hasTracing` flag and `ownsProcessState` before handing the null agent to the binding. Have the binding report whether an agent exists and throw the existing `ERR_TRACE_EVENTS_UNAVAILABLE` when it does not, as for a `--without-v8-platform` build. Refs: https://github.com/nodejs/node/pull/19803 Signed-off-by: Shelley Vohr <shelley.vohr@gmail.com> PR-URL: https://github.com/nodejs/node/pull/65954 Reviewed-By: Chengzhong Wu <legendecas@gmail.com>