From ff08dabdf63d016d75848880d214c80e87b72054 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Sun, 11 Apr 2021 16:13:06 +0200 Subject: [PATCH] Suppress UB failure in libc++ filebuf::swap This triggers UB when filebuf is closed See https://bugs.llvm.org/show_bug.cgi?id=49923 --- .github/workflows/posix.yml | 5 +++-- ubsan-blacklist | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 ubsan-blacklist diff --git a/.github/workflows/posix.yml b/.github/workflows/posix.yml index b4876f4..1de2b0d 100644 --- a/.github/workflows/posix.yml +++ b/.github/workflows/posix.yml @@ -59,7 +59,8 @@ jobs: - name: Setup config vars run: | - echo "LIBRARY=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV + LIBRARY=${GITHUB_REPOSITORY#*/} + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV echo "B2_COMPILER=${{matrix.compiler}}" >> $GITHUB_ENV ${{matrix.compiler}} --version if [[ "${{matrix.compiler}}" =~ clang ]]; then @@ -75,7 +76,7 @@ jobs: echo "B2_CXXSTD=${{matrix.cxxstd}}" >> $GITHUB_ENV if [[ "${{matrix.sanitize}}" == "yes" ]]; then echo "B2_ASAN=address-sanitizer=norecover" >> $GITHUB_ENV - echo "B2_UBSAN=undefined-sanitizer=norecover" >> $GITHUB_ENV + echo "B2_UBSAN=undefined-sanitizer=norecover cxxflags=-fsanitize-blacklist=libs/$LIBRARY/ubsan-blacklist" >> $GITHUB_ENV fi [[ "${{matrix.linkflags}}" == "" ]] || echo "B2_LINKFLAGS=linkflags=${{matrix.linkflags}}" >> $GITHUB_ENV diff --git a/ubsan-blacklist b/ubsan-blacklist new file mode 100644 index 0000000..0e60418 --- /dev/null +++ b/ubsan-blacklist @@ -0,0 +1,3 @@ +[undefined] +# libcxx invokes UB when swapping a closed filebuf +fun:_ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4swapERS3_