I have recently debugged a very strange problem that caused a segmentation fault.
Basically, the problem went away after I have moved a couple of very large arrays that were declared as local variables to being global, which means as far as I know that I moved them from the stack to the heap space. Nothing else was changed. The segmentation fault itself appeared in very old and stable code that was also shared across other programs that did not experience any segmentation faults.
In total, these arrays were about 1.5 MB in size.
Is it possible that a too large stack can cause a segmentation fault by overwriting/messing up function pointers?
My feeling is that such a thing should be caught by the compiler, but I have absolutely no other way of explaining this behaviour.
The platform is Linux (Ubuntu 18.04)