Stack size is visible and settable. This article describes a non-issue. A programmer just has to be knowledgable about the tools at his disposal. Here's an example
cat <<EOF>demo.c
#include <sys/resource.h>
#include <stdio.h>
#include <unistd.h>
int main(int argc, char *argv[], char *envp[]) {
struct rlimit rlp = { 0 };
getrlimit(RLIMIT_STACK, &rlp);
printf("stack size=%llu\n", rlp.rlim_cur);
if (rlp.rlim_cur < rlp.rlim_max) {
printf("setting stack size to %llu\n", rlp.rlim_max);
rlp.rlim_cur = rlp.rlim_max;
setrlimit(RLIMIT_STACK, &rlp);
execve(argv[0], argv, envp);
}
}EOF
make demo
./demo
Similarly, there is pthread_attr_setstacksize(3), which does the obvious thing for threads.