Can StackOverflow exceptions be reliably caught?

In several languages you can’t catch StackOverflowExceptions (C# for example)
I believe this is because the stack is full so there is no space left to put the error handling frames.
Other languages I believe keep some stack space reserved for this?

Can I rely on being able to catch StackOverflows in julia?
For a particular part of my code I know stackoverflows are possible but that have a work around if the user defines the right methods.
I would like to catch the stackoverflow if it does occur and give the user advise as to what methods they need to implement.

No. See What to do about asynchronous exceptions · Issue #52291 · JuliaLang/julia · GitHub.

1 Like