aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_rng.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-09-20 00:48:53 -0400
committerJack Lloyd <[email protected]>2017-09-20 00:48:53 -0400
commited4bf9b3181702a6106131aa710b4edeed212113 (patch)
tree81dd74cae96c78f789d9c0d6703c83373a389b28 /src/tests/test_rng.cpp
parent2add5a0962945af51804f03dfa2d84b2c9815e5c (diff)
At end of fork test, exec /bin/true to avoid valgrind false positive.
Diffstat (limited to 'src/tests/test_rng.cpp')
-rw-r--r--src/tests/test_rng.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/tests/test_rng.cpp b/src/tests/test_rng.cpp
index 899ed0050..c47680bb8 100644
--- a/src/tests/test_rng.cpp
+++ b/src/tests/test_rng.cpp
@@ -347,7 +347,14 @@ class Stateful_RNG_Tests : public Test
written = ::write(fd[1], &child_bytes[0], child_bytes.size());
BOTAN_UNUSED(written);
::close(fd[1]); // close write end in child
- ::_exit(0);
+
+ /*
+ * We can't call exit because it causes the mlock pool to be freed (#602)
+ * We can't call _exit because it makes valgrind think we leaked memory.
+ * So instead we execute something that will return 0 for us.
+ */
+ ::execl("/bin/true", "true", NULL);
+ ::_exit(0); // just in case /bin/true isn't available (sandbox?)
}
#endif
return result;