Skip to content

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

Closed
@gireeshpunathil

Description

@gireeshpunathil
  • 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 #31621 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    workerIssues and PRs related to Worker support.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions