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

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

Closed
gireeshpunathil opened this issue Mar 17, 2020 · 3 comments
Closed
Labels
worker Issues and PRs related to Worker support.

Comments

@gireeshpunathil
Copy link
Member

  • 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 ?

@addaleax
Copy link
Member

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

That’s what I would suggest 👍

@addaleax addaleax added the worker Issues and PRs related to Worker support. label Mar 17, 2020
@addaleax
Copy link
Member

/cc @HarshithaKP

@HarshithaKP
Copy link
Member

I will pick it up!

HarshithaKP added a commit to HarshithaKP/node that referenced this issue Mar 21, 2020
with large number of worker threads pthread
fails with hard assertion.
Instead of hard assertion throw a runtime error.

Refs: nodejs#32319
addaleax pushed a commit that referenced this issue Mar 30, 2020
With large number of worker threads pthread
fails with hard assertion.
Instead of hard assertion throw a runtime error.

PR-URL: #32344
Fixes: #32319
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit to targos/node that referenced this issue Apr 25, 2020
With large number of worker threads pthread
fails with hard assertion.
Instead of hard assertion throw a runtime error.

PR-URL: nodejs#32344
Fixes: nodejs#32319
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this issue Apr 28, 2020
With large number of worker threads pthread
fails with hard assertion.
Instead of hard assertion throw a runtime error.

PR-URL: #32344
Fixes: #32319
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
worker Issues and PRs related to Worker support.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants