Skip to content

CPU profiles: throw ERR_CPU_PROFILE_NOT_SUPPORTED under Record/Replay - #249

Merged
Domiii merged 2 commits into
mainfrom
dominik/cpu-profile-not-supported
Nov 18, 2026
Merged

Domiii merged 2 commits into
mainfrom
dominik/cpu-profile-not-supported

Conversation

@Domiii

@Domiii Domiii commented Nov 18, 2026 •

Copy link
Copy Markdown

🤖

Summary

  • Under Record/Replay, v8.startCpuProfile() returns a handle whose stop() aborts the process with Assertion failed: args[0]->IsUint32().
  • Starting a CPU profile now throws ERR_CPU_PROFILE_NOT_SUPPORTED instead.
    • This covers both v8.startCpuProfile() and Worker#startCpuProfile().

CPU profiles: unsupported status

  • Cause
    • Commit 68c264c makes V8's CpuProfiler::StartProfiling return kErrorNotSupported while recording or replaying.
    • Both node bindings map only kErrorTooManyProfilers to an error. Any other status left the profile id undefined.
    • StopCpuProfile(undefined) then fails CHECK(args[0]->IsUint32()). The worker path rejected nothing and resolved a handle with no id.
  • Change
    • Environment::CpuProfileStartError maps every CpuProfilingStatus to an error, or to none when there is a profile to stop.
    • Both bindings use it.
    • New error code ERR_CPU_PROFILE_NOT_SUPPORTED.
  • Evidence
  • Under Record/Replay, test-v8-cpu-profile now fails with the thrown error instead of the abort.
    • The backend node-core ignore list is the place for it.

V8 returns kErrorNotSupported from StartProfiling while recording or
replaying (68c264c). v8.startCpuProfile() and Worker#startCpuProfile()
mapped only kErrorTooManyProfilers to an error and returned no id for any
other status, so the handle's stop() aborted on CHECK(args[0]->IsUint32()).
Both now map the status through Environment::CpuProfileStartError, which
raises ERR_CPU_PROFILE_NOT_SUPPORTED for it.
@Domiii Domiii self-assigned this Nov 18, 2026
@Domiii
Domiii merged commit 867c4e0 into main Nov 18, 2026
3 checks passed
@Domiii
Domiii deleted the dominik/cpu-profile-not-supported branch November 18, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant