Closed
Description
pthreads has a minimum stack size of 16KB, if you try to set it to lower than this, pthread_attr_setstacksize
will return EINVAL
. 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.