sgcheck does not work on the ARM architecture. Function entry/exit could be tracked by using a shadow stack to get around the issue of ARM link register usage?
All going well, I should be able to submit a patch in the next few days. It needs some tidying up first. This is what I believe needs changing: 1) Support leaf functions that do not use the stack. This is the fix Chris mentioned. As it stands, sgcheck pushes the caller's stack frame when it reaches a function call, and it pops the stack frame when the stack pointer is reset. This is OK for x86, since, I believe, every function uses the stack. On ARM, however, a small leaf function may not use the stack, so sgcheck won't see its return. The best thing to do seems to be to add a 'creation_ip' field to _StackFrame, giving the address of the corresponding call instruction. On ARM, on function return, if the target address is the instruction after creation_ip for the innermost stack frame, then it should be recognised as the function return. 2) Describe the frame pointer (R11) in VEX/priv/guest_arm_helpers.c. This is the only proposed change outside the exp-sgcheck/ directory. 3) Use a maximum of four arguments per helper call. Argument marshalling for ARM only supports four arguments (see the comment at the top of doHelperCall in VEX/priv/host_arm_isel.c). Four arguments is enough for the standard tools such as memcheck, and it seems sensible for now to work around this limitation, rather than fixing it. 4) Ignore load linked and store conditional instructions. Since it is an experimental tool, there is probably no need to support these instructions properly, but "the impossible" was happening somewhere inside the C library. All regression tests except 'stackerr' are passing on ARM. The correct output for stackerr already depends on the architecture (AMD vs Intel). Although the output on ARM matches neither, it looks plausible.
> 2) Describe the frame pointer (R11) in VEX/priv/guest_arm_helpers.c. Watch out for Thumb mode, where the frame pointer is in R7...
Any news?
*** Bug 340021 has been marked as a duplicate of this bug. ***
I know that it could be time consuming to implement that feature, but if I have to vote for a new feature to be introduced I would vote for that one :)