GCC Bugzilla – Bug 38274
why the option "-fstack-protector-all" doesn't works?
Last modified: 2008-12-24 02:53:59 UTC
char a = 1;
int b = 2;
short c = 3;
char sztmp = "hello worlds!";
invoke gcc by :gcc -fstack-protector-all test.c;
after my debugging a.out, I find the gcc doesn't adding a guard variable to functions's local stack vars, and the var "sztmp" follows var "a" and there aren't any room between the two vars.
Works for me with the trunk on i386-darwin8.11:
[236:~] apinski% ~/local-gcc/bin/gcc t.c -fstack-protector-all
[236:~] apinski% ./a.out
*** stack smashing detected ***: terminated
(In reply to comment #1)
> Works for me with the trunk on i386-darwin8.11:
> [236:~] apinski% ~/local-gcc/bin/gcc t.c -fstack-protector-all
> [236:~] apinski% ./a.out
> *** stack smashing detected ***: terminated
> Illegal instruction
what 's the version of the gcc src code you tried?
can you try the gcc version 4.1.2
(In reply to comment #2)
> what 's the version of the gcc src code you tried?
Trunk meaning 4.4.0.
Considering they just closed the gcc 4.2 branch, the earliest one worth testing would be gcc 4.3.2.