Skip to content

build: define HAVE_INSPECTOR for the libnode target - #67985

Open
marcels68 wants to merge 1 commit into
nodejs:mainfrom
marcels68:build-libnode-have-inspector
Open

marcels68 wants to merge 1 commit into
nodejs:mainfrom
marcels68:build-libnode-have-inspector

Conversation

@marcels68

Copy link
Copy Markdown

The generated node_snapshot.cc is compiled in the libnode target and includes node_options.h, but only node_base gets HAVE_INSPECTOR (via node_inspector.gypi). EnvironmentOptions then has a different layout in the two targets (ODR violation). With LTO, GCC reports -Wodr and node crashed on exit with "free(): invalid pointer" in ~EnvironmentOptions. Set HAVE_INSPECTOR in libnode like node_base.

The generated node_snapshot.cc is compiled in the libnode target and
includes node_options.h, but only node_base gets HAVE_INSPECTOR (via
node_inspector.gypi). EnvironmentOptions then has a different layout
in the two targets (ODR violation). With LTO, GCC reports -Wodr and
node crashed on exit with "free(): invalid pointer" in
~EnvironmentOptions. Set HAVE_INSPECTOR in libnode like node_base.

Signed-off-by: Marcel Schmidt <marcels68@users.noreply.github.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/gyp

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to Node.js builds or CI infrastructure. needs-ci PRs that need a full CI run. labels Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Issues and PRs related to Node.js builds or CI infrastructure. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants