# Recursive subroutine stack overflow?

**URL:** <https://fortran-lang.discourse.group/t/recursive-subroutine-stack-overflow/5196>\
**Category:** Help\
**Created:** [February 13, 2023, 2:13pm UTC](https://fortran-lang.discourse.group/t/recursive-subroutine-stack-overflow/5196 "2023-02-13T14:13:43Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![FedericoPerini](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/federicoperini/32/1750_2.png) [@FedericoPerini](https://fortran-lang.discourse.group/u/FedericoPerini)\
**Post date:** [February 13, 2023, 4:58pm UTC](https://fortran-lang.discourse.group/t/recursive-subroutine-stack-overflow/5196/3 "2023-02-13T16:58:57Z")

</div>

Thank you @FortranFan! I’m experimenting with `-fmax-stack-var-size=XYZ` as suggested by @shahmoradi in [-frecursive .vs. fmax-stack-var-size .vs. -unlimit -s](https://fortran-lang.discourse.group/t/frecursive-vs-fmax-stack-var-size-vs-unlimit-s/2970/3), but now I’m getting an internal compiler error elsewhere with the `associate` construct:

```auto
   48 | associate(watch=>settings%timers%diffusion,s=>settings)
      | 1
internal compiler error: Segmentation fault
libbacktrace could not find executable to open
Please submit a full bug report, with preprocessed source (by using -freport-bug).

```

It must have to do with the fact that `associate` creates stack variables?

---

_[View the full topic](https://fortran-lang.discourse.group/t/recursive-subroutine-stack-overflow/5196)._
