[Bug c++/115965] Stack smashing depending on order of declaration

2024-07-17 Thread nathan.teodosio at canonical dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115965 --- Comment #8 from Nathan Teodosio --- Ah sorry, I got fixated in the different behavior when swapping the order and didn't challenge the function. Thank you Andrew for elaborating on that and on -fsanitize=address, that is really appreciated!

[Bug c++/115965] Stack smashing depending on order of declaration

2024-07-17 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115965 --- Comment #7 from Andrew Pinski --- Note valgrind in this case cannot always capture buffer overruns due to it cann't easily add a redzone (buffer to detect overruns) for stack arrays. This is why -fsanitize=address is more powerful than both

[Bug c++/115965] Stack smashing depending on order of declaration

2024-07-17 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115965 Andrew Pinski changed: What|Removed |Added Resolution|--- |INVALID Status|UNCONFIRMED

[Bug c++/115965] Stack smashing depending on order of declaration

2024-07-17 Thread nathan.teodosio at canonical dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115965 --- Comment #5 from Nathan Teodosio --- In none of them. Or am I overlooking a buffer overrun here? Also with Clang I get no stack smashing even with -fstack-protector-all. In any case I fail to see why that would be dependent on which of the a

[Bug c++/115965] Stack smashing depending on order of declaration

2024-07-17 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115965 --- Comment #4 from Jonathan Wakely --- Jut to be clear on the bug being reported, are you expecting the error to be detected in all cases?

[Bug c++/115965] Stack smashing depending on order of declaration

2024-07-17 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115965 --- Comment #3 from Richard Biener --- I think that's somewhat expected.

[Bug c++/115965] Stack smashing depending on order of declaration

2024-07-17 Thread nathan.teodosio at canonical dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115965 --- Comment #2 from Nathan Teodosio --- Created attachment 58691 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58691&action=edit Source file

[Bug c++/115965] Stack smashing depending on order of declaration

2024-07-17 Thread nathan.teodosio at canonical dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115965 --- Comment #1 from Nathan Teodosio --- Created attachment 58690 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58690&action=edit Preprocessed file (compressed with Gzip)