Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> you have to anticipate and handle a stack overflow cleanly. How do you do this?

You use sigaltstack and catch SIGSEGV.

It's probably easier to handle if you hit a soft limit rather than the heap. Then you raise the limit, set a flag to make your functions unwind and reduce the limit again.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: