如果运行的时候报“*** stack smashing detected ***, 那是因为你的系统默认使用了GCC的“ -fstack-protector"参数导致的,我们只需要在编译的时候 export CFLAGS="-fno-stack-protector"就好。
eclipse里面配置位置:C/C++ Build -> Setting -> GCC C++ Compiler -> Debugging -> Other Debugging flags,输入:-fno-stack-protector