Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node_mksnapshot debug build segfault #53446

Closed
legendecas opened this issue Jun 13, 2024 · 0 comments · Fixed by #53511 or #53605
Closed

node_mksnapshot debug build segfault #53446

legendecas opened this issue Jun 13, 2024 · 0 comments · Fixed by #53511 or #53605
Labels
build Issues and PRs related to build files or the CI. macos Issues and PRs related to the macOS platform / OSX. snapshot Issues and PRs related to the startup snapshot

Comments

@legendecas
Copy link
Member

Version

main branch

Platform

Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64

Subsystem

mksnapshot

What steps will reproduce the bug?

./configure
make BUILDTYPE=Debug

How often does it reproduce? Is there a required condition?

always

What is the expected behavior? Why is that the expected behavior?

No response

What do you see instead?

SIGSEGV on node_mksnapshot

node_mksnapshot!v8::internal::Isolate::set_current_vm_state(v8::StateTag) (/Volumes/K/Developer/nodejs/node/deps/v8/src/execution/isolate.h:1451)
node_mksnapshot!v8::internal::VMState<(v8::StateTag)5>::VMState(v8::internal::Isolate*) (/Volumes/K/Developer/nodejs/node/deps/v8/src/execution/vm-state-inl.h:46)
node_mksnapshot!v8::internal::VMState<(v8::StateTag)5>::VMState(v8::internal::Isolate*) (/Volumes/K/Developer/nodejs/node/deps/v8/src/execution/vm-state-inl.h:45)
node_mksnapshot!v8::FunctionTemplate::New(v8::Isolate*, void (*)(v8::FunctionCallbackInfo<v8::Value> const&), v8::Local<v8::Value>, v8::Local<v8::Signature>, int, v8::ConstructorBehavior, v8::SideEffectType, v8::CFunction const*, unsigned short, unsigned short, unsigned short) (/Volumes/K/Developer/nodejs/node/deps/v8/src/api/api.cc:1359)
node_mksnapshot!node::NewFunctionTemplate(v8::Isolate*, void (*)(v8::FunctionCallbackInfo<v8::Value> const&), v8::Local<v8::Signature>, v8::ConstructorBehavior, v8::SideEffectType, v8::CFunction const*) (/Volumes/K/Developer/nodejs/node/src/util.cc:378)
node_mksnapshot!node::StreamBase::AddMethod(v8::Isolate*, v8::Local<v8::Signature>, v8::PropertyAttribute, v8::Local<v8::FunctionTemplate>, void (*)(v8::FunctionCallbackInfo<v8::Value> const&), v8::Local<v8::String>) (/Volumes/K/Developer/nodejs/node/src/stream_base.cc:502)
node_mksnapshot!node::StreamBase::AddMethods(node::IsolateData*, v8::Local<v8::FunctionTemplate>) (/Volumes/K/Developer/nodejs/node/src/stream_base.cc:524)
node_mksnapshot!node::fs::CreatePerIsolateProperties(node::IsolateData*, v8::Local<v8::ObjectTemplate>) (/Volumes/K/Developer/nodejs/node/src/node_file.cc:3229)
node_mksnapshot!_register_isolate_fs(node::IsolateData*, v8::Local<v8::ObjectTemplate>) (/Volumes/K/Developer/nodejs/node/src/node_file.cc:3318)
node_mksnapshot!node::binding::CreateInternalBindingTemplates(node::IsolateData*) (/Volumes/K/Developer/nodejs/node/src/node_binding.cc:587)
node_mksnapshot!node::IsolateData::CreateProperties() (/Volumes/K/Developer/nodejs/node/src/env.cc:517)
node_mksnapshot!node::IsolateData::IsolateData(v8::Isolate*, uv_loop_s*, node::MultiIsolatePlatform*, node::ArrayBufferAllocator*, node::SnapshotData const*) (/Volumes/K/Developer/nodejs/node/src/env.cc:591)
node_mksnapshot!node::IsolateData::IsolateData(v8::Isolate*, uv_loop_s*, node::MultiIsolatePlatform*, node::ArrayBufferAllocator*, node::SnapshotData const*) (/Volumes/K/Developer/nodejs/node/src/env.cc:538)
node_mksnapshot!node::CreateIsolateData(v8::Isolate*, uv_loop_s*, node::MultiIsolatePlatform*, node::ArrayBufferAllocator*, node::EmbedderSnapshotData const*) (/Volumes/K/Developer/nodejs/node/src/api/environment.cc:409)
node_mksnapshot!node::CommonEnvironmentSetup::CommonEnvironmentSetup(node::MultiIsolatePlatform*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>*, node::EmbedderSnapshotData const*, unsigned int, std::__1::function<node::Environment* (node::CommonEnvironmentSetup const*)>, node::SnapshotConfig const*) (/Volumes/K/Developer/nodejs/node/src/api/embed_helpers.cc:157)
node_mksnapshot!node::CommonEnvironmentSetup::CommonEnvironmentSetup(node::MultiIsolatePlatform*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>*, node::EmbedderSnapshotData const*, unsigned int, std::__1::function<node::Environment* (node::CommonEnvironmentSetup const*)>, node::SnapshotConfig const*) (/Volumes/K/Developer/nodejs/node/src/api/embed_helpers.cc:110)
node_mksnapshot!node::CommonEnvironmentSetup::CreateForSnapshotting(node::MultiIsolatePlatform*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, node::SnapshotConfig const&) (/Volumes/K/Developer/nodejs/node/src/api/embed_helpers.cc:201)
node_mksnapshot!node::BuildSnapshotWithoutCodeCache(node::SnapshotData*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, std::__1::optional<std::__1::basic_string_view<char, std::__1::char_traits<char>>>, node::SnapshotConfig const&) (/Volumes/K/Developer/nodejs/node/src/node_snapshotable.cc:977)
node_mksnapshot!node::SnapshotBuilder::Generate(node::SnapshotData*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, std::__1::optional<std::__1::basic_string_view<char, std::__1::char_traits<char>>>, node::SnapshotConfig const&) (/Volumes/K/Developer/nodejs/node/src/node_snapshotable.cc:1067)
node_mksnapshot!node::SnapshotBuilder::GenerateAsSource(char const*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, node::SnapshotConfig const&, bool) (/Volumes/K/Developer/nodejs/node/src/node_snapshotable.cc:1227)

