From 3505ed8adb393d73a73e31d7f0c31b2887a83f6b Mon Sep 17 00:00:00 2001 From: Soonho Kong Date: Tue, 10 Sep 2013 15:37:09 -0700 Subject: [PATCH] Use suppressions file to ignore certain valgrind warnings --- src/CTestConfig.cmake | 2 +- src/CTestCustom.cmake.in | 1 + src/memcheck.supp | 19 +++++++++++++++++++ src/tests/kernel/arith.cpp | 5 ----- src/tests/util/thread.cpp | 5 ----- 5 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 src/memcheck.supp diff --git a/src/CTestConfig.cmake b/src/CTestConfig.cmake index 5e93f5268..581cef11f 100644 --- a/src/CTestConfig.cmake +++ b/src/CTestConfig.cmake @@ -13,7 +13,7 @@ set(CTEST_NIGHTLY_START_TIME "00:00:00 EST") # Note: We use "--trace-children=yes" to valgrind-ise child processes (follow execve) # Note: We turn off "--show-reachable=yes" option. SET (VALGRIND_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --workaround-gcc296-bugs=yes --num-callers=50 --trace-children=yes --leak-check=full --track-origins=yes") -SET (CTEST_MEMORYCHECK_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --workaround-gcc296-bugs=yes --num-callers=50 --trace-children=yes --leak-check=full --track-origins=yes") +SET (MEMORYCHECK_SUPPRESSIONS_FILE "${CMAKE_SOURCE_DIR}/memcheck.supp") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "cmacslab2.modck.cs.cmu.edu") diff --git a/src/CTestCustom.cmake.in b/src/CTestCustom.cmake.in index 9459b6f7a..8d4f10ed8 100644 --- a/src/CTestCustom.cmake.in +++ b/src/CTestCustom.cmake.in @@ -2,6 +2,7 @@ # List of tests to ignore during the MemCheck stage SET(CTEST_CUSTOM_MEMCHECK_IGNORE ${CTEST_CUSTOM_MEMCHECK_IGNORE} + # The following tests are disabled since they take too much time on travis-ci "leanslowtests" "threads" ) diff --git a/src/memcheck.supp b/src/memcheck.supp new file mode 100644 index 000000000..e2226142c --- /dev/null +++ b/src/memcheck.supp @@ -0,0 +1,19 @@ +# Suppress warnings produced by Valgrind. +{ + # This warning is due to a memory-leak bug in the g++ compiler. + # Soonho reported the problem. Gcc team said this a known problem, and will be fixed + # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58142 + + Suppress_GCC-4.8_Memory_Leak_Bug_in_Thread + Memcheck:Leak + fun:*nothrow_t + fun:*_thread_atexit + fun:* + fun:* + fun:*_Bind_simple*_invokeIIEEE*_Index_tuple* + fun:*_Bind_simple* + fun:*_Bind_simple* + obj:*/libstdc++.so* + fun:start_thread + fun:clone +} diff --git a/src/tests/kernel/arith.cpp b/src/tests/kernel/arith.cpp index ba06706e9..ef22ec829 100644 --- a/src/tests/kernel/arith.cpp +++ b/src/tests/kernel/arith.cpp @@ -82,10 +82,6 @@ static void tst5() { } static void tst6() { -#if 0 - // Disabling test to avoid memory leak error message produced by Valgrind. - // The memory leak is due to a bug in the g++ compiler. - // Soonho reported the problem. Gcc team said this a known problem, and will be fixed std::cout << "tst6\n"; std::cout << mk_int_add_fn().raw() << "\n"; std::cout << mk_int_add_fn().raw() << "\n"; @@ -97,7 +93,6 @@ static void tst6() { t2.join(); #endif std::cout << mk_int_add_fn().raw() << "\n"; -#endif } int main() { diff --git a/src/tests/util/thread.cpp b/src/tests/util/thread.cpp index 7a538c61d..9ccc00063 100644 --- a/src/tests/util/thread.cpp +++ b/src/tests/util/thread.cpp @@ -19,16 +19,11 @@ void foo() { } static void tst1() { -#if 0 - // Disabling test to avoid memory leak error message produced by Valgrind. - // The memory leak is due to a bug in the g++ compiler. - // Soonho reported the problem. Gcc team said this a known problem, and will be fixed unsigned n = 5; for (unsigned i = 0; i < n; i++) { std::thread t([](){ foo(); }); t.join(); } -#endif } int main() {