Date: Tue, 19 May 2026 16:46:41 +0000 From: Mark Johnston <markj@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 8eab86fb3f15 - stable/14 - netbsd-tests: Fix the mmap_truncate_signal test Message-ID: <6a0c93f1.1d3a2.ce99787@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8eab86fb3f155e5de86a53e96b9bc87c512d56e8 commit 8eab86fb3f155e5de86a53e96b9bc87c512d56e8 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2026-04-26 01:53:45 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2026-05-19 16:46:28 +0000 netbsd-tests: Fix the mmap_truncate_signal test Add a volatile qualifier in the loop which triggers SIGBUS, as otherwise the compiler is smart enough to elide it, replacing it with a check for page != 0. MFC after: 1 week (cherry picked from commit e3b8e55e710bf355f371d798aa943281007a7ea9) --- contrib/netbsd-tests/lib/libc/sys/t_mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/netbsd-tests/lib/libc/sys/t_mmap.c b/contrib/netbsd-tests/lib/libc/sys/t_mmap.c index b62c6299d3c2..5b9685658f65 100644 --- a/contrib/netbsd-tests/lib/libc/sys/t_mmap.c +++ b/contrib/netbsd-tests/lib/libc/sys/t_mmap.c @@ -504,7 +504,7 @@ ATF_TC_BODY(mmap_truncate_signal, tc) ATF_REQUIRE(signal(SIGSEGV, map_sighandler) != SIG_ERR); sta = 0; for (i = 0; i < page; i++) - sta += map[i]; + sta += ((volatile char *)map)[i]; /* child never will get this far, but the compiler will not know, so better use the values calculated to prevent the access to be optimized out */home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a0c93f1.1d3a2.ce99787>
