cap max stack size at 32 bit limit (#17019)
Resolves #17019 (closed)
When we set the stacksize, which is 32bit, we no longer just shove a 64-bit value in there, but instead check if it is too large, and if so, set the max size we are actually allowed to.