15 ms·
Is there anywhere to read up on the bustedness of the stack probing feature? (apart from the obvious incompatibility with trying to do that for kernel code).
by caf 9y ago
Is there anywhere to read up on the bustedness of the stack probing feature? (apart from the obvious incompatibility with trying to do that for kernel code).
- JdeBP 9y agoProbing more than a page size below the current stack pointer is wrong. Probing more than a page size further when one's saved frame area, save area, locals area, and (maximum) calling parameters area do not amount to a page in total is also wrong. For more on the considerations that underpin stack probing, see http://jdebp.eu./FGA/function-perilogues.html#StackProbes http://jdebp.eu./FGA/function-perilogues.html#StackProbes for starters.
- amluto 9y agoAlso, the probe does an unlocked RMW (or 0) instead of a read, which is slower but also wrong in a multithreaded application. The latter is what broke Go.
- caf 9y agoIs that because Go crams the thread stacks closely together and it probed into another thread's stack? Regardless, it seems like RMW (or even just a store) should be fine as long as the stack pointer is adjusted before the probe.