We currently tell users to run meson test --wrapper valgrind to run their tests under Valgrind, but it's error-prone. By default, Valgrind doesn't error out on violations/issues it detects. This is a POLA violation and while I suspect we're not going to be able to change the default behaviour of Valgrind, we should try to do better in Meson.
1f76b76a84cb635f764ecbd2b77aaba1d375d72b added specific handling for Valgrind with tests, although it got dropped later in 951262d7590343ffa9730666c427ad9d708a9fb6.
We already try to do better in Meson for UBSAN, see 7b7d2e060b447de9c2642848847370a58711ac1c and 8ba0ea68017b489b0a461abbd375f319dc7a48f3.
We currently tell users to run
meson test --wrapper valgrind
to run their tests under Valgrind, but it's error-prone. By default, Valgrind doesn't error out on violations/issues it detects. This is a POLA violation and while I suspect we're not going to be able to change the default behaviour of Valgrind, we should try to do better in Meson.1f76b76a84cb635f764ecbd2b77aaba1d375d72b added specific handling for Valgrind with tests, although it got dropped later in 951262d7590343ffa9730666c427ad9d708a9fb6.
We already try to do better in Meson for UBSAN, see 7b7d2e060b447de9c2642848847370a58711ac1c and 8ba0ea68017b489b0a461abbd375f319dc7a48f3.
A user even hit this in the past at https://github.com/mesonbuild/meson/issues/4727. See also https://github.com/mesonbuild/meson/issues/1175 and arguably https://github.com/mesonbuild/meson/issues/1105.
Specifically, we should consider adding:
--exit-on-first-error=yes
(maybe)--exit-errorcode=2
(or some other value instead of2
)--trace-children=yes