LaVOZs

The World’s Largest Online Community for Developers

'; Can stack overflow through recursion cause a segmentation fault? - LavOzs.Com

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

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.

Related
What is a segmentation fault?
What is the difference between a segmentation fault and a stack overflow?
Determine the line of code that causes a segmentation fault?
Stack Overflow and Segmentation Fault
Why stack overflow on some machines, but segmentation fault on another?
Recursion segmentation fault and StackGuard
Can a stack overflow result in something other than a segmentation fault?
Why stack overflow causes bus error 10 and not segmentation fault