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

toffaletti/libten,toffaletti/libten,toffaletti/libten,toffaletti/libten,toffaletti/libten