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

build: use Clang 12 for test-asan workflow #40238

Closed
wants to merge 1 commit into from

Conversation

targos
Copy link
Member

@targos targos commented Sep 28, 2021

I have issues with the default (version 11) in the PR to update V8: #39945
I hope it will fail here too and someone knows how to fix it :)

@nodejs-github-bot nodejs-github-bot added the meta Issues and PRs related to the general management of the project. label Sep 28, 2021
@targos

This comment has been minimized.

@targos
Copy link
Member Author

targos commented Sep 28, 2021

/cc @addaleax @gengjiawen

Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish I could tell you how to fix this :) It’s good that it’s reproducible, though.

@targos targos mentioned this pull request Sep 28, 2021
Copy link
Contributor

@RaisinTen RaisinTen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@targos does asan still complain when we replace memcpys with memmoves?

diff --git a/deps/zlib/zutil.h b/deps/zlib/zutil.h
index 4425bcf75e..312f350011 100644
--- a/deps/zlib/zutil.h
+++ b/deps/zlib/zutil.h
@@ -238,7 +238,7 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
 #    define zmemcmp _fmemcmp
 #    define zmemzero(dest, len) _fmemset(dest, 0, len)
 #  else
-#    define zmemcpy memcpy
+#    define zmemcpy memmove
 #    define zmemcmp memcmp
 #    define zmemzero(dest, len) memset(dest, 0, len)
 #  endif

@targos
Copy link
Member Author

targos commented Sep 28, 2021

@RaisinTen feel free to push to my branch to try

@targos
Copy link
Member Author

targos commented Sep 29, 2021

@addaleax What do you think we should do, then? If I land this, test-asan will be red until someone fixes the issue.

@addaleax
Copy link
Member

@targos I think somebody needs to reproduce this locally, then figure out which zlib calls exactly are leading to this error. :/

