diff --git a/.github/workflows/firestore.yml b/.github/workflows/firestore.yml index d7dcfa8e15f..a5299a44f86 100644 --- a/.github/workflows/firestore.yml +++ b/.github/workflows/firestore.yml @@ -97,7 +97,6 @@ jobs: - name: Run check run: scripts/check.sh --test-only - cmake: needs: check # Either a scheduled run from public repo, or a pull request with firestore changes. @@ -231,7 +230,7 @@ jobs: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake - sanitizers: + sanitizers-mac: # Either a scheduled run from public repo, or a pull request with firestore changes. if: | (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || @@ -240,7 +239,6 @@ jobs: strategy: matrix: - # TODO(b/260248007): Re-enable this once tsan passes on Linux os: [macos-12] sanitizer: [asan, tsan] @@ -274,6 +272,52 @@ jobs: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake + sanitizers-ubuntu: + # Either a scheduled run from public repo, or a pull request with firestore changes. + if: | + (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || + (github.event_name == 'pull_request' && needs.changes.outputs.changed == 'true') + needs: check + + strategy: + matrix: + os: [ubuntu-latest] + # Excluding TSAN on ubuntu because of the warnings it generates around schedule.cc. + # This could be due to Apple Clang provide additional support for synchronization + # on Apple platforms, which is what we primarily care about. + sanitizer: [asan] + + runs-on: ${{ matrix.os }} + + env: + SANITIZERS: ${{ matrix.sanitizer }} + ASAN_OPTIONS: detect_leaks=0 + + steps: + - uses: actions/checkout@v3 + + - name: Prepare ccache + uses: actions/cache@v3 + with: + path: ${{ runner.temp }}/ccache + key: ${{ matrix.sanitizer }}-firestore-ccache-${{ runner.os }}-${{ github.sha }} + restore-keys: | + ${{ matrix.sanitizer }}-firestore-ccache-${{ runner.os }}- + + - uses: actions/setup-python@v4 + with: + python-version: '3.7' + + - name: Setup build + run: scripts/install_prereqs.sh Firestore ${{ runner.os }} cmake + + - name: Build and test + run: | + export EXPERIMENTAL_MODE=true + export CCACHE_DIR=${{ runner.temp }}/ccache + scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake + + xcodebuild: # Either a scheduled run from public repo, or a pull request with firestore changes. if: | diff --git a/Firestore/core/src/util/schedule.cc b/Firestore/core/src/util/schedule.cc index 2a7a9bb33ba..619f492bc62 100644 --- a/Firestore/core/src/util/schedule.cc +++ b/Firestore/core/src/util/schedule.cc @@ -18,7 +18,6 @@ #include "Firestore/core/src/util/hard_assert.h" #include "Firestore/core/src/util/task.h" -#include "absl/memory/memory.h" namespace firebase { namespace firestore { @@ -29,7 +28,7 @@ Schedule::~Schedule() { } void Schedule::Clear() { - std::unique_lock lock{mutex_}; + std::lock_guard lock{mutex_}; for (Task* task : scheduled_) { task->Release();