Created attachment 184479 [details] add minimal scalar test for amd64-linux To test the amd64 syscall wrappers I added a minimal scalar.c based on the existing versions. I added a filter to suppress the line numbers as they only cause unnecessary large patches when new syscalls get added.
A minimal scalar test for amd64-linux would indeed be nice to have. And this one looks fine. Thanks. But as you already seen it is slightly messy to extend this. So we have been reusing the Linux Test Project testsuite to more fully test all syscalls. make ltpchecks Of course the trouble with that is that there are some syscalls (corner cases) valgrind just cannot support. But there are auxprogs/ltp-excludes.txt and auxprogs/ltp-error-patterns.txt The goal of the scalar tests and the ltpchecks are slightly different though. The scalar test make sure valgrind memcheck reports on bad/undefined arguments. The ltpchecks make sure valgrind none/memcheck work exactly the same as when the test wasn't run under valgrind.
My experience of messiness in the scalar tests is with any new syscalls. The problem is that you may need to handle several different kernel versions, some with and some without new syscalls. The way that this was handled in Solaris / illumos was to add a new scalar test for each new syscall, each having a configure test. On FreeBSD I added fake output for older kernels that don't support new syscalls. On Linux there's also the issue of different syscall numbers on different platforms. Still, I like the syscall test. It does a lot of quick testing.
Created attachment 184550 [details] add minimal scalar test for amd64-linux (V2)
Thanks for the patch! commit 446ee179cec7dae91534bb781ef3defae26a4e10 (HEAD -> master, origin/master, origin/HEAD) Author: Matthias Schwarzott <zzam@gentoo.org> Date: Sat Aug 23 13:37:46 2025 +0200 Bug 508777 - amd64-linux: add minimal scalar test