1

Can a recursive call in a function lead to a segmentation fault if the memory stack use is high?

VLAZ
  • 26,331
  • 9
  • 49
  • 67
llecxe
  • 113
  • 1
  • 4
  • 1
    yes, see for example https://stackoverflow.com/questions/59739589/why-segmentation-fault-error-in-recursive-function/59751808#59751808 where it just happened, even with small calls – B. Go Jan 17 '20 at 17:51

1 Answers1

0

Can a recursive call in a function lead to a segmentation fault if the memory stack use is high?

Yes: this happens all the time if you try to execute on a small stack, if you use too much, or if you have infinite recursion.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362