Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests/valgrind: improve handling for fork() and exec()
- use trace-children=yes. (This actually means "trace exec"; the valgrind man page even admits that the option is badly named!) - allow our tests to only check the parent pid In more detail, in our tests/??-*.sh, we would set up: scenario_cmd() { ... c_valgrind_cmd=$(valgrind_setup_cmd "valgrind-parent") ${c_valgrind_cmd} ./test_something_with_forks If we have two pids from a single binary, then our valgrind test will assume that we're using daemonize() and ignore any leaks from the parent pid. (This is exactly what we want for daemonize().) However, if we use fork() but keep the parent, then we want the opposite: we should check for leaks in the parent, and ignore leaks from the children. We need to explicitly add something to the log filename beacuse if we didn't, then a valgrind check with two pids wouldn't know whether to complain about leaks in the parent or child.
- Loading branch information