Tuesday, November 14, 2006
Resolving stack_chk_fail Error
Today I moved to the new version of gcc 4.1.2. When trying to compile Xen, it kept giving me a 'stack_chk_fail' symbol not found error.
Took me 4 hours to figure out that it wasn't a problem with Xen but with my gcc.
Apparently the new version of gcc emits extra code to check for buffer overflows, such as stack smashing attacks by default whereas my kernel did not support it and I had been using 2.6.17.10 !
Anyways resolved the problem by adding -fno-stack-protector to the CFLAGS option in the Makefile.
Took me 4 hours to figure out that it wasn't a problem with Xen but with my gcc.
Apparently the new version of gcc emits extra code to check for buffer overflows, such as stack smashing attacks by default whereas my kernel did not support it and I had been using 2.6.17.10 !
Anyways resolved the problem by adding -fno-stack-protector to the CFLAGS option in the Makefile.
Comments:
<< Home
Hi,
I run into this same problem. But because I am not that familiar with C/C++ makefiles I don't know what to edit. Could you tell me which file and line I should edit to make it work. I have tried using CFLAGS on the commadline "make linux-2.6-xen-build CFLAGS=-fno-stack-protector" but that just gave me a new set of errors :)
If you could mail a solution to my yahoo address jkommeri@yahoo.com, it would save me a lot of hacking time :)
thanks,
Jukka
I run into this same problem. But because I am not that familiar with C/C++ makefiles I don't know what to edit. Could you tell me which file and line I should edit to make it work. I have tried using CFLAGS on the commadline "make linux-2.6-xen-build CFLAGS=-fno-stack-protector" but that just gave me a new set of errors :)
If you could mail a solution to my yahoo address jkommeri@yahoo.com, it would save me a lot of hacking time :)
thanks,
Jukka
Hi.
Thanks fro the post. I feel i am close to solving it .however my compiler is g++ and adding -fno-stack-protector seem to introudce new errors. So could kindly lemme know f there is an alternative ?
Thanks
Sankar
Post a Comment
Thanks fro the post. I feel i am close to solving it .however my compiler is g++ and adding -fno-stack-protector seem to introudce new errors. So could kindly lemme know f there is an alternative ?
Thanks
Sankar
<< Home