Skip to content

Commit

Permalink
Drop valgrind from CI and instead enable ASan
Browse files Browse the repository at this point in the history
The recently added ioctl use is reported as a false-positive by valgrind.
I tried moving it to different compilers/versions two times and only
hit further issues that were valgrind's fault.

Also includes a tiny fix.
  • Loading branch information
sfan5 committed Feb 4, 2024
1 parent 4259ac9 commit c9e10e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/linux.yml
Expand Up @@ -86,23 +86,20 @@ jobs:
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps clang-7 valgrind
install_linux_deps clang-7 llvm
- name: Build
run: |
./util/ci/build.sh
env:
CC: clang-7
CXX: clang++-7
CMAKE_FLAGS: '-DCMAKE_C_FLAGS="-fsanitize=address" -DCMAKE_CXX_FLAGS="-fsanitize=address"'

- name: Unittest
run: |
./bin/minetest --run-unittests
- name: Valgrind
run: |
valgrind --leak-check=full --leak-check-heuristics=all --undef-value-errors=no --error-exitcode=9 ./bin/minetest --run-unittests
# Current clang version
clang_14:
runs-on: ubuntu-22.04
Expand Down
4 changes: 4 additions & 0 deletions src/unittest/test_datastructures.cpp
Expand Up @@ -108,6 +108,8 @@ void TestDataStructures::testMap1()
break;
}
UASSERT(once);

map.clear(); // ASan complains about stack-use-after-scope otherwise
}

void TestDataStructures::testMap2()
Expand All @@ -121,6 +123,8 @@ void TestDataStructures::testMap2()
UASSERT(t0.deleted);
UASSERT(!t1.copied);
UASSERT(!t1.deleted);

map.clear();
}

void TestDataStructures::testMap3()
Expand Down

0 comments on commit c9e10e1

Please sign in to comment.