]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
FreeBSD regtest: turn off a few gdbserver tests on systems with sysctl debug.ptrace_a...
authorPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 25 Nov 2025 20:04:17 +0000 (21:04 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 25 Nov 2025 20:04:17 +0000 (21:04 +0100)
FreeBSD 15 (out soon) and 16 (the dev branch) have changed the behaviour
of ptrace. When vgdb uses ptrace to get Valgrind to poll gdbserver
to get out of blocking syscalls the client may return a bogus result
from the syscall.

Setting the syscall to 0 turns off this change and all 3 affected testcases
should return to normal behaviour. However, setting the syscall needs root
privileges. So I've added a test to see if the syscall is present and set
to 1. If it is the prereq is not satisfied.

gdbserver_tests/mcinvokeWS.vgtest
gdbserver_tests/nlcontrolc.vgtest
gdbserver_tests/nlsigvgdb.vgtest

index ced90fa1831a24edba7a9b3a9dc511c68ff2c0e9..54b11f7bc1937ef0c05e8591c9909332ddd997fd 100644 (file)
@@ -4,7 +4,7 @@ prog: sleepers
 args: 1 10000000 0 -S-S-S-S
 vgopts: --tool=memcheck --vgdb=yes --vgdb-prefix=./vgdb-prefix-mcinvokeWS
 stderr_filter: filter_make_empty
-prereq: test -f vgdb.invoker
+prereq: test -f vgdb.invoker && ( ! ../tests/os_test freebsd || [ "$(sysctl -n debug.ptrace_attach_transparent 2>/dev/null || echo 0)" -eq 0 ] )
 progB: invoker
 argsB: 10 --vgdb-prefix=./vgdb-prefix-mcinvokeWS --wait=60 -c v.wait 0
 # if the --wait is not enough, the test will fail or block
index 09edfcaba5e2255c5c51387ee733563b41673d55..6c60972c2101ccc83115f31148b8acbe1a514f25 100644 (file)
@@ -13,7 +13,7 @@ args: 1000000000 0 100000 BSBSBSBS 1
 vgopts: --tool=none --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-nlcontrolc
 stderr_filter: filter_stderr
 # Bug 338633 nlcontrol hangs on arm64 currently.
-prereq: test -e gdb -a -f vgdb.invoker && ! ../tests/os_test solaris
+prereq: test -e gdb -a -f vgdb.invoker && ( ! ../tests/os_test solaris ) && ( ! ../tests/os_test freebsd || [ "$(sysctl -n debug.ptrace_attach_transparent 2>/dev/null || echo 0)" -eq 0 ] )
 progB: gdb
 argsB: --quiet -l 60 --nx ./sleepers
 stdinB: nlcontrolc.stdinB.gdb
index ad69a129f407ab5ba7a04e8527e9a2265e55f9c6..2e69109a290ffc8b1c718821283b573d6f798ab4 100644 (file)
@@ -7,7 +7,7 @@ prog: sleepers
 args: 1 10000000 0 -S-S-S-S 1
 vgopts: --tool=none --vgdb=yes --vgdb-error=0 --vgdb-prefix=./vgdb-prefix-nlsigvgdb
 stderr_filter: filter_stderr
-prereq: test -e gdb -a -f vgdb.invoker
+prereq: test -e gdb -a -f vgdb.invoker && ( ! ../tests/os_test freebsd || [ "$(sysctl -n debug.ptrace_attach_transparent 2>/dev/null || echo 0)" -eq 0 ] )
 envB: LC_ALL=C
 progB: gdb
 argsB: --quiet -l 60 --nx ./sleepers