Skip to content

Enable drd and helgrind in the valgrind jobs #216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
tool: ['memcheck'] # TODO: enable 'drd' and 'helgrind' when all issues are fixed
tool: ['memcheck', 'drd', 'helgrind']
runs-on: ubuntu-latest

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
tool: ['memcheck'] # TODO: enable 'drd' and 'helgrind' when all issues are fixed
tool: ['memcheck', 'drd', 'helgrind']
runs-on: ubuntu-latest

steps:
Expand Down
6 changes: 6 additions & 0 deletions test/supp/drd-umf_test-jemalloc_pool.supp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
Conflicting Access in libjemalloc.so - internal issue of libjemalloc
drd:ConflictingAccess
obj:*libjemalloc.so*
...
}
36 changes: 36 additions & 0 deletions test/supp/drd-umf_test-scalable_pool.supp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
Conflicting Access in libtbbmalloc.so - internal issue of libjemalloc
drd:ConflictingAccess
obj:*libtbbmalloc.so*
...
}

{
[false-positive] Conflicting Access in memset in pow2AlignedAllocHelper
drd:ConflictingAccess
fun:memset
fun:*pow2AlignedAllocHelper*
fun:*umfPoolTest_multiThreadedpow2AlignedAlloc_Test*
...
}

{
[false-positive] Conflicting Access in tbb_realloc in multiThreadedReallocFree test
drd:ConflictingAccess
fun:memmove
obj:*libtbbmalloc.so*
fun:tbb_realloc
fun:umfPoolRealloc
fun:*umfPoolTest_multiThreadedReallocFree*
...
}

{
[false-positive] Conflicting Access in memset in multiThreadedCallocFree test
drd:ConflictingAccess
fun:memset
fun:tbb_calloc
fun:umfPoolCalloc
fun:*umfPoolTest_multiThreadedCallocFree*
...
}
6 changes: 6 additions & 0 deletions test/supp/helgrind-umf_test-jemalloc_pool.supp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
Race in libjemalloc.so - internal issue of libjemalloc
Helgrind:Race
obj:*libjemalloc.so*
...
}
36 changes: 36 additions & 0 deletions test/supp/helgrind-umf_test-scalable_pool.supp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
Race in libtbbmalloc.so - internal issue of libjemalloc
Helgrind:Race
obj:*libtbbmalloc.so*
...
}

{
[false-positive] Race Access in memset in pow2AlignedAllocHelper
Helgrind:Race
fun:memset
fun:*pow2AlignedAllocHelper*
fun:*umfPoolTest_multiThreadedpow2AlignedAlloc_Test*
...
}

{
[false-positive] Race in tbb_realloc in multiThreadedReallocFree test
Helgrind:Race
fun:memmove
obj:*libtbbmalloc.so*
fun:tbb_realloc
fun:umfPoolRealloc
fun:*umfPoolTest_multiThreadedReallocFree*
...
}

{
[false-positive] Race in memset in multiThreadedCallocFree test
Helgrind:Race
fun:memset
fun:tbb_calloc
fun:umfPoolCalloc
fun:*umfPoolTest_multiThreadedCallocFree*
...
}
7 changes: 7 additions & 0 deletions test/supp/memcheck-umf_test-jemalloc_pool.supp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
[false-positive] invalid store - see pool_jemalloc.c for more details
Memcheck:Addr8
fun:memmove
...
fun:op_realloc
}
7 changes: 0 additions & 7 deletions test/supp/umf_test-jemalloc_pool.supp

This file was deleted.

21 changes: 0 additions & 21 deletions test/supp/umf_test-memspace_host_all.supp

This file was deleted.

117 changes: 0 additions & 117 deletions test/supp/umf_test-provider_os_memory_config.supp

This file was deleted.

28 changes: 21 additions & 7 deletions test/test_valgrind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,29 +71,43 @@ echo "Running: \"valgrind $OPTION\" for the following tests:"
FAIL=0
rm -f umf_test-*.log umf_test-*.err

for test in $(ls -1 ./umf_test-*); do
for test in $(ls -1 umf_test-*); do
[ ! -x $test ] && continue
echo -n "$test "
LOG=${test}.log
ERR=${test}.err
SUP="${WORKSPACE}/test/supp/${test}.supp"
SUP="${WORKSPACE}/test/supp/${TOOL}-${test}.supp"
OPT_SUP=""
[ -f ${SUP} ] && OPT_SUP="--suppressions=${SUP}"
[ -f ${SUP} ] && OPT_SUP="--suppressions=${SUP}" && echo -n "(${TOOL}-${test}.supp) "

# skip tests incompatible with valgrind
FILTER=""
case $test in
./umf_test-disjointPool) # TODO: temporarily skip failing disjointPool tests - fix it
umf_test-disjointPool) # TODO: temporarily skip failing disjointPool tests - fix it
FILTER='--gtest_filter="-*pow2AlignedAlloc:*multiThreadedpow2AlignedAlloc"'
;;
./umf_test-memspace_host_all)
umf_test-memspace_host_all)
FILTER='--gtest_filter="-*allocsSpreadAcrossAllNumaNodes"'
;;
./umf_test-provider_os_memory_config)
umf_test-provider_os_memory_config)
FILTER='--gtest_filter="-*protection_flag_none:*protection_flag_read:*providerConfigTestNumaMode*"'
;;
umf_test-memspace_highest_capacity)
FILTER='--gtest_filter="-*highestCapacityVerify*"'
;;
esac

HWLOC_CPUID_PATH=./cpuid valgrind $OPTION $OPT_SUP --gen-suppressions=all $test $FILTER >$LOG 2>&1 || echo -n "(valgrind failed) "
[ "$FILTER" != "" ] && echo -n "($FILTER) "

if ! HWLOC_CPUID_PATH=./cpuid valgrind $OPTION $OPT_SUP --gen-suppressions=all ./$test $FILTER >$LOG 2>&1; then
FAIL=1
echo "(valgrind FAILED) "
echo "Command: HWLOC_CPUID_PATH=./cpuid valgrind $OPTION $OPT_SUP --gen-suppressions=all ./$test $FILTER >$LOG 2>&1"
echo "Output:"
cat $LOG
echo "====================="
echo
fi || true
# grep for "ERROR SUMMARY" with errors (there can be many lines with "ERROR SUMMARY")
grep -e "ERROR SUMMARY:" $LOG | grep -v -e "ERROR SUMMARY: 0 errors from 0 contexts" > $ERR || true
if [ $(cat $ERR | wc -l) -eq 0 ]; then
Expand Down