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

investigate flaky test/node-api/test_worker_terminate_finalization/test.js #36868

Closed
RaisinTen opened this issue Jan 10, 2021 · 26 comments
Closed
Labels
flaky-test Issues and PRs related to the tests with unstable failures on the CI.

Comments

@RaisinTen
Copy link
Contributor

  • Test: test/node-api/test_worker_terminate_finalization/test.js
  • Platform: linux
  • Console Output:
=== release test ===
Path: node-api/test_worker_terminate_finalization/test
Error: --- stderr ---
=================================================================
==14596==ERROR: AddressSanitizer: heap-use-after-free on address 0x60700000cc70 at pc 0x000000be11c4 bp 0x7f273ef6cda0 sp 0x7f273ef6cd98
READ of size 8 at 0x60700000cc70 thread T7
    #0 0xbe11c3 in v8impl::(anonymous namespace)::Reference::SecondPassCallback(v8::WeakCallbackInfo<v8impl::(anonymous namespace)::Reference> const&) (/home/runner/work/node/node/out/Release/node+0xbe11c3)
    #1 0x1706808 in v8::internal::GlobalHandles::InvokeSecondPassPhantomCallbacksFromTask() (/home/runner/work/node/node/out/Release/node+0x1706808)
    #2 0xe2b26f in node::PerIsolatePlatformData::RunForegroundTask(std::unique_ptr<v8::Task, std::default_delete<v8::Task> >) (/home/runner/work/node/node/out/Release/node+0xe2b26f)
    #3 0xe26300 in node::PerIsolatePlatformData::FlushForegroundTasksInternal() (/home/runner/work/node/node/out/Release/node+0xe26300)
    #4 0xe2ba45 in node::NodePlatform::DrainTasks(v8::Isolate*) (/home/runner/work/node/node/out/Release/node+0xe2ba45)
    #5 0xa8a5db in node::FreeEnvironment(node::Environment*) (/home/runner/work/node/node/out/Release/node+0xa8a5db)
    #6 0xf28d41 in node::worker::Worker::Run() (/home/runner/work/node/node/out/Release/node+0xf28d41)
    #7 0xf33fe0 in node::worker::Worker::StartThread(v8::FunctionCallbackInfo<v8::Value> const&)::$_3::__invoke(void*) (/home/runner/work/node/node/out/Release/node+0xf33fe0)
    #8 0x7f27453b96da in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76da)
    #9 0x7f2744cc271e in clone (/lib/x86_64-linux-gnu/libc.so.6+0x12171e)

0x60700000cc70 is located 0 bytes inside of 80-byte region [0x60700000cc70,0x60700000ccc0)
freed by thread T7 here:
    #0 0xa769bd in operator delete(void*) (/home/runner/work/node/node/out/Release/node+0xa769bd)
    #1 0xc1622d in node_napi_env__::~node_napi_env__() (/home/runner/work/node/node/out/Release/node+0xc1622d)
    #2 0xc12f53 in node::CallbackQueue<void, node::Environment*>::CallbackImpl<v8impl::(anonymous namespace)::BufferFinalizer::FinalizeBufferCallback(char*, void*)::'lambda'(node::Environment*)>::~CallbackImpl() (/home/runner/work/node/node/out/Release/node+0xc12f53)
    #3 0xb72a20 in node::Environment::RunAndClearNativeImmediates(bool)::$_5::operator()(node::CallbackQueue<void, node::Environment*>*) const (/home/runner/work/node/node/out/Release/node+0xb72a20)
    #4 0xb7070a in node::Environment::RunAndClearNativeImmediates(bool) (/home/runner/work/node/node/out/Release/node+0xb7070a)
    #5 0xb6ffb3 in node::Environment::CleanupHandles() (/home/runner/work/node/node/out/Release/node+0xb6ffb3)
    #6 0xb71177 in node::Environment::RunCleanup() (/home/runner/work/node/node/out/Release/node+0xb71177)
    #7 0xa8a514 in node::FreeEnvironment(node::Environment*) (/home/runner/work/node/node/out/Release/node+0xa8a514)
    #8 0xf28d41 in node::worker::Worker::Run() (/home/runner/work/node/node/out/Release/node+0xf28d41)
    #9 0xf33fe0 in node::worker::Worker::StartThread(v8::FunctionCallbackInfo<v8::Value> const&)::$_3::__invoke(void*) (/home/runner/work/node/node/out/Release/node+0xf33fe0)
    #10 0x7f27453b96da in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76da)

