Is there a standard way to see how much stack space your app has and what the highest watermark for stack usage is during a run?
Also in the dreaded case of actual o
On Linux, the Gnu libsigsegv library includes the function stackoverflow_install_handler
, which can detect (and in some cases help you recover from) stack overflow.
Some compilers support stackavail() function, which returns the amount of remaining free space of the stack. You can use this function before calling functions in your programs that require a lot of stack space, to determine if it is safe to call them
I would suggest you to use alternate-signal-stack if you are on linux.