# Can StackOverflow exceptions be reliably caught?

**URL:** <https://discourse.julialang.org/t/can-stackoverflow-exceptions-be-reliably-caught/109178>\
**Category:** General Usage\
**Created:** [January 24, 2024, 2:32am UTC](https://discourse.julialang.org/t/can-stackoverflow-exceptions-be-reliably-caught/109178 "2024-01-24T02:32:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [January 24, 2024, 2:32am UTC](https://discourse.julialang.org/t/can-stackoverflow-exceptions-be-reliably-caught/109178/1 "2024-01-24T02:32:01Z")

</div>

In several languages you can’t catch StackOverflowExceptions ([C# for example](https://stackoverflow.com/questions/1599219/c-sharp-catch-a-stack-overflow-exception))  
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.

---

<div class="post-metadata">

**Author:** ![Keno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/keno/32/285_2.png) [@Keno](https://discourse.julialang.org/u/Keno)\
**Post date:** [January 24, 2024, 4:13am UTC](https://discourse.julialang.org/t/can-stackoverflow-exceptions-be-reliably-caught/109178/2 "2024-01-24T04:13:49Z")

</div>

> [@oxinabox](#):
>
> Can I rely on being able to catch StackOverflows in julia?

No. See [What to do about asynchronous exceptions · Issue #52291 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/52291).
