Skip to content

V5.15.1 proposal#358

Merged
szegedi merged 5 commits into
v5.xfrom
v5.15.1-proposal
Jun 26, 2026
Merged

V5.15.1 proposal#358
szegedi merged 5 commits into
v5.xfrom
v5.15.1-proposal

Conversation

@IlyasShabi

@IlyasShabi IlyasShabi commented Jun 26, 2026

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Overall package size

Self size: 2.19 MB
Deduped: 2.89 MB
No deduping: 2.89 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | pprof-format | 2.2.2 | 500.53 kB | 500.53 kB | | source-map | 0.7.6 | 185.63 kB | 185.63 kB | | node-gyp-build | 4.8.4 | 13.86 kB | 13.86 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@datadog-datadog-prod-us1-2

This comment has been minimized.

szegedi
szegedi previously approved these changes Jun 26, 2026
szegedi and others added 2 commits June 26, 2026 15:58
WallProfiler registers an environment cleanup hook (CleanupHook) via
node::AddEnvironmentCleanupHook so it can stop profiling when a worker
isolate is terminated without a beforeExit notification. On termination,
CleanupHook -> Cleanup -> Dispose called node::RemoveEnvironmentCleanupHook
for that same hook.

Node's cleanup-hook trampoline (CleanupHookThunkRun) invokes the hook and
then dereferences its internal hook record again to remove the hook itself.
Removing the hook from within the hook frees that record early, so when our
callback returns Node reads freed memory — a use-after-free that segfaults
on worker termination (observed reliably on Node 26, exercised by the
"should not crash when worker is terminated" test).

Add a removeCleanupHook flag to Dispose (default true). Cleanup, which only
runs from inside CleanupHook, passes false and lets Node remove the hook
itself. The still-running call sites (StopCore, StartImpl failure) keep
removing it, since there the hook is live and must not fire later against a
destroyed profiler.

Reproduced and verified fixed in an Alpine/musl Node 26 container under gdb:
crashed within 1-2 runs before, 30/30 clean after.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@szegedi szegedi merged commit 110d171 into v5.x Jun 26, 2026
69 checks passed
@szegedi szegedi deleted the v5.15.1-proposal branch June 26, 2026 14:07
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.

2 participants