previously allocated by thread T7 here:
    #0 0xa7615d in operator new(unsigned long) (/home/runner/work/node/node/out/Release/node+0xa7615d)
    #1 0xbd4473 in napi_wrap (/home/runner/work/node/node/out/Release/node+0xbd4473)
    #2 0x7f273e71a925 in Test (/home/runner/work/node/node/test/node-api/test_worker_terminate_finalization/build/Release/test_worker_terminate_finalization.node+0x1925)
    #3 0xbdfcf2 in v8impl::(anonymous namespace)::FunctionCallbackWrapper::Invoke(v8::FunctionCallbackInfo<v8::Value> const&) (/home/runner/work/node/node/out/Release/node+0xbdfcf2)
    #4 0x138b2e3 in v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) (/home/runner/work/node/node/out/Release/node+0x138b2e3)
    #5 0x1389114 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+0x1389114)
    #6 0x1387192 in v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) (/home/runner/work/node/node/out/Release/node+0x1387192)
    #7 0x2ca6678 in Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit (/home/runner/work/node/node/out/Release/node+0x2ca6678)
    #8 0x2c3d283 in Builtins_InterpreterEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3d283)
    #9 0x2c3d283 in Builtins_InterpreterEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3d283)
    #10 0x2c3d283 in Builtins_InterpreterEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3d283)
    #11 0x2c3d283 in Builtins_InterpreterEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3d283)
    #12 0x2c3d283 in Builtins_InterpreterEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3d283)
    #13 0x2c3d283 in Builtins_InterpreterEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3d283)
    #14 0x2c3d283 in Builtins_InterpreterEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3d283)
    #15 0x2c3d283 in Builtins_InterpreterEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3d283)
    #16 0x2c3d283 in Builtins_InterpreterEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3d283)
    #17 0x2c3afb9 in Builtins_JSEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3afb9)
    #18 0x2c3ad97 in Builtins_JSEntry (/home/runner/work/node/node/out/Release/node+0x2c3ad97)
    #19 0x16575ef in v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) (/home/runner/work/node/node/out/Release/node+0x16575ef)
    #20 0x1655374 in v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) (/home/runner/work/node/node/out/Release/node+0x1655374)
    #21 0x124af20 in v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) (/home/runner/work/node/node/out/Release/node+0x124af20)
    #22 0xa7cbb2 in node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) (/home/runner/work/node/node/out/Release/node+0xa7cbb2)
    #23 0xad0b07 in node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) (/home/runner/work/node/node/out/Release/node+0xad0b07)
    #24 0xd8dfbc in node::worker::MessagePort::OnMessage() (/home/runner/work/node/node/out/Release/node+0xd8dfbc)
    #25 0x2bf8c58 in uv__async_io /home/runner/work/node/node/out/../deps/uv/src/unix/async.c:163:5
    #26 0x2c2cf30 in uv__io_poll /home/runner/work/node/node/out/../deps/uv/src/unix/linux-core.c:462:11
    #27 0x2bf9c67 in uv_run /home/runner/work/node/node/out/../deps/uv/src/unix/core.c:385:5
    #28 0xa7f094 in node::SpinEventLoop(node::Environment*) (/home/runner/work/node/node/out/Release/node+0xa7f094)
    #29 0xf28bf4 in node::worker::Worker::Run() (/home/runner/work/node/node/out/Release/node+0xf28bf4)

