美文网首页
Stack smashing detected

Stack smashing detected

作者: SnC_ | 来源:发表于2021-01-19 15:41 被阅读0次

Stack Smashing here is actually caused due to a protection mechanism used by gcc to detect buffer overflow errors.

gcc adds protection variables (called canaries) which have known values. A stack overflow error causes corruption of this variable resulting in SIGABRT to terminate the program.

you can try disabling this protection of gcc using option -fno-stack-protector while compiling. In that case you will get a different error, most likely a segmentation fault as you are trying to access an illegal memory location. Note that -fstack-protector should always be turned on for release builds as it is a security feature.

References:
https://stackoverflow.com/questions/1345670/stack-smashing-detected
https://www.educative.io/edpresso/what-is-the-stack-smashing-detected-error

相关文章

网友评论

      本文标题:Stack smashing detected

      本文链接:https://www.haomeiwen.com/subject/nlzqzktx.html