Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec19137ed9 | ||
|
|
a0c4bf580e | ||
|
|
3ac2242df1 | ||
|
|
399ee4cf9b |
@@ -18,6 +18,15 @@ jobs:
|
|||||||
runs-on: linux/amd64
|
runs-on: linux/amd64
|
||||||
container:
|
container:
|
||||||
image: gitea.tourolle.paris/dtourolle/kpnpp-builder:latest
|
image: gitea.tourolle.paris/dtourolle/kpnpp-builder:latest
|
||||||
|
# This runner is Docker nested in an unprivileged LXC container, whose
|
||||||
|
# kernel randomizes mmap addresses beyond the range TSan's fixed shadow
|
||||||
|
# mapping expects, so TSan aborts at init with "unexpected memory
|
||||||
|
# mapping". The fix is to disable ASLR per-process with `setarch -R`
|
||||||
|
# (below), which needs the personality(2) syscall that Docker's default
|
||||||
|
# seccomp profile blocks. seccomp=unconfined permits it. Verified on the
|
||||||
|
# runner: setarch -R alone gets EPERM, seccomp alone still aborts, both
|
||||||
|
# together run clean. Scoped to this job, which runs only our own tests.
|
||||||
|
options: --security-opt seccomp=unconfined
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -54,13 +63,14 @@ jobs:
|
|||||||
# the full picture for lock-order issues.
|
# the full picture for lock-order issues.
|
||||||
env:
|
env:
|
||||||
TSAN_OPTIONS: "halt_on_error=1 second_deadlock_stack=1"
|
TSAN_OPTIONS: "halt_on_error=1 second_deadlock_stack=1"
|
||||||
run: ./build/tests/kpn_tests_stress
|
# setarch -R disables ASLR for this process; see the container comment.
|
||||||
|
run: setarch -R ./build/tests/kpn_tests_stress
|
||||||
|
|
||||||
- name: Run unit tests under TSan
|
- name: Run unit tests under TSan
|
||||||
working-directory: tsan-${{ github.run_id }}
|
working-directory: tsan-${{ github.run_id }}
|
||||||
env:
|
env:
|
||||||
TSAN_OPTIONS: "halt_on_error=1 second_deadlock_stack=1"
|
TSAN_OPTIONS: "halt_on_error=1 second_deadlock_stack=1"
|
||||||
run: ./build/tests/kpn_tests
|
run: setarch -R ./build/tests/kpn_tests
|
||||||
|
|
||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
+10
-2
@@ -63,7 +63,15 @@ endif()
|
|||||||
|
|
||||||
include(CTest)
|
include(CTest)
|
||||||
include(Catch)
|
include(Catch)
|
||||||
catch_discover_tests(kpn_tests)
|
|
||||||
|
# DISCOVERY_MODE PRE_TEST defers test enumeration to `ctest` run time. The
|
||||||
|
# default (POST_BUILD) runs each test binary during the build to list its
|
||||||
|
# cases — which fails a sanitizer build: a TSan/ASan binary needs a fixed
|
||||||
|
# address-space layout and aborts on startup ("unexpected memory mapping")
|
||||||
|
# under the container's ASLR, breaking the build before any test runs. The
|
||||||
|
# tsan.yaml job invokes the binaries directly (not via ctest), so deferring
|
||||||
|
# discovery costs nothing there and keeps `ctest` working for normal builds.
|
||||||
|
catch_discover_tests(kpn_tests DISCOVERY_MODE PRE_TEST)
|
||||||
# Register the stress suite under its own label so CI can run / time it
|
# Register the stress suite under its own label so CI can run / time it
|
||||||
# separately from the fast unit tests.
|
# separately from the fast unit tests.
|
||||||
catch_discover_tests(kpn_tests_stress PROPERTIES LABELS "stress")
|
catch_discover_tests(kpn_tests_stress DISCOVERY_MODE PRE_TEST PROPERTIES LABELS "stress")
|
||||||
|
|||||||
Reference in New Issue
Block a user