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

[v10.x backport] inspector: more conservative minimum stack size #33720

Conversation

Flarna
Copy link
Member

@Flarna Flarna commented Jun 4, 2020

We see crashes in some musl docker environments caused by stack overflow in inspector thread. This happens during signal handling which is used as fallback by musl-libc in case syscall membarrier is not allowed by the secprofile.

fyi @bnoordhuis - the initial PR was done by you

PTHREAD_STACK_MIN is 2 KB with musl, which is too small to safely
receive signals. PTHREAD_STACK_MIN + MINSIGSTKSZ is 8 KB on arm64,
which is the musl architecture with the biggest MINSIGSTKSZ so let's
use that as a lower bound and let's quadruple it just in case.

PR-URL: #27855
Reviewed-By: Colin Ihrig cjihrig@gmail.com
Reviewed-By: James M Snell jasnell@gmail.com
Reviewed-By: Eugene Ostroukhov eostroukhov@google.com
Reviewed-By: Anna Henningsen anna@addaleax.net
Reviewed-By: Rich Trott rtrott@gmail.com

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. inspector Issues and PRs related to the V8 inspector protocol v10.x labels Jun 4, 2020
PTHREAD_STACK_MIN is 2 KB with musl, which is too small to safely
receive signals. PTHREAD_STACK_MIN + MINSIGSTKSZ is 8 KB on arm64,
which is the musl architecture with the biggest MINSIGSTKSZ so let's
use that as a lower bound and let's quadruple it just in case.

Backport-PR-URL: nodejs#33720
PR-URL: nodejs#27855
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Jun 4, 2020

@Flarna Flarna added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 7, 2020
@datvong-wm
Copy link

Would also like this patch merged into v10.

@Flarna
Copy link
Member Author

Flarna commented Jun 23, 2020

@nodejs/lts Any chance that we get this into a release?

@richardlau
Copy link
Member

@nodejs/lts Any chance that we get this into a release?

I'll try to include this in the next 10.x release.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Jul 1, 2020

richardlau pushed a commit that referenced this pull request Jul 1, 2020
PTHREAD_STACK_MIN is 2 KB with musl, which is too small to safely
receive signals. PTHREAD_STACK_MIN + MINSIGSTKSZ is 8 KB on arm64,
which is the musl architecture with the biggest MINSIGSTKSZ so let's
use that as a lower bound and let's quadruple it just in case.

Backport-PR-URL: #33720
PR-URL: #27855
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@richardlau
Copy link
Member

Landed in aaf2f82.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. inspector Issues and PRs related to the V8 inspector protocol
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants