add stack overflow checks in assertion builds