[clang] [AArch64] Stack probing for function prologues (PR #66524)

Momchil Velikov via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 25 01:50:37 PDT 2023


momchil-velikov wrote:


> I haven't been able to produce a minimal, sharable example as of yet, but I'm encountering a runtime error associated with an inlined function where stack probing is active. The error manifests as a null pointer dereference, originating from a stack value that is probed (and set to 0) before being subsequently dereferenced.

All the stack probing should have already finished before the call to `malloc`.

> I'm working to isolate this issue and will share a repro ASAP. In the meantime, any insights or suggestions based on this description would be greatly appreciated.

Just to make things simpler, can you try disabling the shrink-wrapping and see what happens?

> Also is it required to write to the value? Would reading the value be sufficient?
I can't really see a compelling reason to prefer one over another. Maybe for the odd chance some
kernel/runtime allocates read-only (as opposed to no access at all) guard regions.

Anyway, changing that won't solve the problem here, at most it could hide it.


https://github.com/llvm/llvm-project/pull/66524


More information about the cfe-commits mailing list