On 10/16/22 17:37, Rémi Bernon (@rbernon) wrote:
On Sun Oct 16 22:08:54 2022 +0000, **** wrote:
Zebediah Figura replied on the mailing list:
From "[PATCH 13/13] ntdll: Tweak KeUserModeCallback to please Valgrind and GDB." On 10/16/22 12:24, Rémi Bernon wrote: > This is a hack, but valgrind heuristics are having a hard time with > the stack manipulation around here. This silents some annoying reports. What heuristics? Can they be fixed on the valgrind side, and if not, why? (And if not, shouldn't we add comments in the ntdll side so this doesn't get broken again?)
In the same way as for the kernel stack, and even with separate stacks, it either misses some stack pointer changes and considers the accessed memory as invalid, or doesn't like accesses from/to the other, inactive stack pointer somehow.
Does Valgrind prohibit all access to alternative stacks? That seems like it would break any time a thread passes a stack pointer to another thread, or (if it's only within threads) a fiber to another fiber. If this really is broken, can it be fixed on the Valgrind side?