Skip to content

src: add SetAbortHandler#64684

Open
maxhfisher wants to merge 2 commits into
nodejs:mainfrom
maxhfisher:aborthandler
Open

src: add SetAbortHandler#64684
maxhfisher wants to merge 2 commits into
nodejs:mainfrom
maxhfisher:aborthandler

Conversation

@maxhfisher

Copy link
Copy Markdown

This adds SetAbortHandler, which allows embedders to specify custom behavior in situations where ABORT() is called. The current behavior of ABORT() is to stream both the native and JS backtraces to stderr and exit with platform specific behavior. Some embedders may want to change this behavior, such as changing where the backtrace is provided. Embedders can also use the handler to exit with their own behavior, but node will still guarantee an exit with the current behavior if the provided abort handler returns.

A DefaultAbortHandler is used to ensure existing behavior does not change unless an abort handler is explicitly provided. The only difference with this design is an additional stack frame in the backtrace for the abort handler, but this behavior was never guaranteed.

Signed-off-by: Max H Fisher <mfisher187@bloomberg.net>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/gyp

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants