title: How does gcc's -fstack-protector option prevent stack smashing?
body: <p>I've been running into a stack-smashing issue and I'm having difficulty finding the cause. The stack smashing error only happens occasionally, and only at the very end of the program's execution. It also stops happening completely when I compile it using the 'fstack-protector' option with gcc. I'm wondering if using the 'fstack-protector' option is an actual solution or if I'm just hiding the problem? I'd post the code but it's 3000 lines long and I'm not sure which part of the code is responsible.</p>