Created attachment 168062 [details] Test showing erroneous behaviour for linux/aarch64 Accessing the arguments to signal handlers in aarch64 binaries can create "Conditional jump or move depends on uninitialized value" diagnostics. Comparing the code for the aarch64 signal frame creation to that for x86_64 shows the problem - the values for the registers used for passing arguments (X0 thru X3) are modified, but the required `VG_TRACK( post_reg_write, ...` macros are not invoked to indicate that the registers now have well defined values. Adding these VG_TRACK macros in fixes the issue. The attached test.c shows the problem under `valgrind` without the fix, but succeeds with it.
Created attachment 168063 [details] Patch for issue
I fully agree with this. I've done a port to FreeBSD arm64 and I did exactly the same thing https://github.com/paulfloyd/freebsdarm64_valgrind/commit/d6d97cb954ef10c66ee117f536f92659dcbacf65
I'll need to make a few changes to the testcase (so that it compiles on FreeBSD and doesn't have an infinite loop).
Change and slightly modified test pushed. Thanks! commit 97854e557ebc5df690103808a45fa282d5adfd96 (HEAD -> master, origin/master, origin/HEAD) Author: Paul Floyd <pjfloyd@wanadoo.fr> Date: Wed Apr 3 08:32:12 2024 +0200 Bug 484935 - [patch] Valgrind reports false "Conditional jump or move depends on uninitialised value" errors for aarch64 signal handlers Patch contributed by Peter Edwards <peadar@arista.com> Testcase modified and added to a new directory, memcheck/tests/arm64
Thanks for the fast turn-around!
(In reply to Peter Edwards from comment #5) > Thanks for the fast turn-around! You're welcome. It helps that I'd already done the same. I wish that more issues here coule be so easy.