Closed GoogleCodeExporter closed 9 years ago
It's impossible for gtest to anticipate all possible side effects in a death
test and
clean them up. Instead, it's the test author's responsibility to ensure that
the
tests clean up after themselves. Some people may even find the core dump
useful.
Please try to rewrite your test to disable core dump. You can see 'man core'
on how
to do it.
Original comment by w...@google.com
on 21 Dec 2009 at 7:07
In case anyone else comes here looking for a solution I'll post what I've
decided to go
with.
This works on linux and is likely not portable:
Index: gtest-death-test.cpp
====================================================
===============
--- gtest-death-test.cpp (revision 60319)
+++ gtest-death-test.cpp (working copy)
@@ -990,6 +990,11 @@
// This function is called in a clone()-ed process and thus must avoid
// any potentially unsafe operations like malloc or libc functions.
static int ExecDeathTestChildMain(void* child_arg) {
+ rlimit core_limit;
+ core_limit.rlim_cur = 0;
+ core_limit.rlim_max = 0;
+ setrlimit(RLIMIT_CORE, &core_limit);
+
ExecDeathTestArgs* const args = static_cast<ExecDeathTestArgs*>(child_arg);
GTEST_DEATH_TEST_CHECK_SYSCALL_(close(args->close_fd));
Original comment by nate.bau...@gmail.com
on 21 Dec 2009 at 7:56
Original issue reported on code.google.com by
nate.bau...@gmail.com
on 21 Dec 2009 at 5:52