]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Disable the send wrappers in our CI 12316/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 12 Dec 2022 14:42:57 +0000 (15:42 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 12 Dec 2022 14:42:57 +0000 (15:42 +0100)
The way the send wrappers are implemented, reading the data _after_
it has been sent, cause them to report a data race that does not
exist with existing implementations:
- we call `send()` from thread 1 to send a query to a backend, never
  touching the data or associated metadata again from that thread
- we get a response from the backend in a different thread, thread 2,
  which will then access the metadata and sometimes (truncated UDP
  answers following a DoH query) even modify the data itself
- ASAN and TSAN complain because the wrapper might still be reading
  the data after the UDP datagram has been sent, which is effectively
  a race, but it does not really make any sense for an actual
  implementation of `send()` to do that.

We work around that by disabling the `send()` wrappers in our CI,
for the dnsdist regression tests only, via `intercept_send=0`.

.github/workflows/build-and-test-all.yml

index 3c90ed7d2cbbda9c9493fec4a40b17666adb2856..c90344246d44426ce434caacfdc1c65cc759956d 100644 (file)
@@ -368,8 +368,9 @@ jobs:
         sanitizers: [ubsan+asan, tsan]
     env:
       UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1:suppressions=${{ github.workspace }}/build-scripts/UBSan.supp"
-      ASAN_OPTIONS: detect_leaks=0
-      TSAN_OPTIONS: "halt_on_error=1:suppressions=${{ github.workspace }}/pdns/dnsdistdist/dnsdist-tsan.supp"
+      # Disabling (intercept_send=0) the custom send wrappers for ASAN and TSAN because they cause the tools to report a race that doesn't exist on actual implementations of send(), see https://github.com/google/sanitizers/issues/1498
+      ASAN_OPTIONS: detect_leaks=0:intercept_send=0
+      TSAN_OPTIONS: "halt_on_error=1:intercept_send=0:suppressions=${{ github.workspace }}/pdns/dnsdistdist/dnsdist-tsan.supp"
       # IncludeDir tests are disabled because of a weird interaction between TSAN and these tests which ever only happens on GH actions
       SKIP_INCLUDEDIR_TESTS: yes
     steps: