I'm seeing errors with Valgrind on 15.3-ALPHA2 These are due to Valgrind not redirecting timingsafe_memcmp. Here is an extract of the output of valgrind --trace-symtab=yes for libc.so timingsafe_bcmp included for comparison. raw symbol [ 122]: GLO FUN : svma 0x0000166c08, sz 348 timingsafe_bcmp rec(t) [ 122]: val 0x0004a47c08, sz 348 timingsafe_bcmp raw symbol [1355]: GLO FUN : svma 0x0000166d64, sz 0 timingsafe_memcmp ignore -- size=0: timingsafe_memcmp You can see the same thing with readelf: readelf -s /lib/libc.so.7 | grep timingsafe_m 1355: 0000000000166d64 0 FUNC GLOBAL DEFAULT 14 timingsafe_memcmp Valgrind does not accept functions with a zero size for redirection, and this is causing errors. Probably not too serious or frequent. I see the cause of the error https://github.com/freebsd/freebsd-src/blob/main/lib/libc/aarch64/string/timingsafe_memcmp.S There is a copy and paste error at the end, using END(timingsafe_bcmp) instead of END(timingsafe_memcmp)
(In reply to Paul Floyd from comment #0) 15.3-ALPHA2 doesn't exist yet. Which version are you running?
I meant 15.0-ALPHA2. I haven’t looked at the git history to see when timingsafe_mempcmp.S was added. All versions since then will be affected. I guess that it is only on the 15 and16 branches as I’ve not seen it on 14.3-RELEASE.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=7feac79331bc8c77e2f8a3e71d6ea087fa17b61d commit 7feac79331bc8c77e2f8a3e71d6ea087fa17b61d Author: Paul Floyd <pjfloyd@wanadoo.fr> AuthorDate: 2025-09-25 19:49:08 +0000 Commit: Robert Clausecker <fuz@FreeBSD.org> CommitDate: 2025-09-26 09:04:54 +0000 libc/aarch64: fix ELF size of timingsafe_memcmp Looks like a copy and paste error. The ELF size of 0 prevents Valgrind from redirecting this function. PR: 289845 Reviewed by: fuz Fixes: 3f224333af163d5fcd7547a20993dcf18f19076c See also: https://bugs.kde.org/show_bug.cgi?id=509406 Pull Request: https://github.com/freebsd/freebsd-src/pull/1854 MFC after: 1 day Event: EuroBSDcon 2025 lib/libc/aarch64/string/timingsafe_memcmp.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Good catch!
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=510a9e3885e7852e420bea01dcb0247827ea932c commit 510a9e3885e7852e420bea01dcb0247827ea932c Author: Paul Floyd <pjfloyd@wanadoo.fr> AuthorDate: 2025-09-25 19:49:08 +0000 Commit: Robert Clausecker <fuz@FreeBSD.org> CommitDate: 2025-09-27 08:51:33 +0000 libc/aarch64: fix ELF size of timingsafe_memcmp Looks like a copy and paste error. The ELF size of 0 prevents Valgrind from redirecting this function. PR: 289845 Reviewed by: fuz Fixes: 3f224333af163d5fcd7547a20993dcf18f19076c See also: https://bugs.kde.org/show_bug.cgi?id=509406 Pull Request: https://github.com/freebsd/freebsd-src/pull/1854 MFC after: 1 day Event: EuroBSDcon 2025 (cherry picked from commit 7feac79331bc8c77e2f8a3e71d6ea087fa17b61d) lib/libc/aarch64/string/timingsafe_memcmp.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Fixed and MFC'ed! Thank you for your contribution.