Node: assertion failure in ../src/node_worker.cc:647 with 4K worker threads

Created on 17 Mar 2020  路  3Comments  路  Source: nodejs/node

  • Version: master
  • Platform: linux
  • Subsystem: worker

While debugging #32265 I got this:

$ node --max-heap-size=100000 foo

../node[18430]: ../src/node_worker.cc:647:static void node::worker::Worker::StartThread(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `(uv_thread_create_ex(&w->tid_, &thread_options, [](void* arg) { Worker* w = static_cast<Worker*>(arg); const uintptr_t stack_top = reinterpret_cast<uintptr_t>(&arg); w->stack_base_ = stack_top - (kStackSize - kStackBufferSize); w->Run(); Mutex::ScopedLock lock(w->mutex_); w->env()->SetImmediateThreadsafe( [w = std::unique_ptr<Worker>(w)](Environment* env) { if (w->has_ref_) env->add_refs(-1); w->JoinThread(); }); }, static_cast<void*>(w))) == (0)' failed.
 1: 0xa08790 node::Abort() [../node]
 2: 0xa0880e  [../node]
 3: 0xaa4ed6 node::worker::Worker::StartThread(v8::FunctionCallbackInfo<v8::Value> const&) [../node]
 4: 0xbeb5ec  [../node]
 5: 0xbed3f7 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [../node]
 6: 0x13d5d59  [../node]

the definite root cause is the pthread_create failure. Should we capture this and convert into a runtime error? following the precedence of https://github.com/nodejs/node/pull/31621 ?

worker

Most helpful comment

I will pick it up!

All 3 comments

Should we capture this and convert into a runtime error? following the precedence of #31621 ?

That鈥檚 what I would suggest :+1:

/cc @HarshithaKP

I will pick it up!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cong88 picture cong88  路  3Comments

mcollina picture mcollina  路  3Comments

dfahlander picture dfahlander  路  3Comments

akdor1154 picture akdor1154  路  3Comments

srl295 picture srl295  路  3Comments