@targos targos added blocked PRs that are blocked by other issues or PRs. help wanted Issues that need assistance from volunteers or PRs that need help to proceed. labels Sep 29, 2021
LINK: clang++
CC: clang-12
CXX: clang++-12
LINK: clang++-12
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it doesn't seem useful. /cc @mmarchini

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember why LINK was necessary (to force clang linker instead of ld when linking? idk that's the only thing I can think of). We can always remove and see what happens

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think it was more of a GitHub Actions thing and less of a gnu thing

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I remember now. ld would consume too much memory for ASAN to be possible on Actions, given the size of the instances available (see #32776). I'm almost sure LINK is not standard but is used by gyp. What I'm not entirely sure is if CXX being set to clang++-12 is enough. Again, someone would need to experiment (specifically looking at peak memory usage when LINK is set or not).

@gengjiawen
Copy link
Member

@targos I think somebody needs to reproduce this locally, then figure out which zlib calls exactly are leading to this error. :/

@addaleax This will trigger the ASAN error. Make sure tools/doc/node_modules is empty.

./configure --debug --ninja --enable-asan
make doc BUILDTYPE=Debug V=1

Also I am confused why it's not using debug node since I pass BUILDTYPE=Debug ? cc @nodejs/build-files

@richardlau
Copy link
Member

Also I am confused why it's not using debug node since I pass BUILDTYPE=Debug ? cc @nodejs/build-files

BUILDTYPE=Debug has historically built both debug and release (as opposed to only building debug) -- I don't know why. It's a known issue that tests, etc. are assuming release.

@gengjiawen
Copy link
Member

@targos I think somebody needs to reproduce this locally, then figure out which zlib calls exactly are leading to this error. :/

@addaleax This will trigger the ASAN error. Make sure tools/doc/node_modules is empty.

./configure --debug --ninja --enable-asan
make doc BUILDTYPE=Debug V=1

Also I am confused why it's not using debug node since I pass BUILDTYPE=Debug ? cc @nodejs/build-files

When I force debug build using cp out/Debug/node out/Release/node, the issue won't appear.

CC: clang
CXX: clang++
LINK: clang++
CC: clang-12
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also latest clang is 13. Not sure github action bundled it yet.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried clang-13 locally, same result.

@gengjiawen
Copy link
Member

gengjiawen commented Sep 30, 2021

@targos I think somebody needs to reproduce this locally, then figure out which zlib calls exactly are leading to this error. :/

@addaleax This will trigger the ASAN error. Make sure tools/doc/node_modules is empty.

./configure --debug --ninja --enable-asan
make doc BUILDTYPE=Debug V=1

Also I am confused why it's not using debug node since I pass BUILDTYPE=Debug ? cc @nodejs/build-files

When I force debug build using cp out/Debug/node out/Release/node, the issue won't appear.

With -g options, not sure same as zlib-ng/zlib-ng#183.

==5263==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges [0x6290033f9212,0x6290033f9302) and [0x6290033f9202, 0x6290033f92f2) overlap
    #0 0xb266f4 in __asan_memcpy (/opt/data/node/out/Release/node+0xb266f4)
    #1 0x2cae291 in storechunk /opt/data/node/out/Release/../../deps/zlib/contrib/optimizations/chunkcopy.h:66:3
    #2 0x2cae291 in chunkcopy_core /opt/data/node/out/Release/../../deps/zlib/contrib/optimizations/chunkcopy.h:93:5
    #3 0x2cae291 in chunkcopy_core_safe /opt/data/node/out/Release/../../deps/zlib/contrib/optimizations/chunkcopy.h:136:10
    #4 0x2cae291 in chunkcopy_safe /opt/data/node/out/Release/../../deps/zlib/contrib/optimizations/chunkcopy.h:364:10
    #5 0x2cae291 in inflate_fast_chunk_ /opt/data/node/out/Release/../../deps/zlib/contrib/optimizations/inffast_chunk.c:279:31
    #6 0x2cb6296 in inflate /opt/data/node/out/Release/../../deps/zlib/contrib/optimizations/inflate.c:1060:17
    #7 0x1077264 in node::(anonymous namespace)::ZlibContext::DoThreadPoolWork() /opt/data/node/out/Release/../../src/node_zlib.cc:819:14
    #8 0x1077264 in node::(anonymous namespace)::CompressionStream<node::(anonymous namespace)::ZlibContext>::DoThreadPoolWork() /opt/data/node/out/Release/../../src/node_zlib.cc:383:10
    #9 0x10744fc in void node::(anonymous namespace)::CompressionStream<node::(anonymous namespace)::ZlibContext>::Write<false>(unsigned int, char*, unsigned int, char*, unsigned int) /opt/data/node/out/Release/../../src/node_zlib.cc:361:7
    #10 0x10744fc in void node::(anonymous namespace)::CompressionStream<node::(anonymous namespace)::ZlibContext>::Write<false>(v8::FunctionCallbackInfo<v8::Value> const&) /opt/data/node/out/Release/../../src/node_zlib.cc:338:10
    #11 0x145b484 in v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) /opt/data/node/out/Release/../../deps/v8/src/api/api-arguments-inl.h:152:3
    #12 0x145a332 in v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) /opt/data/node/out/Release/../../deps/v8/src/builtins/builtins-api.cc:112:36
    #13 0x1458310 in v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) /opt/data/node/out/Release/../../deps/v8/src/builtins/builtins-api.cc:142:5
    #14 0x1458310 in v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) /opt/data/node/out/Release/../../deps/v8/src/builtins/builtins-api.cc:130:1
    #15 0x2d81098 in Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o

0x6290033f9212 is located 18 bytes inside of 16384-byte region [0x6290033f9200,0x6290033fd200)
allocated by thread T0 (npm ci) here:
    #0 0xb2743d in malloc (/opt/data/node/out/Release/node+0xb2743d)
    #1 0xbf345e in char* node::UncheckedRealloc<char>(char*, unsigned long) /opt/data/node/out/Release/../../src/util-inl.h:350:21
    #2 0xbf345e in char* node::UncheckedMalloc<char>(unsigned long) /opt/data/node/out/Release/../../src/util-inl.h:365:10
    #3 0xbf345e in node::UncheckedMalloc(unsigned long) /opt/data/node/out/Release/../../src/util-inl.h:399:49
    #4 0xbf345e in node::NodeArrayBufferAllocator::Allocate(unsigned long) /opt/data/node/out/Release/../../src/api/environment.cc:88:11
    #5 0x1897e11 in std::function<void* (unsigned long)>::operator()(unsigned long) const /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/std_function.h:688:14
    #6 0x1897e11 in v8::internal::Heap::AllocateExternalBackingStore(std::function<void* (unsigned long)> const&, unsigned long) /opt/data/node/out/Release/../../deps/v8/src/heap/heap.cc:3108:18
    #7 0x1c5cf71 in v8::internal::BackingStore::Allocate(v8::internal::Isolate*, unsigned long, v8::internal::SharedFlag, v8::internal::InitializedFlag) /opt/data/node/out/Release/../../deps/v8/src/objects/backing-store.cc:258:37
    #8 0x146df7e in v8::internal::(anonymous namespace)::ConstructBuffer(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::InitializedFlag) /opt/data/node/out/Release/../../deps/v8/src/builtins/builtins-arraybuffer.cc:80:9
    #9 0x146c7b3 in v8::internal::Builtin_Impl_ArrayBufferConstructor(v8::internal::BuiltinArguments, v8::internal::Isolate*) /opt/data/node/out/Release/../../deps/v8/src/builtins/builtins-arraybuffer.cc:164:10
    #10 0x146c7b3 in v8::internal::Builtin_ArrayBufferConstructor(int, unsigned long*, v8::internal::Isolate*) /opt/data/node/out/Release/../../deps/v8/src/builtins/builtins-arraybuffer.cc:128:1
    #11 0x2d81098 in Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #12 0x2d11231 in Builtins_JSBuiltinsConstructStub obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #13 0x2ded622 in Builtins_CreateTypedArray obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #14 0x2d75bf7 in Builtins_TypedArrayConstructor obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #15 0x2d11231 in Builtins_JSBuiltinsConstructStub obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #16 0x7f340880d06a  (<unknown module>)
    #17 0x2d110a4 in construct_stub_create_deopt_addr obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #18 0x7f3408832864  (<unknown module>)
    #19 0x7f3408813fda  (<unknown module>)
    #20 0x7f3408810059  (<unknown module>)
    #21 0x2d13a89 in Builtins_InterpreterEntryTrampoline obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #22 0x2d13a89 in Builtins_InterpreterEntryTrampoline obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #23 0x2d13a89 in Builtins_InterpreterEntryTrampoline obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #24 0x2d110a4 in construct_stub_create_deopt_addr obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #25 0x2e104a1 in Builtins_ConstructHandler obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #26 0x2d13a89 in Builtins_InterpreterEntryTrampoline obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #27 0x2d110a4 in construct_stub_create_deopt_addr obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #28 0x2e104a1 in Builtins_ConstructHandler obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #29 0x2d13a89 in Builtins_InterpreterEntryTrampoline obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #30 0x2d110a4 in construct_stub_create_deopt_addr obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #31 0x2e104a1 in Builtins_ConstructHandler obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #32 0x2d13a89 in Builtins_InterpreterEntryTrampoline obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #33 0x2d110a4 in construct_stub_create_deopt_addr obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #34 0x2e104a1 in Builtins_ConstructHandler obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o

0x6290033f9202 is located 2 bytes inside of 16384-byte region [0x6290033f9200,0x6290033fd200)
allocated by thread T0 (npm ci) here:
    #0 0xb2743d in malloc (/opt/data/node/out/Release/node+0xb2743d)
    #1 0xbf345e in char* node::UncheckedRealloc<char>(char*, unsigned long) /opt/data/node/out/Release/../../src/util-inl.h:350:21
    #2 0xbf345e in char* node::UncheckedMalloc<char>(unsigned long) /opt/data/node/out/Release/../../src/util-inl.h:365:10
    #3 0xbf345e in node::UncheckedMalloc(unsigned long) /opt/data/node/out/Release/../../src/util-inl.h:399:49
    #4 0xbf345e in node::NodeArrayBufferAllocator::Allocate(unsigned long) /opt/data/node/out/Release/../../src/api/environment.cc:88:11
    #5 0x1897e11 in std::function<void* (unsigned long)>::operator()(unsigned long) const /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/std_function.h:688:14
    #6 0x1897e11 in v8::internal::Heap::AllocateExternalBackingStore(std::function<void* (unsigned long)> const&, unsigned long) /opt/data/node/out/Release/../../deps/v8/src/heap/heap.cc:3108:18
    #7 0x1c5cf71 in v8::internal::BackingStore::Allocate(v8::internal::Isolate*, unsigned long, v8::internal::SharedFlag, v8::internal::InitializedFlag) /opt/data/node/out/Release/../../deps/v8/src/objects/backing-store.cc:258:37
    #8 0x146df7e in v8::internal::(anonymous namespace)::ConstructBuffer(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::InitializedFlag) /opt/data/node/out/Release/../../deps/v8/src/builtins/builtins-arraybuffer.cc:80:9
    #9 0x146c7b3 in v8::internal::Builtin_Impl_ArrayBufferConstructor(v8::internal::BuiltinArguments, v8::internal::Isolate*) /opt/data/node/out/Release/../../deps/v8/src/builtins/builtins-arraybuffer.cc:164:10
    #10 0x146c7b3 in v8::internal::Builtin_ArrayBufferConstructor(int, unsigned long*, v8::internal::Isolate*) /opt/data/node/out/Release/../../deps/v8/src/builtins/builtins-arraybuffer.cc:128:1
    #11 0x2d81098 in Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #12 0x2d11231 in Builtins_JSBuiltinsConstructStub obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #13 0x2ded622 in Builtins_CreateTypedArray obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #14 0x2d75bf7 in Builtins_TypedArrayConstructor obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #15 0x2d11231 in Builtins_JSBuiltinsConstructStub obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #16 0x7f340880d06a  (<unknown module>)
    #17 0x2d110a4 in construct_stub_create_deopt_addr obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #18 0x7f3408832864  (<unknown module>)
    #19 0x7f3408813fda  (<unknown module>)
    #20 0x7f3408810059  (<unknown module>)
    #21 0x2d13a89 in Builtins_InterpreterEntryTrampoline obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #22 0x2d13a89 in Builtins_InterpreterEntryTrampoline obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #23 0x2d13a89 in Builtins_InterpreterEntryTrampoline obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #24 0x2d110a4 in construct_stub_create_deopt_addr obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #25 0x2e104a1 in Builtins_ConstructHandler obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #26 0x2d13a89 in Builtins_InterpreterEntryTrampoline obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #27 0x2d110a4 in construct_stub_create_deopt_addr obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #28 0x2e104a1 in Builtins_ConstructHandler obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #29 0x2d13a89 in Builtins_InterpreterEntryTrampoline obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #30 0x2d110a4 in construct_stub_create_deopt_addr obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #31 0x2e104a1 in Builtins_ConstructHandler obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #32 0x2d13a89 in Builtins_InterpreterEntryTrampoline obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #33 0x2d110a4 in construct_stub_create_deopt_addr obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o
    #34 0x2e104a1 in Builtins_ConstructHandler obj/tools/v8_gypfiles/obj/tools/v8_gypfiles/v8_snapshot.gen/v8_snapshot.embedded.o

SUMMARY: AddressSanitizer: memcpy-param-overlap (/opt/data/node/out/Release/node+0xb266f4) in __asan_memcpy
==5263==ABORTING
make: *** [Makefile:687: tools/doc/node_modules] Error 1

@targos
Copy link
Member Author

targos commented Jan 24, 2022

rebased output
  clang-12 -o Release/obj.target/binding/../type-tag/binding.o ../../type-tag/binding.c '-DNODE_GYP_MODULE_NAME=binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DLEAK_SANITIZER' '-DV8_USE_ADDRESS_SANITIZER' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DBUILDING_NODE_EXTENSION' -I/home/runner/work/node/node/include/node -I/home/runner/work/node/node/src -I/home/runner/work/node/node/deps/openssl/config -I/home/runner/work/node/node/deps/openssl/openssl/include -I/home/runner/work/node/node/deps/uv/include -I/home/runner/work/node/node/deps/zlib -I/home/runner/work/node/node/deps/v8/include  -fPIC -fno-omit-frame-pointer -fsanitize=address -fsanitize-address-use-after-scope -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer  -MMD -MF ./Release/.deps/Release/obj.target/binding/../type-...
  clang++-12 -o Release/obj.target/binding.node -shared -fsanitize=address -pthread -rdynamic -m64  -Wl,-soname=binding.node -Wl,--start-group Release/obj.target/binding/../type-tag/binding.o -Wl,--end-group 
  ln -f "Release/obj.target/binding.node" "Release/binding.node" 2>/dev/null || (rm -rf "Release/binding.node" && cp -af "Release/obj.target/binding.node" "Release/binding.node")
make[2]: Leaving directory '/home/runner/work/node/node/benchmark/napi/type-tag-check/build'
=================================================================
==79036==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges [0x6290012ed215,0x6290012ed235) and [0x6290012ed205, 0x6290012ed225) overlap
    #0 0xb6c6f4 in __asan_memcpy (/home/runner/work/node/node/out/Release/node+0xb6c6f4)
    #1 0x2dc281d in inflate_fast_chunk_ (/home/runner/work/node/node/out/Release/node+0x2dc281d)
    #2 0x2dca734 in inflate (/home/runner/work/node/node/out/Release/node+0x2dca734)
    #3 0x10781b4 in node::(anonymous namespace)::CompressionStream<node::(anonymous namespace)::ZlibContext>::DoThreadPoolWork() (/home/runner/work/node/node/out/Release/node+0x10781b4)
    #4 0x107545c in void node::(anonymous namespace)::CompressionStream<node::(anonymous namespace)::ZlibContext>::Write<false>(v8::FunctionCallbackInfo<v8::Value> const&) (/home/runner/work/node/node/out/Release/node+0x107545c)
    #5 0x146d5a4 in v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) (/home/runner/work/node/node/out/Release/node+0x146d5a4)
    #6 0x146c458 in v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) (/home/runner/work/node/node/out/Release/node+0x146c458)
    #7 0x146a460 in v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) (/home/runner/work/node/node/out/Release/node+0x146a460)
    #8 0x2ea5778 in Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit (/home/runner/work/node/node/out/Release/node+0x2ea5778)

0x6290012ed215 is located 21 bytes inside of 16384-byte region [0x6290012ed200,0x6290012f1200)
allocated by thread T0 (npm ci) here:
    #0 0xb6d44d in malloc (/home/runner/work/node/node/out/Release/node+0xb6d44d)
    #1 0xbadfae in node::NodeArrayBufferAllocator::Allocate(unsigned long) (/home/runner/work/node/node/out/Release/node+0xbadfae)
    #2 0x1879db1 in v8::internal::Heap::AllocateExternalBackingStore(std::function<void* (unsigned long)> const&, unsigned long) (/home/runner/work/node/node/out/Release/node+0x1879db1)
    #3 0x1c375b1 in v8::internal::BackingStore::Allocate(v8::internal::Isolate*, unsigned long, v8::internal::SharedFlag, v8::internal::InitializedFlag) (/home/runner/work/node/node/out/Release/node+0x1c375b1)
    #4 0x147fe04 in v8::internal::(anonymous namespace)::ConstructBuffer(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::InitializedFlag) (/home/runner/work/node/node/out/Release/node+0x147fe04)
    #5 0x147e9dd in v8::internal::Builtin_ArrayBufferConstructor(int, unsigned long*, v8::internal::Isolate*) (/home/runner/work/node/node/out/Release/node+0x147e9dd)
    #6 0x2ea5778 in Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit (/home/runner/work/node/node/out/Release/node+0x2ea5778)
    #7 0x2e2aef7 in Builtins_JSBuiltinsConstructStub (/home/runner/work/node/node/out/Release/node+0x2e2aef7)
    #8 0x2f193a8 in Builtins_CreateTypedArray (/home/runner/work/node/node/out/Release/node+0x2f193a8)
    #9 0x2e99a80 in Builtins_TypedArrayConstructor (/home/runner/work/node/node/out/Release/node+0x2e99a80)
    #10 0x2e2aef7 in Builtins_JSBuiltinsConstructStub (/home/runner/work/node/node/out/Release/node+0x2e2aef7)
    #11 0x7fa128d0de2d  (<unknown module>)
    #12 0x2e2ad2d in Builtins_JSConstructStubGeneric (/home/runner/work/node/node/out/Release/node+0x2e2ad2d)
    #13 0x7fa128d3552d  (<unknown module>)
    #14 0x7fa128d13b4d  (<unknown module>)
    #15 0x7fa128d111e2  (<unknown module>)
    #16 0x7fa128eb8947  (<unknown module>)
    #17 0x7fa128ec86d7  (<unknown module>)
    #18 0x7fa128ec8985  (<unknown module>)
    #19 0x2e2ad2d in Builtins_JSConstructStubGeneric (/home/runner/work/node/node/out/Release/node+0x2e2ad2d)
    #20 0x7fa128ebb8ee  (<unknown module>)
    #21 0x2e2ad2d in Builtins_JSConstructStubGeneric (/home/runner/work/node/node/out/Release/node+0x2e2ad2d)
    #22 0x7fa128eb8d7d  (<unknown module>)
    #23 0x2e2ad2d in Builtins_JSConstructStubGeneric (/home/runner/work/node/node/out/Release/node+0x2e2ad2d)
    #24 0x7fa128d5de27  (<unknown module>)
    #25 0x2e2ad2d in Builtins_JSConstructStubGeneric (/home/runner/work/node/node/out/Release/node+0x2e2ad2d)
    #26 0x7fa128ec39f2  (<unknown module>)
    #27 0x7fa128ef5e90  (<unknown module>)
    #28 0x7fa128e4815a  (<unknown module>)
    #29 0x7fa128d70571  (<unknown module>)

0x6290012ed205 is located 5 bytes inside of 16384-byte region [0x6290012ed200,0x6290012f1200)
allocated by thread T0 (npm ci) here:
    #0 0xb6d44d in malloc (/home/runner/work/node/node/out/Release/node+0xb6d44d)
    #1 0xbadfae in node::NodeArrayBufferAllocator::Allocate(unsigned long) (/home/runner/work/node/node/out/Release/node+0xbadfae)
    #2 0x1879db1 in v8::internal::Heap::AllocateExternalBackingStore(std::function<void* (unsigned long)> const&, unsigned long) (/home/runner/work/node/node/out/Release/node+0x1879db1)
    #3 0x1c375b1 in v8::internal::BackingStore::Allocate(v8::internal::Isolate*, unsigned long, v8::internal::SharedFlag, v8::internal::InitializedFlag) (/home/runner/work/node/node/out/Release/node+0x1c375b1)
    #4 0x147fe04 in v8::internal::(anonymous namespace)::ConstructBuffer(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::InitializedFlag) (/home/runner/work/node/node/out/Release/node+0x147fe04)
    #5 0x147e9dd in v8::internal::Builtin_ArrayBufferConstructor(int, unsigned long*, v8::internal::Isolate*) (/home/runner/work/node/node/out/Release/node+0x147e9dd)
    #6 0x2ea5778 in Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit (/home/runner/work/node/node/out/Release/node+0x2ea5778)
    #7 0x2e2aef7 in Builtins_JSBuiltinsConstructStub (/home/runner/work/node/node/out/Release/node+0x2e2aef7)
    #8 0x2f193a8 in Builtins_CreateTypedArray (/home/runner/work/node/node/out/Release/node+0x2f193a8)
    #9 0x2e99a80 in Builtins_TypedArrayConstructor (/home/runner/work/node/node/out/Release/node+0x2e99a80)
    #10 0x2e2aef7 in Builtins_JSBuiltinsConstructStub (/home/runner/work/node/node/out/Release/node+0x2e2aef7)
    #11 0x7fa128d0de2d  (<unknown module>)
    #12 0x2e2ad2d in Builtins_JSConstructStubGeneric (/home/runner/work/node/node/out/Release/node+0x2e2ad2d)
    #13 0x7fa128d3552d  (<unknown module>)
    #14 0x7fa128d13b4d  (<unknown module>)
    #15 0x7fa128d111e2  (<unknown module>)
    #16 0x7fa128eb8947  (<unknown module>)
    #17 0x7fa128ec86d7  (<unknown module>)
    #18 0x7fa128ec8985  (<unknown module>)
    #19 0x2e2ad2d in Builtins_JSConstructStubGeneric (/home/runner/work/node/node/out/Release/node+0x2e2ad2d)
    #20 0x7fa128ebb8ee  (<unknown module>)
    #21 0x2e2ad2d in Builtins_JSConstructStubGeneric (/home/runner/work/node/node/out/Release/node+0x2e2ad2d)
    #22 0x7fa128eb8d7d  (<unknown module>)
    #23 0x2e2ad2d in Builtins_JSConstructStubGeneric (/home/runner/work/node/node/out/Release/node+0x2e2ad2d)
    #24 0x7fa128d5de27  (<unknown module>)
    #25 0x2e2ad2d in Builtins_JSConstructStubGeneric (/home/runner/work/node/node/out/Release/node+0x2e2ad2d)
    #26 0x7fa128ec39f2  (<unknown module>)
    #27 0x7fa128ef5e90  (<unknown module>)
    #28 0x7fa128e4815a  (<unknown module>)
    #29 0x7fa128d70571  (<unknown module>)

SUMMARY: AddressSanitizer: memcpy-param-overlap (/home/runner/work/node/node/out/Release/node+0xb6c6f4) in __asan_memcpy
==79036==ABORTING
make[1]: *** [Makefile:719: tools/doc/node_modules] Error 1

@targos
Copy link
Member Author

targos commented Jan 29, 2022

Thank you for the approvals but we still can't merge this because of the error spotted by clang-12.

@targos targos added build Issues and PRs related to build files or the CI. and removed help wanted Issues that need assistance from volunteers or PRs that need help to proceed. blocked PRs that are blocked by other issues or PRs. labels Apr 5, 2022
@targos
Copy link
Member Author

targos commented Apr 30, 2022

It's green now :) Can I have a new review?

Copy link
Contributor

@RaisinTen RaisinTen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but how did this get fixed?

@targos
Copy link
Member Author

targos commented Apr 30, 2022

LGTM but how did this get fixed?

I have no idea.

@RaisinTen
Copy link
Contributor

Could it be flaky? I was wondering if we should rerun CI a couple of times before landing.

@targos
Copy link
Member Author

targos commented Apr 30, 2022

I force-pushed again to run with latest master (will need another review to land). We can then rerun it a couple times.

@targos
Copy link
Member Author

targos commented Apr 30, 2022

Green. Rerunning...

@targos targos added the blocked PRs that are blocked by other issues or PRs. label Apr 30, 2022
@targos
Copy link
Member Author

targos commented Apr 30, 2022

You were right, it's flaky!

==79671==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges [0x629000131213,0x629000131233) and [0x629000131203, 0x629000131223) overlap
    #0 0xb8e654 in __asan_memcpy (/home/runner/work/node/node/out/Release/node+0xb8e654)
    #1 0x2f85b7d in inflate_fast_chunk_ (/home/runner/work/node/node/out/Release/node+0x2f85b7d)
    #2 0x2f8da94 in inflate (/home/runner/work/node/node/out/Release/node+0x2f8da94)
    #3 0x10a2e14 in node::(anonymous namespace)::CompressionStream<node::(anonymous namespace)::ZlibContext>::DoThreadPoolWork() (/home/runner/work/node/node/out/Release/node+0x10a2e14)
    #4 0x10a0134 in void node::(anonymous namespace)::CompressionStream<node::(anonymous namespace)::ZlibContext>::Write<false>(v8::FunctionCallbackInfo<v8::Value> const&) (/home/runner/work/node/node/out/Release/node+0x10a0134)
    #5 0x149aa60 in v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) (/home/runner/work/node/node/out/Release/node+0x149aa60)

@targos targos closed this Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked PRs that are blocked by other issues or PRs. build Issues and PRs related to build files or the CI. meta Issues and PRs related to the general management of the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants