Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activate asan on ubuntu #12165

Merged
merged 12 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 47 additions & 3 deletions .github/workflows/firestore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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') ||
Expand All @@ -240,7 +239,6 @@ jobs:

strategy:
matrix:
# TODO(b/260248007): Re-enable this once tsan passes on Linux
os: [macos-12]
sanitizer: [asan, tsan]

Expand Down Expand Up @@ -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
ehsannas marked this conversation as resolved.
Show resolved Hide resolved

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: |
Expand Down
3 changes: 1 addition & 2 deletions Firestore/core/src/util/schedule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -29,7 +28,7 @@ Schedule::~Schedule() {
}

void Schedule::Clear() {
std::unique_lock<std::mutex> lock{mutex_};
std::lock_guard<std::mutex> lock{mutex_};

for (Task* task : scheduled_) {
task->Release();
Expand Down
Loading