|
|
|
|
|
by anyfoo
1415 days ago
|
|
That seems to be what -fstack-check for gcc is doing: "If neither of the above are true, GCC will generate code to periodically “probe” the stack pointer using the values of the macros defined below."[1] I guess I'm wondering why this isn't always on if it solves the problem with negligible cost? Genuine question, not trying to make a point. [1] https://gcc.gnu.org/onlinedocs/gccint/Stack-Checking.html |
|
* It should be fast, but I haven't found a benchmark.
* There appear to be some issues of signals hitting at the wrong time vs. angering valgrind, depending on probe timing.
* Probes like this are mandatory on windows to make sure the stack is allocated, so it can't be that bad.