Handle users requesting a too-small stack size #11694
Labels
A-runtime
Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
I-crash
Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
pthreads has a minimum stack size of 16KB, if you try to set it to lower than this,
pthread_attr_setstacksize
will returnEINVAL
. We don't really handle the errors properly (other than checking the return code), so a user requesting a small stack hits the assert, which isn't very helpful.There are two options for dealing with this: silently clamp the value to the minimum size for whatever platform we're on, or throw a real error somewhere higher in the callstack with a better error message.
I would just fix it, but I feel I need some input on which choice to make.
The text was updated successfully, but these errors were encountered: