Which stream does “stack smashing detected” message get printed to?
问题 Consider the following very basic program, which has appeared in many forms on other questions here. #include <string.h> int main() { char message[8]; strcpy(message, "Hello, world!"); } On my system, if I put this in a file called Classic.c , compile it with no special flags and run it, I get the following output. $ gcc -o Classic Class.c $ ./Classic *** stack smashing detected ***: ./Classic terminated Aborted (core dumped) Normally, program output goes to stderr or stdout , so I expected