Thread T7 created by T0 here:
    #0 0xa311aa in pthread_create (/home/runner/work/node/node/out/Release/node+0xa311aa)
    #1 0x2c2253a in uv_thread_create_ex /home/runner/work/node/node/out/../deps/uv/src/unix/thread.c:259:9
    #2 0xf313d4 in node::worker::Worker::StartThread(v8::FunctionCallbackInfo<v8::Value> const&) (/home/runner/work/node/node/out/Release/node+0xf313d4)
    #3 0x138b2e3 in v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) (/home/runner/work/node/node/out/Release/node+0x138b2e3)
    #4 0x1389114 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+0x1389114)
    #5 0x1387192 in v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) (/home/runner/work/node/node/out/Release/node+0x1387192)
    #6 0x2ca6678 in Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit (/home/runner/work/node/node/out/Release/node+0x2ca6678)
    #7 0x2c3d283 in Builtins_InterpreterEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3d283)
    #8 0x2c35d98 in Builtins_ArgumentsAdaptorTrampoline (/home/runner/work/node/node/out/Release/node+0x2c35d98)
    #9 0x2c3a3c0 in Builtins_JSConstructStubGeneric (/home/runner/work/node/node/out/Release/node+0x2c3a3c0)
    #10 0x2d31480 in Builtins_ConstructHandler (/home/runner/work/node/node/out/Release/node+0x2d31480)
    #11 0x2c3d283 in Builtins_InterpreterEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3d283)
    #12 0x2c3d283 in Builtins_InterpreterEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3d283)
    #13 0x2c3d283 in Builtins_InterpreterEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3d283)
    #14 0x2c3d283 in Builtins_InterpreterEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3d283)
    #15 0x2c3d283 in Builtins_InterpreterEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3d283)
    #16 0x2c3d283 in Builtins_InterpreterEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3d283)
    #17 0x2c3d283 in Builtins_InterpreterEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3d283)
    #18 0x2c3afb9 in Builtins_JSEntryTrampoline (/home/runner/work/node/node/out/Release/node+0x2c3afb9)
    #19 0x2c3ad97 in Builtins_JSEntry (/home/runner/work/node/node/out/Release/node+0x2c3ad97)
    #20 0x16575ef in v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) (/home/runner/work/node/node/out/Release/node+0x16575ef)
    #21 0x1655374 in v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) (/home/runner/work/node/node/out/Release/node+0x1655374)
    #22 0x124af20 in v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) (/home/runner/work/node/node/out/Release/node+0x124af20)
    #23 0xbfc638 in node::ExecuteBootstrapper(node::Environment*, char const*, std::vector<v8::Local<v8::String>, std::allocator<v8::Local<v8::String> > >*, std::vector<v8::Local<v8::Value>, std::allocator<v8::Local<v8::Value> > >*) (/home/runner/work/node/node/out/Release/node+0xbfc638)
    #24 0xc01001 in node::StartExecution(node::Environment*, char const*) (/home/runner/work/node/node/out/Release/node+0xc01001)
    #25 0xbff7ca in node::StartExecution(node::Environment*, std::function<v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfo const&)>) (/home/runner/work/node/node/out/Release/node+0xbff7ca)
    #26 0xa8ad1b in node::LoadEnvironment(node::Environment*, std::function<v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfo const&)>) (/home/runner/work/node/node/out/Release/node+0xa8ad1b)
    #27 0xd81832 in node::NodeMainInstance::Run(node::EnvSerializeInfo const*) (/home/runner/work/node/node/out/Release/node+0xd81832)
    #28 0xc054af in node::Start(int, char**) (/home/runner/work/node/node/out/Release/node+0xc054af)
    #29 0x7f2744bc2bf6 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21bf6)

SUMMARY: AddressSanitizer: heap-use-after-free (/home/runner/work/node/node/out/Release/node+0xbe11c3) in v8impl::(anonymous namespace)::Reference::SecondPassCallback(v8::WeakCallbackInfo<v8impl::(anonymous namespace)::Reference> const&)
Shadow bytes around the buggy address:
  0x0c0e7fff9930: fd fd fd fd fd fd fa fa fa fa fd fd fd fd fd fd
  0x0c0e7fff9940: fd fd fd fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x0c0e7fff9950: fd fd fa fa fa fa 00 00 00 00 00 00 00 00 00 fa
  0x0c0e7fff9960: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fa fa
  0x0c0e7fff9970: fa fa fd fd fd fd fd fd fd fd fd fd fa fa fa fa
=>0x0c0e7fff9980: fd fd fd fd fd fd fd fd fd fd fa fa fa fa[fd]fd
  0x0c0e7fff9990: fd fd fd fd fd fd fd fd fa fa fa fa fd fd fd fd
  0x0c0e7fff99a0: fd fd fd fd fd fa fa fa fa fa fd fd fd fd fd fd
  0x0c0e7fff99b0: fd fd fd fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x0c0e7fff99c0: fd fa fa fa fa fa 00 00 00 00 00 00 00 00 00 fa
  0x0c0e7fff99d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==14596==ABORTING
