diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -1279,7 +1279,14 @@ break; case ExitCommand: close(fd); - exit(0); + // As an alternative to exit() which runs the exit handlers + // (which seem to be flakey with Boost test suite with JUNIT + // logging in a forked process), just vanish this process as + // fast as possible. (quick_exit() would also work, but it + // triggers a spurious glibc-valgrind error in pre-3.15 + // versions.) Using exec also stops valgrind from thinking it + // needs to analyze the memory leaks in this forked process. + execlp("true", "true", (char *)NULL); default: assert(0); }