![gcc stack smashing detected gcc stack smashing detected](https://i.stack.imgur.com/NgwSp.png)
Note that -fstack-protector should always be turned on for release builds as it is a security feature. In that case you will get a different error, most likely a segmentation fault as you are trying to access an illegal memory location. To get some insight, you can try disabling this protection of gcc using option -fno-stack-protector while compiling. An input string of size greater than 10 causes corruption of this variable resulting in SIGABRT to terminate the program. The compiler, (in this case gcc) adds protection variables (called canaries) which have known values. For example in the following snippet: #include Strcpy(ch_code, code.Stack Smashing here is actually caused due to a protection mechanism used by gcc to detect buffer overflow errors. *** stack smashing detected ***: a.out terminated
![gcc stack smashing detected gcc stack smashing detected](https://p-blog.csdn.net/images/p_blog_csdn_net/zzmfish/EntryImages/20091220/leak3.png)
![gcc stack smashing detected gcc stack smashing detected](https://1.bp.blogspot.com/-Ed0pgDrGQy8/X6wVsPa3EHI/AAAAAAAAQFM/E2xTelp3MqIsz5mG_KjS8KLyuQa9oMAWwCLcBGAsYHQ/s1848/stackcrash_ssh.gif)
Here is a copy of the error: Enter a bank routing number: I've tried changing the array sizes and with no luck, I'm still getting this error. I've been trying to debug this program for a while now and can't quite see where this error is originating from. BUT, when I run it through our Ubuntu student server, I get this crazy error. Every time I run this program on NetBeans, I have no issue. So I'm working on a program in my Programming I class and we were assigned to create a program that will check to see if a routing number from a bank is valid.