Command: out/Release/node /home/runner/work/node/node/test/node-api/test_worker_terminate_finalization/test.js
make[1]: *** [test-ci] Error 1
make: *** [run-ci] Error 2

===
=== 1 tests failed
===
Makefile:514: recipe for target 'test-ci' failed
Makefile:544: recipe for target 'run-ci' failed
Error: Process completed with exit code 2.
=== release test ===
Path: node-api/test_worker_terminate_finalization/test
Error: Command: out/Release/node /home/runner/work/node/node/test/node-api/test_worker_terminate_finalization/test.js
--- CRASHED (Signal: 11) ---

===
=== 1 tests failed
=== 1 tests CRASHED
===
make[1]: *** [test-ci] Error 1
Makefile:514: recipe for target 'test-ci' failed
make: *** [run-ci] Error 2
Makefile:544: recipe for target 'run-ci' failed
Error: Process completed with exit code 2.

Refs: #34731

@aduh95 aduh95 added the flaky-test Issues and PRs related to the tests with unstable failures on the CI. label Jan 11, 2021
@Trott
Copy link
Member

Trott commented Jan 11, 2021

https://ci.nodejs.org/job/node-test-commit-linux-containered/nodes=ubuntu1804_sharedlibs_withoutintl_x64/24583/console

00:07:12 not ok 3043 node-api/test_worker_terminate_finalization/test
00:07:12   ---
00:07:12   duration_ms: 0.330
00:07:12   severity: crashed
00:07:12   exitcode: -11
00:07:12   stack: |-
00:07:12   ...

@Trott
Copy link
Member

Trott commented Jan 11, 2021

@nodejs/n-api

@mhdawson
Copy link
Member

Does not look like the test has changed in a few months:

image

@mhdawson
Copy link
Member

Don't see any recent PRs that look suspect either:

image

@RaisinTen
Copy link
Contributor Author

The log seems to point to this part:

data.GetParameter()->Finalize();

Perhaps what data.GetParameter() returns is freed already?

@mhdawson
Copy link
Member

@gabrielschulhof can you think of any recent changes that could be related?

@mhdawson
Copy link
Member

@RaisinTen it is worth seeing what data.GetParameter() looks like. First step would be to recreate locally. I wanted to find some time to do that today but did not get to it. Have you run/recreated on your own machine?

@RaisinTen
Copy link
Contributor Author

@mhdawson it is indeed. I didn't get time to test this locally either. I'll try it out now.

@RaisinTen
Copy link
Contributor Author

@mhdawson just ended up running the test a 1000 times and still couldn't replicate the error. :/

@mhdawson
Copy link
Member

@RaisinTen No recreate for me in 500 runs on RHEL 8 either.
Next going to try to run under valgrind.

@mhdawson
Copy link
Member

Valgrind with default options does not report anything of interest:

[midawson@midawson node]$ valgrind ./node test/node-api/test_worker_terminate_finalization/test.js
==2142587== Memcheck, a memory error detector
==2142587== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2142587== Using Valgrind-3.16.0 and LibVEX; rerun with -h for copyright info
==2142587== Command: ./node test/node-api/test_worker_terminate_finalization/test.js
==2142587== 
==2142587== 
==2142587== HEAP SUMMARY:
==2142587==     in use at exit: 6,508 bytes in 24 blocks
==2142587==   total heap usage: 53,127 allocs, 53,103 frees, 47,206,475 bytes allocated
==2142587== 
==2142587== LEAK SUMMARY:
==2142587==    definitely lost: 0 bytes in 0 blocks
==2142587==    indirectly lost: 0 bytes in 0 blocks
==2142587==      possibly lost: 304 bytes in 1 blocks
==2142587==    still reachable: 6,204 bytes in 23 blocks
==2142587==         suppressed: 0 bytes in 0 blocks
==2142587== Rerun with --leak-check=full to see details of leaked memory
==2142587== 
==2142587== For lists of detected and suppressed errors, rerun with: -s
==2142587== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
[midawson@midawson node]$ 

