Use suppressions file to ignore certain valgrind warnings

This commit is contained in:
Soonho Kong 2013-09-10 15:37:09 -07:00
parent 9113f824bd
commit 3505ed8adb
5 changed files with 21 additions and 11 deletions

View file

@ -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")

View file

@ -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"
)

19
src/memcheck.supp Normal file
View file

@ -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
}

View file

@ -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() {

View file

@ -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() {