Additional information

Bisected to #51362.

@legendecas legendecas added the snapshot Issues and PRs related to the startup snapshot label Jun 13, 2024
@RedYetiDev RedYetiDev added the build Issues and PRs related to build files or the CI. label Jun 13, 2024
@legendecas legendecas added the macos Issues and PRs related to the macOS platform / OSX. label Jun 14, 2024
targos pushed a commit that referenced this issue Jun 25, 2024
Release and Debug build configurations can not be shared, only
generate specified configuration in `configure`.

PR-URL: #53511
Fixes: #53446
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
nodejs-github-bot pushed a commit that referenced this issue Jul 23, 2024
Gyp generated build files can be built in either Release/Debug mode.

- make: single directory, two configurations by cli:
  `make -C out BUILDTYPE=Release` and `make -C out BUILDTYPE=Debug`.
- msbuild: single directory, two configurations by cli:
  `msbuild node.sln /p:Configuration=Release` and
  `msbuild node.sln /p:Configuration=Debug`.
- ninja: two directories in `out/`, build with
  `ninja -C out/Release` or `ninja -C out/Debug`.

Variables that changes with either Release or Debug configuration
should be defined in a configuration level, instead of the root level.
This fixes generating invalid build files.

Additionally, `v8_gypfiles/toolchain.gypi` duplicates defines in
`v8_gypfiles/features.gypi`. Remove the duplications in
`toolchains.gypi`

PR-URL: #53605
Fixes: #53446
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this issue Jul 28, 2024
Gyp generated build files can be built in either Release/Debug mode.

- make: single directory, two configurations by cli:
  `make -C out BUILDTYPE=Release` and `make -C out BUILDTYPE=Debug`.
- msbuild: single directory, two configurations by cli:
  `msbuild node.sln /p:Configuration=Release` and
  `msbuild node.sln /p:Configuration=Debug`.
- ninja: two directories in `out/`, build with
  `ninja -C out/Release` or `ninja -C out/Debug`.

Variables that changes with either Release or Debug configuration
should be defined in a configuration level, instead of the root level.
This fixes generating invalid build files.

Additionally, `v8_gypfiles/toolchain.gypi` duplicates defines in
`v8_gypfiles/features.gypi`. Remove the duplications in
`toolchains.gypi`

PR-URL: #53605
Fixes: #53446
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
RafaelGSS pushed a commit that referenced this issue Aug 5, 2024
Gyp generated build files can be built in either Release/Debug mode.

- make: single directory, two configurations by cli:
  `make -C out BUILDTYPE=Release` and `make -C out BUILDTYPE=Debug`.
- msbuild: single directory, two configurations by cli:
  `msbuild node.sln /p:Configuration=Release` and
  `msbuild node.sln /p:Configuration=Debug`.
- ninja: two directories in `out/`, build with
  `ninja -C out/Release` or `ninja -C out/Debug`.

Variables that changes with either Release or Debug configuration
should be defined in a configuration level, instead of the root level.
This fixes generating invalid build files.

Additionally, `v8_gypfiles/toolchain.gypi` duplicates defines in
`v8_gypfiles/features.gypi`. Remove the duplications in
`toolchains.gypi`

PR-URL: #53605
Fixes: #53446
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this issue Sep 21, 2024
Gyp generated build files can be built in either Release/Debug mode.

- make: single directory, two configurations by cli:
  `make -C out BUILDTYPE=Release` and `make -C out BUILDTYPE=Debug`.
- msbuild: single directory, two configurations by cli:
  `msbuild node.sln /p:Configuration=Release` and
  `msbuild node.sln /p:Configuration=Debug`.
- ninja: two directories in `out/`, build with
  `ninja -C out/Release` or `ninja -C out/Debug`.

Variables that changes with either Release or Debug configuration
should be defined in a configuration level, instead of the root level.
This fixes generating invalid build files.

Additionally, `v8_gypfiles/toolchain.gypi` duplicates defines in
`v8_gypfiles/features.gypi`. Remove the duplications in
`toolchains.gypi`

PR-URL: #53605
Fixes: #53446
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
jazelly pushed a commit to jazelly/node that referenced this issue Oct 2, 2024
Gyp generated build files can be built in either Release/Debug mode.

- make: single directory, two configurations by cli:
  `make -C out BUILDTYPE=Release` and `make -C out BUILDTYPE=Debug`.
- msbuild: single directory, two configurations by cli:
  `msbuild node.sln /p:Configuration=Release` and
  `msbuild node.sln /p:Configuration=Debug`.
- ninja: two directories in `out/`, build with
  `ninja -C out/Release` or `ninja -C out/Debug`.

Variables that changes with either Release or Debug configuration
should be defined in a configuration level, instead of the root level.
This fixes generating invalid build files.

Additionally, `v8_gypfiles/toolchain.gypi` duplicates defines in
`v8_gypfiles/features.gypi`. Remove the duplications in
`toolchains.gypi`

PR-URL: nodejs#53605
Fixes: nodejs#53446
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
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 build files or the CI. macos Issues and PRs related to the macOS platform / OSX. snapshot Issues and PRs related to the startup snapshot
Projects
None yet
2 participants