@mhdawson
Copy link
Member

Will try re-building with the address sanitizer enabled as it seems some of the failures were with asan enabled and that was what reported the errors

@mhdawson
Copy link
Member

While rebuilding looked at 5-6 of the PRs from today, no recreates in the asan github action runs.

@mhdawson
Copy link
Member

I've been trying to recompile with asan enabled using ./configure --verbose --enable-asan but it does not seem to compile for me.

I've been running make node and tried on both a RHEL and Ubuntu machine without luck. I see the github actions job uses make build-ci which I'll try but I'll be surprised if that is related.

@RaisinTen
Copy link
Contributor Author

@mhdawson Can you please share the log of the compilation failure? I'm guessing it failed because asan builds consume a lot of memory.

Wouldn't make build-ci essentially be just make?
./configure --verbose --enable-asan sets BUILDTYPE=Release in config.mk and so after this:

node/Makefile

Lines 131 to 133 in e3e054d

ifeq ($(BUILDTYPE),Debug)
CONFIG_FLAGS += --debug
endif

CONFIG_FLAGS would be empty and so:

node/Makefile

Lines 529 to 531 in e3e054d

build-ci:
$(PYTHON) ./configure --verbose $(CONFIG_FLAGS)
$(MAKE)

would basically run:

$(PYTHON) ./configure --verbose 
make

@richardlau
Copy link
Member

@RaisinTen the ASAN workflow sets CONFIG_FLAGS:

CONFIG_FLAGS: --enable-asan

@mhdawson
Copy link
Member

Right I just did

./configure --verbose --enable-asan
make test

but if fails with these kinds of errors:

