...exceeding the stack limit is usually considered a segmentation violation, and systems with enough memory management to detect it will send a SIGSEGV [segmentation fault] when it happens.
A typical symptom in a C++ program running on Linux is getting a segmentation fault when entering an innocent function like pow(). To debug, decrease stack usage (e.g. if there is a static array, decrease its size) in the code before the segfault, run your program in debug mode, see if your program continued further than before. Unfortunately, the same program might be working on Windows without problems.
To increase stack size on Linux, use ulimit -s <size_KB>
No comments:
Post a Comment