Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit e472cdf

Browse files
Merge pull request #1227 from lukaszstolarczuk/turn-libunwind-off-for-valgrind-tests
Turn libunwind off for valgrind tests
2 parents 1f61bcf + 2b61921 commit e472cdf

File tree

5 files changed

+24
-6
lines changed

5 files changed

+24
-6
lines changed

.github/workflows/gha.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
"TYPE=debug OS=ubuntu OS_VER=20.04 COVERAGE=1",
3535
"TYPE=release OS=fedora OS_VER=34",
3636
"TYPE=release OS=ubuntu OS_VER=20.04",
37-
"TYPE=valgrind OS=ubuntu OS_VER=20.04 TESTS_VALGRIND_UNWIND=0",
38-
"TYPE=memcheck_drd OS=ubuntu OS_VER=20.04 TESTS_VALGRIND_UNWIND=0",
37+
"TYPE=valgrind OS=ubuntu OS_VER=20.04",
38+
"TYPE=memcheck_drd OS=ubuntu OS_VER=20.04",
3939
"TYPE=package OS=fedora OS_VER=34",
4040
"TYPE=package OS=ubuntu OS_VER=20.04"]
4141
steps:

.github/workflows/weekly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
"TYPE=debug OS=ubuntu OS_VER=20.04 TESTS_UBSAN=1 TESTS_PMREORDER=0",
2929
"TYPE=debug OS=fedora OS_VER=rawhide TESTS_ASAN=1 TESTS_PMREORDER=0",
3030
"TYPE=debug OS=fedora OS_VER=rawhide TESTS_UBSAN=1 TESTS_PMREORDER=0",
31-
"TYPE=valgrind OS=fedora OS_VER=rawhide TESTS_PMREORDER=0 TESTS_VALGRIND_UNWIND=0",
32-
"TYPE=memcheck_drd OS=fedora OS_VER=rawhide TESTS_PMREORDER=0 TESTS_VALGRIND_UNWIND=0",
31+
"TYPE=valgrind OS=fedora OS_VER=rawhide TESTS_PMREORDER=0",
32+
"TYPE=memcheck_drd OS=fedora OS_VER=rawhide TESTS_PMREORDER=0",
3333
"TYPE=package OS=fedora OS_VER=34",
3434
"TYPE=package OS=fedora OS_VER=rawhide TESTS_PMREORDER=0",
3535
"TYPE=package OS=ubuntu OS_VER=devel"]

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ option(CHECK_CPP_STYLE "check code style of C++ sources" OFF)
7878
option(TRACE_TESTS "more verbose test outputs" OFF)
7979
option(USE_ASAN "enable AddressSanitizer (debugging)" OFF)
8080
option(USE_UBSAN "enable UndefinedBehaviorSanitizer (debugging)" OFF)
81-
option(USE_LIBUNWIND "use libunwind for more reliable stack traces from tests (if available)" ON)
81+
option(USE_LIBUNWIND "use libunwind for more reliable stack traces from tests (if available); see README file if tests fail with libunwind" ON)
8282
option(USE_CCACHE "use ccache if it is available in the system" ON)
8383

8484
option(TESTS_USE_FORCED_PMEM "run tests with PMEM_IS_PMEM_FORCE=1 - it speeds up tests execution on emulated pmem" OFF)

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,24 @@ $ make
9797
# make install
9898
```
9999

100+
**Note:**
101+
By default CMake's option `USE_LIBUNWIND` is switched ON. If libunwind package was found
102+
in the system, it is then linked to all tests' binaries. Sometimes this may lead to
103+
failing a test, if it is run under Valgrind. To avoid this false-positive fails, you can
104+
execute tests run under Valgrind separately, without libunwind:
105+
106+
```sh
107+
cmake .. -DTESTS_USE_VALGRIND=ON -DUSE_LIBUNWIND=OFF && \
108+
ctest -R "_helgrind|_pmemcheck|_drd|_memcheck|_pmreorder" # run only valgrind tests
109+
```
110+
111+
or valgrind tests can be disabled in CMake build:
112+
113+
```sh
114+
cmake .. -DTESTS_USE_VALGRIND=OFF && \
115+
ctest
116+
```
117+
100118
### Developer compilation
101119
```sh
102120
$ mkdir build

utils/docker/run-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ TESTS_PACKAGES=${TESTS_PACKAGES:-ON}
2323
TESTS_USE_FORCED_PMEM=${TESTS_USE_FORCED_PMEM:-ON}
2424
TESTS_ASAN=${TESTS_ASAN:-OFF}
2525
TESTS_UBSAN=${TESTS_UBSAN:-OFF}
26-
TESTS_VALGRIND_UNWIND=${TESTS_VALGRIND_UNWIND:-OFF}
26+
TESTS_VALGRIND_UNWIND=${TESTS_VALGRIND_UNWIND:-OFF} # turn unwind off, when building with valgrind tests=ON
2727
TEST_TIMEOUT=${TEST_TIMEOUT:-600}
2828

2929
export PMREORDER_STACKTRACE_DEPTH=20

0 commit comments

Comments
 (0)