`_ZZN4node7ReallocIcEEPT_S2_mE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_hash.o: defined in discarded section `.rodata._ZZN4node7ReallocIcEEPT_S2_mE19__PRETTY_FUNCTION__[_ZZN4node7ReallocIcEEPT_S2_mE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_hash.o
`_ZZN4node16MaybeStackBufferIcLm1024EE25AllocateSufficientStorageEmE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_hash.o: defined in discarded section `.rodata._ZZN4node16MaybeStackBufferIcLm1024EE25AllocateSufficientStorageEmE19__PRETTY_FUNCTION__[_ZZN4node16MaybeStackBufferIcLm1024EE25AllocateSufficientStorageEmE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_hash.o
`_ZZN4node11Environment29DecreaseWaitingRequestCounterEvE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_hash.o: defined in discarded section `.rodata._ZZN4node11Environment29DecreaseWaitingRequestCounterEvE19__PRETTY_FUNCTION__[_ZZN4node11Environment29DecreaseWaitingRequestCounterEvE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_hash.o
`_ZZN4node14ThreadPoolWork12ScheduleWorkEvE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_hash.o: defined in discarded section `.rodata._ZZN4node14ThreadPoolWork12ScheduleWorkEvE19__PRETTY_FUNCTION__[_ZZN4node14ThreadPoolWork12ScheduleWorkEvE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_hash.o
`_ZZN4node14ThreadPoolWorkC4EPNS_11EnvironmentEE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_hash.o: defined in discarded section `.rodata._ZZN4node14ThreadPoolWorkC4EPNS_11EnvironmentEE19__PRETTY_FUNCTION__[_ZZN4node14ThreadPoolWorkC4EPNS_11EnvironmentEE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_hash.o
`_ZZN4node18MemoryRetainerNodeC4EPNS_13MemoryTrackerEPKNS_14MemoryRetainerEE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_hash.o: defined in discarded section `.rodata._ZZN4node18MemoryRetainerNodeC4EPNS_13MemoryTrackerEPKNS_14MemoryRetainerEE19__PRETTY_FUNCTION__[_ZZN4node18MemoryRetainerNodeC4EPNS_13MemoryTrackerEPKNS_14MemoryRetainerEE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_hash.o
`_ZZN4node10BaseObjectD4EvE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_hash.o: defined in discarded section `.rodata._ZZN4node10BaseObjectD4EvE19__PRETTY_FUNCTION__[_ZZN4node10BaseObjectD4EvE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_hash.o
`_ZZZN4node10BaseObject8MakeWeakEvENKUlRKN2v816WeakCallbackInfoIS0_EEE_clES5_E19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_hash.o: defined in discarded section `.rodata._ZZZN4node10BaseObject8MakeWeakEvENKUlRKN2v816WeakCallbackInfoIS0_EEE_clES5_E19__PRETTY_FUNCTION__[_ZZZN4node10BaseObject8MakeWeakEvENKUlRKN2v816WeakCallbackInfoIS0_EEE_clES5_E4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_hash.o
`_ZZN4node11Environment14AddCleanupHookEPFvPvES1_E19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_hash.o: defined in discarded section `.rodata._ZZN4node11Environment14AddCleanupHookEPFvPvES1_E19__PRETTY_FUNCTION__[_ZZN4node11Environment14AddCleanupHookEPFvPvES1_E4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_hash.o
`_ZZN4node11Environment29DecreaseWaitingRequestCounterEvE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_keygen.o: defined in discarded section `.rodata._ZZN4node11Environment29DecreaseWaitingRequestCounterEvE19__PRETTY_FUNCTION__[_ZZN4node11Environment29DecreaseWaitingRequestCounterEvE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_keygen.o
`_ZZN4node14ThreadPoolWork12ScheduleWorkEvE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_keygen.o: defined in discarded section `.rodata._ZZN4node14ThreadPoolWork12ScheduleWorkEvE19__PRETTY_FUNCTION__[_ZZN4node14ThreadPoolWork12ScheduleWorkEvE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_keygen.o
`_ZZZN4node10BaseObject8MakeWeakEvENKUlRKN2v816WeakCallbackInfoIS0_EEE_clES5_E19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_keygen.o: defined in discarded section `.rodata._ZZZN4node10BaseObject8MakeWeakEvENKUlRKN2v816WeakCallbackInfoIS0_EEE_clES5_E19__PRETTY_FUNCTION__[_ZZZN4node10BaseObject8MakeWeakEvENKUlRKN2v816WeakCallbackInfoIS0_EEE_clES5_E4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_keygen.o
`_ZZN4node14ThreadPoolWorkC4EPNS_11EnvironmentEE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_keygen.o: defined in discarded section `.rodata._ZZN4node14ThreadPoolWorkC4EPNS_11EnvironmentEE19__PRETTY_FUNCTION__[_ZZN4node14ThreadPoolWorkC4EPNS_11EnvironmentEE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_keygen.o
`_ZZN4node18MemoryRetainerNodeC4EPNS_13MemoryTrackerEPKNS_14MemoryRetainerEE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_keygen.o: defined in discarded section `.rodata._ZZN4node18MemoryRetainerNodeC4EPNS_13MemoryTrackerEPKNS_14MemoryRetainerEE19__PRETTY_FUNCTION__[_ZZN4node18MemoryRetainerNodeC4EPNS_13MemoryTrackerEPKNS_14MemoryRetainerEE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_keygen.o
`_ZZN4node6crypto13MallocOpenSSLIcEEPT_mE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_keygen.o: defined in discarded section `.rodata._ZZN4node6crypto13MallocOpenSSLIcEEPT_mE19__PRETTY_FUNCTION__[_ZZN4node6crypto13MallocOpenSSLIcEEPT_mE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_keygen.o
`_ZZN4node11SPrintFImplB5cxx11EPKcE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_keygen.o: defined in discarded section `.rodata._ZZN4node11SPrintFImplB5cxx11EPKcE19__PRETTY_FUNCTION__[_ZZN4node11SPrintFImplB5cxx11EPKcE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_keygen.o
`_ZZN4node6crypto13MallocOpenSSLIcEEPT_mE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_scrypt.o: defined in discarded section `.rodata._ZZN4node6crypto13MallocOpenSSLIcEEPT_mE19__PRETTY_FUNCTION__[_ZZN4node6crypto13MallocOpenSSLIcEEPT_mE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_scrypt.o
`_ZZN4node6crypto25ArrayBufferOrViewContentsIcEC4EN2v85LocalINS3_5ValueEEEE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_scrypt.o: defined in discarded section `.rodata._ZZN4node6crypto25ArrayBufferOrViewContentsIcEC4EN2v85LocalINS3_5ValueEEEE19__PRETTY_FUNCTION__[_ZZN4node6crypto25ArrayBufferOrViewContentsIcEC4EN2v85LocalINS3_5ValueEEEE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_scrypt.o
`_ZZN4node18MemoryRetainerNodeC4EPNS_13MemoryTrackerEPKNS_14MemoryRetainerEE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_x509.o: defined in discarded section `.rodata._ZZN4node18MemoryRetainerNodeC4EPNS_13MemoryTrackerEPKNS_14MemoryRetainerEE19__PRETTY_FUNCTION__[_ZZN4node18MemoryRetainerNodeC4EPNS_13MemoryTrackerEPKNS_14MemoryRetainerEE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_x509.o
`_ZZN4node10BaseObjectD4EvE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_x509.o: defined in discarded section `.rodata._ZZN4node10BaseObjectD4EvE19__PRETTY_FUNCTION__[_ZZN4node10BaseObjectD4EvE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_x509.o
`_ZZZN4node10BaseObject8MakeWeakEvENKUlRKN2v816WeakCallbackInfoIS0_EEE_clES5_E19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_x509.o: defined in discarded section `.rodata._ZZZN4node10BaseObject8MakeWeakEvENKUlRKN2v816WeakCallbackInfoIS0_EEE_clES5_E19__PRETTY_FUNCTION__[_ZZZN4node10BaseObject8MakeWeakEvENKUlRKN2v816WeakCallbackInfoIS0_EEE_clES5_E4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_x509.o
`_ZZN4node11Environment14AddCleanupHookEPFvPvES1_E19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_x509.o: defined in discarded section `.rodata._ZZN4node11Environment14AddCleanupHookEPFvPvES1_E19__PRETTY_FUNCTION__[_ZZN4node11Environment14AddCleanupHookEPFvPvES1_E4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_x509.o
`_ZZN4node6crypto13GetInfoStringILi177EEEN2v810MaybeLocalINS2_5ValueEEEPNS_11EnvironmentERKSt10unique_ptrI6bio_stNS_15FunctionDeleterIS9_XadL_Z12BIO_free_allEEEEEP7x509_stE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_x509.o: defined in discarded section `.rodata._ZZN4node6crypto13GetInfoStringILi177EEEN2v810MaybeLocalINS2_5ValueEEEPNS_11EnvironmentERKSt10unique_ptrI6bio_stNS_15FunctionDeleterIS9_XadL_Z12BIO_free_allEEEEEP7x509_stE19__PRETTY_FUNCTION__[_ZZN4node6crypto13GetInfoStringILi177EEEN2v810MaybeLocalINS2_5ValueEEEPNS_11EnvironmentERKSt10unique_ptrI6bio_stNS_15FunctionDeleterIS9_XadL_Z12BIO_free_allEEEEEP7x509_stE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_x509.o
`_ZZN4node6crypto13GetInfoStringILi85EEEN2v810MaybeLocalINS2_5ValueEEEPNS_11EnvironmentERKSt10unique_ptrI6bio_stNS_15FunctionDeleterIS9_XadL_Z12BIO_free_allEEEEEP7x509_stE19__PRETTY_FUNCTION__' referenced in section `.data' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_x509.o: defined in discarded section `.rodata._ZZN4node6crypto13GetInfoStringILi85EEEN2v810MaybeLocalINS2_5ValueEEEPNS_11EnvironmentERKSt10unique_ptrI6bio_stNS_15FunctionDeleterIS9_XadL_Z12BIO_free_allEEEEEP7x509_stE19__PRETTY_FUNCTION__[_ZZN4node6crypto13GetInfoStringILi85EEEN2v810MaybeLocalINS2_5ValueEEEPNS_11EnvironmentERKSt10unique_ptrI6bio_stNS_15FunctionDeleterIS9_XadL_Z12BIO_free_allEEEEEP7x509_stE4args]' of /home/midawson/io.js/out/Release/obj.target/libnode/src/crypto/crypto_x509.o
collect2: error: ld returned 1 exit status

I've tried on a few machines, but I'm guessing I must be missing something that needs to be installed, have not had time to look at the error messages to figure out what yet though.

@mhdawson
Copy link
Member

I just can't get it to work with asan. I even tried on ubuntu 18.04 which is what I think it runs on in the CI.

/home/node# cat /etc/issue
Ubuntu 18.04.5 LTS \n \l

The error I'm getting there is:

==44541==AddressSanitizer: failed to intercept '__isoc99_printf'
==44541==AddressSanitizer: failed to intercept '__isoc99_sprintf'
==44541==AddressSanitizer: failed to intercept '__isoc99_snprintf'
==44541==AddressSanitizer: failed to intercept '__isoc99_fprintf'
==44541==AddressSanitizer: failed to intercept '__isoc99_vprintf'
==44541==AddressSanitizer: failed to intercept '__isoc99_vsprintf'
==44541==AddressSanitizer: failed to intercept '__isoc99_vsnprintf'
==44541==AddressSanitizer: failed to intercept '__isoc99_vfprintf'
==44541==AddressSanitizer: libc interceptors initialized
|| `[0x10007fff8000, 0x7fffffffffff]` || HighMem    ||
|| `[0x02008fff7000, 0x10007fff7fff]` || HighShadow ||
|| `[0x00008fff7000, 0x02008fff6fff]` || ShadowGap  ||
|| `[0x00007fff8000, 0x00008fff6fff]` || LowShadow  ||
|| `[0x000000000000, 0x00007fff7fff]` || LowMem     ||
MemToShadow(shadow): 0x00008fff7000 0x000091ff6dff 0x004091ff6e00 0x02008fff6fff
redzone=16
max_redzone=2048
quarantine_size_mb=256M
malloc_context_size=30
SHADOW_SCALE: 3
SHADOW_GRANULARITY: 8
SHADOW_OFFSET: 0x7fff8000
==44541==Installed the sigaction for signal 11
==44541==Installed the sigaction for signal 7
==44541==Installed the sigaction for signal 8
==44541==T0: stack [0x7ffd75c9b000,0x7ffd7649b000) size 0x800000; local=0x7ffd76498c04
==44541==LeakSanitizer: Dynamic linker not found. TLS will not be handled correctly.
==44541==AddressSanitizer Init done
==44541==poisoning: 0x7ffd76498790 400
==44542==Could not attach to thread 44541 (errno 1).
==44542==Failed suspending threads.
==44541==LeakSanitizer has encountered a fatal error.
==44541==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
==44541==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)
tools/icu/icudata.target.mk:13: recipe for target '/home/node/out/Release/obj/gen/icudt68l.dat' failed
make[1]: *** [/home/node/out/Release/obj/gen/icudt68l.dat] Error 1
Makefile:104: recipe for target 'node' failed
make: *** [node] Error 2

@mhdawson
Copy link
Member

Looking at the history of the github action I think the difference is that it uses clang instead of gcc:

CC: clang
CXX: clang++
LINK: clang++

@mhdawson
Copy link
Member

hmm, that did not seem to fix it either :(

@mhdawson
Copy link
Member

Seems like the latest issue is that my latest runs are docker and that it needs privileges that are not available by default.

@mhdawson
Copy link
Member

ok got it to run, no recreate on first run under asan.

@mhdawson
Copy link
Member

Ok 1150 local runs of test_worker_terminate_finalization with asan enabled and nothing reported by asan and no recreates.

Since we've not been able to recreate locally and we have not seen it recreate in any of the CI runs since I think we should close and if it re-occurs we can figure out if there are any other ways to recreate.

@RaisinTen
Copy link
Contributor Author

RaisinTen commented Feb 10, 2021

@mhdawson
This issue reports how to reproduce this error: #37236
I'm reopening this so that it gets closed when this fix lands: #37303

@gabrielschulhof
Copy link
Contributor

I also tried to reproduce this crash locally with both gcc and clang on current master (ad3ebed) and was unable to reproduce this. I believe that #37303 fixes a different issue, as I explained in #37303 (comment).

So, until we find a reliable repro for this issue, or until flakiness of this test is once again reported, IMO we should close this issue. Feel free to re-open though, if you believe it should be open.

@RaisinTen
Copy link
Contributor Author

@gabrielschulhof Thank you for looking into this. I had reopened this since
@legendecas too thought that this issue is related here #37236 (comment).
I agree on keeping this closed till a repro is found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky-test Issues and PRs related to the tests with unstable failures on the CI.
Projects
None yet
Development

No branches or pull requests

6 participants