add should-never-happen sanity check of cached stack size