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

ninja build failed when build with quic #34435

Closed
gengjiawen opened this issue Jul 20, 2020 · 5 comments
Closed

ninja build failed when build with quic #34435

gengjiawen opened this issue Jul 20, 2020 · 5 comments

Comments

@gengjiawen
Copy link
Member

gengjiawen commented Jul 20, 2020

build with:

 ./configure --experimental-quic --ninja
ninja -C out/Release

Result:

[2997/3003] ACTION node: node_mksnapshot_9b7a2d2290b02e76d66661df74749f56
FAILED: gen/node_snapshot.cc 
cd ../../; out/Release/node_mksnapshot out/Release/gen/node_snapshot.cc
double free or corruption (!prev)
Aborted (core dumped)
[2998/3003] LINK cctest
ninja: build stopped: subcommand failed.

Env:

  System:
    OS: Linux 4.4 Ubuntu 20.04 LTS (Focal Fossa)
    Memory: 4.78 GB / 15.67 GB
    Container: Yes
    Shell: 5.0.16 - /bin/bash
  Binaries:
    Node: 14.5.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.5 - /usr/local/bin/npm
  Managers:
    Apt: 2.0.2 - /usr/bin/apt
    Cargo: 1.44.1 - ~/.cargo/bin/cargo
    pip3: 20.1.1 - /usr/local/bin/pip3
  Utilities:
    CMake: 3.17.3 - /usr/local/bin/cmake
    Make: 4.2.1 - /usr/bin/make
    GCC: 9.3.0 - /usr/bin/gcc
    Git: 2.25.1 - /usr/bin/git
    Clang: 10.0.0-4ubuntu1 - /usr/bin/clang
  IDEs:
    Vim: 8.1 - /usr/bin/vim
  Languages:
    Bash: 5.0.16 - /usr/bin/bash
    Perl: 5.30.0 - /usr/bin/perl
    Python: 2.7.18 - /usr/bin/python
    Python3: 3.8.2 - /usr/bin/python3
    R: 3.6.3 - /usr/bin/R
    Rust: 1.44.1 - /root/.cargo/bin/rustc

cc @joyeecheung

@targos
Copy link
Member

targos commented Jul 20, 2020

I cannot reproduce without --experimental-quic. @gengjiawen is that option mandatory to fail the build?

@gengjiawen
Copy link
Member Author

I cannot reproduce without --experimental-quic. @gengjiawen is that option mandatory to fail the build?

I remove the --experimental-quic flag, the build passed. cc @nodejs/quic

@gengjiawen
Copy link
Member Author

Debug stacktrace, Full log: https://github.com/gengjiawen/node-github-workflow/runs/889159038#step:6:4392

cd ../../; out/Debug/node_mksnapshot out/Debug/gen/node_snapshot.cc
=================================================================
==6385==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61f00001f708 at pc 0x000001e3ebcd bp 0x7ffec9b8eb20 sp 0x7ffec9b8eb18
WRITE of size 8 at 0x61f00001f708 thread T0
    #0 0x1e3ebcc in v8::PersistentBase<v8::ObjectTemplate>::PersistentBase(v8::ObjectTemplate*) /__w/node-github-workflow/node-github-workflow/node/out/Debug/../../deps/v8/include/v8.h:606:47
    #1 0x1e00e2b in v8::Global<v8::ObjectTemplate>::Global() /__w/node-github-workflow/node-github-workflow/node/out/Debug/../../deps/v8/include/v8.h:756:24
    #2 0x1d9acbf in node::Environment::Environment(node::IsolateData*, v8::Isolate*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, node::EnvSerializeInfo const*, node::EnvironmentFlags::Flags, node::ThreadId) /__w/node-github-workflow/node-github-workflow/node/out/Debug/../../src/env.cc:310:14
    #3 0x1d9c2a4 in node::Environment::Environment(node::IsolateData*, v8::Local<v8::Context>, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, node::EnvSerializeInfo const*, node::EnvironmentFlags::Flags, node::ThreadId) /__w/node-github-workflow/node-github-workflow/node/out/Debug/../../src/env.cc:414:7
    #4 0x1c6f087 in node::SnapshotBuilder::Generate(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >) /__w/node-github-workflow/node-github-workflow/node/out/Debug/../../tools/snapshot/snapshot_builder.cc:126:17
    #5 0x1c6c696 in main /__w/node-github-workflow/node-github-workflow/node/out/Debug/../../tools/snapshot/node_mksnapshot.cc:53:9
    #6 0x7fee5f3150b2 in __libc_start_main /build/glibc-YYA7BZ/glibc-2.31/csu/../csu/libc-start.c:308:16
    #7 0xe1912d in _start (/__w/node-github-workflow/node-github-workflow/node/out/Debug/node_mksnapshot+0xe1912d)

0x61f00001f708 is located 0 bytes to the right of 3208-byte region [0x61f00001ea80,0x61f00001f708)

@addaleax
Copy link
Member

Maybe --experimental-quic isn’t applied correctly when building the node_mksnapshot binary?

@joyeecheung
Copy link
Member

joyeecheung commented Jul 21, 2020

@addaleax Yeah I am pretty sure it's the case (the NODE_EXPERIMENTAL_QUIC macro isn't defined for the mksnapshot build..come to think of it, neither is mkcodecache) which I guess also loops back to #31074. I'll work on a fix

@gengjiawen gengjiawen changed the title ninja build failed ninja build failed when build with quic Jul 21, 2020
cjihrig pushed a commit that referenced this issue Jul 23, 2020
Otherwise the build would fail with
`./configure --experimental-quic --ninja` as the list of per-Environment
values would not match and the code cache builder would not generate
code cache for the quic JS sources. This is more or less a band-aid -
a proper fix would be to aggregate these flags into something
that can be included by all these different binary targets.
See #31074.

PR-URL: #34454
Fixes: #34435
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
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 a pull request may close this issue.

4 participants