mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Backed out 2 changesets (bug 1674773) for turning Bug 1646925 into almost permafail.
Backed out changeset acd441508a66 (bug 1674773) Backed out changeset 89babec1b885 (bug 1674773)
This commit is contained in:
parent
7a65ffe33e
commit
02cb78667e
@ -18,6 +18,9 @@ export MOZ_PKG_SPECIAL=tsan
|
||||
# Disable telemetry
|
||||
ac_add_options MOZ_TELEMETRY_REPORTING=
|
||||
|
||||
# Ensure Rust also gets the necessary instrumentation
|
||||
export RUSTFLAGS="-Zsanitizer=thread"
|
||||
|
||||
# rustfmt is currently missing in Rust nightly
|
||||
unset RUSTFMT
|
||||
|
||||
|
@ -53,11 +53,6 @@ ifeq (1,$(MOZ_PARALLEL_BUILD))
|
||||
cargo_build_flags += -j1
|
||||
endif
|
||||
|
||||
# This should also be paired with -Zbuild-std, but that doesn't work yet.
|
||||
ifdef MOZ_TSAN
|
||||
RUSTFLAGS += -Zsanitizer=thread
|
||||
endif
|
||||
|
||||
# These flags are passed via `cargo rustc` and only apply to the final rustc
|
||||
# invocation (i.e., only the top-level crate, not its dependencies).
|
||||
cargo_rustc_flags = $(CARGO_RUSTCFLAGS)
|
||||
|
@ -237,7 +237,7 @@ sm-tsan-linux64/opt:
|
||||
toolchain:
|
||||
- linux64-binutils
|
||||
- linux64-clang
|
||||
- linux64-rust-nightly
|
||||
- linux64-rust
|
||||
- linux64-dump-syms
|
||||
|
||||
sm-rootanalysis-linux64/debug:
|
||||
|
@ -35,7 +35,6 @@ glean = ["gkrust-shared/glean", "fog-gtest"]
|
||||
glean_with_gecko = ["gkrust-shared/glean_with_gecko", "fog-gtest"]
|
||||
rust_fxa_client = ["gkrust-shared/rust_fxa_client"]
|
||||
with_dbus = ["gkrust-shared/with_dbus"]
|
||||
thread_sanitizer = ["gkrust-shared/thread_sanitizer"]
|
||||
|
||||
[dependencies]
|
||||
bench-collections-gtest = { path = "../../../../xpcom/rust/gtest/bench-collections" }
|
||||
|
@ -36,7 +36,6 @@ glean = ["gkrust-shared/glean"]
|
||||
glean_with_gecko = ["gkrust-shared/glean_with_gecko"]
|
||||
rust_fxa_client = ["gkrust-shared/rust_fxa_client"]
|
||||
with_dbus = ["gkrust-shared/with_dbus"]
|
||||
thread_sanitizer = ["gkrust-shared/thread_sanitizer"]
|
||||
|
||||
[dependencies]
|
||||
gkrust-shared = { path = "shared" }
|
||||
|
@ -12,9 +12,6 @@ if CONFIG['MOZ_DEBUG']:
|
||||
'gecko_refcount_logging',
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_TSAN']:
|
||||
gkrust_features += ['thread_sanitizer']
|
||||
|
||||
gkrust_features += ['quantum_render', 'webgpu']
|
||||
if CONFIG['MOZ_WEBRENDER_DEBUGGER']:
|
||||
gkrust_features += ['webrender_debugger']
|
||||
|
@ -108,7 +108,6 @@ glean = ["fog_control"]
|
||||
glean_with_gecko = ["fog_control/with_gecko"]
|
||||
rust_fxa_client = ["firefox-accounts-bridge"]
|
||||
with_dbus = ["audio_thread_priority/with_dbus"]
|
||||
thread_sanitizer = ["xpcom/thread_sanitizer"]
|
||||
|
||||
[lib]
|
||||
path = "lib.rs"
|
||||
|
@ -11,6 +11,3 @@ nserror = { path = "../nserror" }
|
||||
threadbound = "0.1"
|
||||
xpcom_macros = { path = "xpcom_macros" }
|
||||
thin-vec = { version = "0.2.1", features = ["gecko-ffi"] }
|
||||
|
||||
[features]
|
||||
thread_sanitizer = []
|
||||
|
@ -298,18 +298,8 @@ impl AtomicRefcnt {
|
||||
pub unsafe fn dec(&self) -> nsrefcnt {
|
||||
let result = self.0.fetch_sub(1, Ordering::Release) as nsrefcnt - 1;
|
||||
if result == 0 {
|
||||
// We're going to destroy the object on this thread, so we need
|
||||
// acquire semantics to synchronize with the memory released by
|
||||
// the last release on other threads, that is, to ensure that
|
||||
// writes prior to that release are now visible on this thread.
|
||||
if cfg!(feature = "thread_sanitizer") {
|
||||
// TSan doesn't understand atomic::fence, so in order to avoid
|
||||
// a false positive for every time a refcounted object is
|
||||
// deleted, we replace the fence with an atomic operation.
|
||||
self.0.load(Ordering::Acquire);
|
||||
} else {
|
||||
atomic::fence(Ordering::Acquire);
|
||||
}
|
||||
// We're going to destroy the object on this thread.
|
||||
atomic::fence(Ordering::Acquire);
|
||||
}
|
||||
result
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user