I see a crash/segfault in couchbase 3.2.1 with following callstack:
thread: 0 - stack range: 0x00007ffdbd6de000-0x00007ffdbd6ff000, size: 132 kB
0x00007ffdbd6fb948 0x0000000000bb1720 node!v8::Context::GetIsolate()+0x0
0x00007ffdbd6fb950 0x00007fdec1cad389 couchbase_impl.node!couchnode::addondata::Get()+0x19
0x00007ffdbd6fb960 0x00007fdec1cc4d6d couchbase_impl.node!couchnode::Connection::~Connection()+0x1d
0x00007ffdbd6fb980 0x00007fdec1cc4eb1 couchbase_impl.node!couchnode::Connection::~Connection()+0x11
0x00007ffdbd6fb9a0 0x0000000000d1fb0a node!v8::internal::GlobalHandles::InvokeFirstPassWeakCallbacks()+0xfa
0x00007ffdbd6fba30 0x0000000000d64a95 node!v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags)+0x225
0x00007ffdbd6fbb50 0x0000000000d65a25 node!v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)+0x215
0x00007ffdbd6fbc30 0x0000000000d684dc node!v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment)+0x4c
0x00007ffdbd6fbc80 0x0000000000d2eefb node!v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin)+0x2b
0x00007ffdbd6fbcb0 0x00000000010714ce node!v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*)+0x9e
0x00007ffdbd6fbce0 0x000000000140dc19 node!<imagebase>+0x100dc19
0x00007ffdbd6fbcf0 0x0000000001477614 node!<imagebase>+0x1077614
0x00007ffdbd6fbd00 0x00000000013934a4 node!<imagebase>+0xf934a4
0x00007ffdbd6fbd10 0x000000000138cafc node!<imagebase>+0xf8cafc
0x00007ffdbd6fbd20 0x00000000013934a4 node!<imagebase>+0xf934a4
0x00007ffdbd6fbd30 0x0000000001390a1d node!<imagebase>+0xf90a1d
0x00007ffdbd6fbd40 0x00000000013907f8 node!<imagebase>+0xf907f8
0x00007ffdbd6fbd50 0x0000000000cec9d0 node!v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&)+0x1b0
0x00007ffdbd6fc010 0x0000000000cece88 node!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>*)+0x58
0x00007ffdbd6fc0a0 0x0000000000bac2cb node!v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*)+0x16b
0x00007ffdbd6fc1d0 0x00007fdec1cca7e5 couchbase_impl.node!couchnode::Logger::handler(unsigned int, char const*, int, char const*, int, char const*, __va_list_tag*)+0x4b5
0x00007ffdbd6fc2c0 0x00007fdec1cca991 couchbase_impl.node!couchnode::Logger::lcbHandler(lcb_LOGGER_ const*, unsigned long, char const*, lcb_LOG_SEVERITY, char const*, int, char const*, __va_list_tag*)+0x51
0x00007ffdbd6fc320 0x00007fdec1d5e034 couchbase_impl.node!lcb_log+0x94
0x00007ffdbd6fc410 0x00007fdec1d6a5d0 couchbase_impl.node!CccpProvider::schedule_next_request(lcb_STATUS, bool)+0x240
0x00007ffdbd6fc480 0x00007fdec1ce99f0 couchbase_impl.node!timer_callback(int, short, void*)+0x30
0x00007ffdbd6fc4a0 0x000000000136fcf5 node!uv__run_timers+0x35
0x00007ffdbd6fc4d0 0x000000000137428a node!uv_run+0x8a
0x00007ffdbd6fc540 0x0000000000a5d726 node!node::NodeMainInstance::Run()+0x1f6
0x00007ffdbd6fc660 0x00000000009eab6c node!node::Start(int, char**)+0x2ac
0x00007ffdbd6fc7e0 0x00007fdec89d40b3 libc-2.31.so!<imagebase>+0x20b3
I found following in node.h indicating that during GC no context is active: https://github.com/nodejs/node/blob/ff7a0df3a5d9cb386c774e1cf305b3adf0d04024/src/node.h#L979-L988
But addondata::Get()
is actually fetching the current context and using it: https://github.com/couchbase/couchnode/blob/ce33fad127640d90dc19db7832d3fce557ffc308/src/addondata.cpp#L45-L49