From 9534f7ae0c1505c3c28721b3470059d7f092ef99 Mon Sep 17 00:00:00 2001 From: FuzzTest Team Date: Thu, 15 Jan 2026 19:52:45 -0800 Subject: [PATCH] No public description PiperOrigin-RevId: 856925740 --- centipede/centipede.cc | 4 ++-- centipede/centipede_callbacks.cc | 2 +- centipede/command.cc | 2 +- centipede/coverage.cc | 2 +- centipede/distill.cc | 10 +++++----- centipede/minimize_crash.cc | 6 +++--- centipede/periodic_action.cc | 10 +++++----- centipede/periodic_action_test.cc | 14 +++++++------- centipede/resource_pool.cc | 8 ++++---- centipede/rusage_profiler.cc | 10 +++++----- centipede/rusage_stats_test.cc | 2 +- centipede/util.cc | 4 ++-- 12 files changed, 37 insertions(+), 37 deletions(-) diff --git a/centipede/centipede.cc b/centipede/centipede.cc index 2c2070203..d288b04a4 100644 --- a/centipede/centipede.cc +++ b/centipede/centipede.cc @@ -529,7 +529,7 @@ void Centipede::LoadShard(const Environment &load_env, size_t shard_index, const std::string features_path = wd.FeaturesFilePaths().Shard(shard_index); if (env_.serialize_shard_loads) { ABSL_CONST_INIT static absl::Mutex load_shard_mu{absl::kConstInit}; - absl::MutexLock lock(&load_shard_mu); + absl::MutexLock lock(load_shard_mu); ReadShard(corpus_path, features_path, input_features_callback); } else { ReadShard(corpus_path, features_path, input_features_callback); @@ -914,7 +914,7 @@ void Centipede::ReportCrash(std::string_view binary, const size_t suspect_input_idx = std::clamp( batch_result.num_outputs_read(), 0, input_vec.size() - 1); auto log_execution_failure = [&](std::string_view log_prefix) { - absl::MutexLock lock(&GetExecutionLoggingMutex()); + absl::MutexLock lock(GetExecutionLoggingMutex()); FUZZTEST_LOG(INFO) << log_prefix << "Batch execution failed:" << "\nBinary : " << binary diff --git a/centipede/centipede_callbacks.cc b/centipede/centipede_callbacks.cc index 522a5940d..a9e0d7dc0 100644 --- a/centipede/centipede_callbacks.cc +++ b/centipede/centipede_callbacks.cc @@ -784,7 +784,7 @@ void CentipedeCallbacks::PrintExecutionLog() const { } std::string log_text; ReadFromLocalFile(execute_log_path_, log_text); - absl::MutexLock lock(&GetExecutionLoggingMutex()); + absl::MutexLock lock(GetExecutionLoggingMutex()); for (const auto& log_line : absl::StrSplit(absl::StripAsciiWhitespace(log_text), '\n')) { FUZZTEST_LOG(INFO).NoPrefix() << "LOG: " << log_line; diff --git a/centipede/command.cc b/centipede/command.cc index 904c1af75..50d26ff0d 100644 --- a/centipede/command.cc +++ b/centipede/command.cc @@ -518,7 +518,7 @@ std::string Command::ReadRedirectedStderr() const { } void Command::LogProblemInfo(std::string_view message) const { - absl::MutexLock lock(&GetExecutionLoggingMutex()); + absl::MutexLock lock(GetExecutionLoggingMutex()); FUZZTEST_LOG(ERROR) << message; FUZZTEST_LOG(ERROR).NoPrefix() << "=== COMMAND ==="; diff --git a/centipede/coverage.cc b/centipede/coverage.cc index a5a96e200..2ab42a35b 100644 --- a/centipede/coverage.cc +++ b/centipede/coverage.cc @@ -142,7 +142,7 @@ void Coverage::DumpReportToFile(const SymbolTable &symbols, std::string CoverageLogger::ObserveAndDescribeIfNew(PCIndex pc_index) { if (pc_table_.empty()) return ""; // Fast-path return (symbolization is off). - absl::MutexLock l(&mu_); + absl::MutexLock l(mu_); if (!observed_indices_.insert(pc_index).second) return ""; std::ostringstream os; if (pc_index >= pc_table_.size()) { diff --git a/centipede/distill.cc b/centipede/distill.cc index 49eb19371..d3d9f7f40 100644 --- a/centipede/distill.cc +++ b/centipede/distill.cc @@ -178,12 +178,12 @@ class CorpusShardWriter { virtual ~CorpusShardWriter() = default; void WriteElt(CorpusElt elt) { - absl::MutexLock lock(&mu_); + absl::MutexLock lock(mu_); WriteEltImpl(std::move(elt)); } void WriteBatch(CorpusEltVec elts) { - absl::MutexLock lock(&mu_); + absl::MutexLock lock(mu_); FUZZTEST_VLOG(1) << log_prefix_ << "writing " << elts.size() << " elements to output shard:\n" << VV(corpus_path_) << "\n" @@ -195,7 +195,7 @@ class CorpusShardWriter { } Stats GetStats() const { - absl::MutexLock lock(&mu_); + absl::MutexLock lock(mu_); return stats_; } @@ -268,7 +268,7 @@ class DistillingInputFilter { } {} std::optional FilterElt(CorpusElt elt) { - absl::MutexLock lock{&mu_}; + absl::MutexLock lock{mu_}; ++stats_.num_total_elts; @@ -289,7 +289,7 @@ class DistillingInputFilter { } Stats GetStats() { - absl::MutexLock lock{&mu_}; + absl::MutexLock lock{mu_}; std::stringstream ss; ss << seen_features_; stats_.coverage_str = std::move(ss).str(); diff --git a/centipede/minimize_crash.cc b/centipede/minimize_crash.cc index 66d417a20..d9fa681e8 100644 --- a/centipede/minimize_crash.cc +++ b/centipede/minimize_crash.cc @@ -53,7 +53,7 @@ struct MinimizerWorkQueue { // Returns up to `max_num_crashers` most recently added crashers. std::vector GetRecentCrashers(size_t max_num_crashers) { - absl::MutexLock lock(&mutex_); + absl::MutexLock lock(mutex_); size_t num_crashers_to_return = std::min(crashers_.size(), max_num_crashers); return {crashers_.end() - num_crashers_to_return, crashers_.end()}; @@ -62,7 +62,7 @@ struct MinimizerWorkQueue { // Adds `crasher` to the queue, writes it to `crash_dir_path_/Hash(crasher)`. // The crasher must be smaller than the original one. void AddCrasher(ByteArray crasher) { - absl::MutexLock lock(&mutex_); + absl::MutexLock lock(mutex_); FUZZTEST_CHECK_LT(crasher.size(), crashers_.front().size()); crashers_.emplace_back(crasher); // Write the crasher to disk. @@ -74,7 +74,7 @@ struct MinimizerWorkQueue { // Returns true if new smaller crashes were found. bool SmallerCrashesFound() const { - absl::MutexLock lock(&mutex_); + absl::MutexLock lock(mutex_); return crashers_.size() > 1; } diff --git a/centipede/periodic_action.cc b/centipede/periodic_action.cc index 983549650..d1f42fed4 100644 --- a/centipede/periodic_action.cc +++ b/centipede/periodic_action.cc @@ -45,12 +45,12 @@ class PeriodicAction::Impl { } void StopAsync() { - absl::MutexLock lock{&mu_}; + absl::MutexLock lock{mu_}; stop_ = true; } void Nudge() { - absl::MutexLock lock{&mu_}; + absl::MutexLock lock{mu_}; nudge_ = true; } @@ -62,7 +62,7 @@ class PeriodicAction::Impl { const bool schedule = !nudge_ && !stop_; const bool nudge = nudge_; const bool stop = stop_; - mu_.Unlock(); + mu_.unlock(); // NOTE: The caller might call `Stop()` immediately after one final // `Nudge()`: in that case we still should run the action, and only then // terminate the loop. This is in contrast to waking after sleeping the @@ -80,12 +80,12 @@ class PeriodicAction::Impl { void SleepOrWakeEarly(absl::Duration duration) ABSL_EXCLUSIVE_LOCK_FUNCTION(mu_) { - mu_.Lock(); + mu_.lock(); // NOTE: Reset only `nudge_`, but not `stop_`: nudging is transient and // can be activated repeatedly, the latter is persistent and can be // activated only once (repeated calls to `Stop()` are no-ops). nudge_ = false; - mu_.Unlock(); + mu_.unlock(); const auto wake_early = [this]() { mu_.AssertReaderHeld(); return nudge_ || stop_; diff --git a/centipede/periodic_action_test.cc b/centipede/periodic_action_test.cc index d858e0d6e..70bb51c97 100644 --- a/centipede/periodic_action_test.cc +++ b/centipede/periodic_action_test.cc @@ -144,20 +144,20 @@ TEST(PeriodicActionTest, NudgeThenStopStillRunsAction) { absl::Mutex count_mu; PeriodicAction action{ [&count, &count_mu]() { - absl::MutexLock lock{&count_mu}; + absl::MutexLock lock{count_mu}; ++count; }, PeriodicAction::ZeroDelayConstInterval(absl::InfiniteDuration()), }; absl::SleepFor(absl::Seconds(1)); { - absl::MutexLock lock{&count_mu}; + absl::MutexLock lock{count_mu}; EXPECT_EQ(count, 1); } action.Nudge(); action.Stop(); { - absl::MutexLock lock{&count_mu}; + absl::MutexLock lock{count_mu}; EXPECT_EQ(count, 2); } } @@ -170,21 +170,21 @@ TEST(PeriodicActionTest, NudgeThenDtorStillRunsAction) { { PeriodicAction action{ [&count, &count_mu]() { - absl::MutexLock lock{&count_mu}; + absl::MutexLock lock{count_mu}; ++count; }, PeriodicAction::ZeroDelayConstInterval(absl::InfiniteDuration()), }; absl::SleepFor(absl::Seconds(1)); { - absl::MutexLock lock{&count_mu}; + absl::MutexLock lock{count_mu}; EXPECT_EQ(count, 1); } EXPECT_EQ(count, 1); action.Nudge(); } { - absl::MutexLock lock{&count_mu}; + absl::MutexLock lock{count_mu}; EXPECT_EQ(count, 2); } } @@ -198,7 +198,7 @@ TEST(PeriodicActionTest, ActionIsMoveable) { { PeriodicAction moved_from{ [&mu, &thread_ids]() { - absl::WriterMutexLock lock{&mu}; + absl::WriterMutexLock lock{mu}; thread_ids.push_back(std::this_thread::get_id()); }, PeriodicAction::ZeroDelayConstInterval(absl::Milliseconds(10)), diff --git a/centipede/resource_pool.cc b/centipede/resource_pool.cc index a499a8f1b..a864fbf97 100644 --- a/centipede/resource_pool.cc +++ b/centipede/resource_pool.cc @@ -94,7 +94,7 @@ template typename ResourcePool::LeaseToken ResourcePool::AcquireLeaseBlocking(LeaseRequest&& request) { if (FUZZTEST_VLOG_IS_ON(1)) { - absl::ReaderMutexLock lock{&pool_mu_}; + absl::ReaderMutexLock lock{pool_mu_}; FUZZTEST_VLOG(1) << "Received lease request " << request.id // << "\nrequested: " << request.amount.FormattedStr() // << "\nquota: " << quota_.FormattedStr() // @@ -144,7 +144,7 @@ ResourcePool::AcquireLeaseBlocking(LeaseRequest&& request) { << "\nleased : " << (-request.amount).FormattedStr() // << "\nafter : " << (pool_ - request.amount).FormattedStr(); pool_ = pool_ - request.amount; - pool_mu_.Unlock(); + pool_mu_.unlock(); return LeaseToken{*this, std::move(request)}; } else { absl::Status error = // @@ -152,14 +152,14 @@ ResourcePool::AcquireLeaseBlocking(LeaseRequest&& request) { "Lease request ", request.id, " timed out; timeout: ", request.timeout, " requested: [", request.amount.ShortStr(), "] current pool: [", pool_.ShortStr(), "]")); - pool_mu_.Unlock(); + pool_mu_.unlock(); return LeaseToken{*this, std::move(request), std::move(error)}; } } template void ResourcePool::ReturnLease(const LeaseToken& lease) { - absl::WriterMutexLock lock{&pool_mu_}; + absl::WriterMutexLock lock{pool_mu_}; FUZZTEST_VLOG(1) // << "Returning lease " << lease.request().id // << "\nreq age : " << lease.request().age() // diff --git a/centipede/rusage_profiler.cc b/centipede/rusage_profiler.cc index a8b2ec4da..5e41de5d7 100644 --- a/centipede/rusage_profiler.cc +++ b/centipede/rusage_profiler.cc @@ -372,7 +372,7 @@ const RUsageProfiler::Snapshot& RUsageProfiler::TakeSnapshot( // return kEmpty; } - absl::WriterMutexLock lock{&mutex_}; + absl::WriterMutexLock lock{mutex_}; RUsageTiming snap_timing = RUsageTiming::Zero(); RUsageTiming delta_timing = RUsageTiming::Zero(); @@ -420,7 +420,7 @@ void RUsageProfiler::StartTimelapse( // absl::Duration interval, // bool also_log, // std::string title) { - absl::WriterMutexLock lock{&mutex_}; + absl::WriterMutexLock lock{mutex_}; FUZZTEST_CHECK(!timelapse_recorder_) << "StopTimelapse() wasn't called"; timelapse_recorder_ = std::make_unique( [this, loc = std::move(loc), title = std::move(title), also_log]() { @@ -431,7 +431,7 @@ void RUsageProfiler::StartTimelapse( // } void RUsageProfiler::StopTimelapse() { - absl::WriterMutexLock lock{&mutex_}; + absl::WriterMutexLock lock{mutex_}; FUZZTEST_CHECK(timelapse_recorder_) << "StartTimelapse() wasn't called"; timelapse_recorder_.reset(); } @@ -483,10 +483,10 @@ void RUsageProfiler::PrintReport( // void RUsageProfiler::GenerateReport( ReportSink* absl_nonnull report_sink) const { - absl::ReaderMutexLock lock{&mutex_}; + absl::ReaderMutexLock lock{mutex_}; // Prevent interleaved reports from multiple concurrent RUsageProfilers. ABSL_CONST_INIT static absl::Mutex report_generation_mutex_{absl::kConstInit}; - absl::WriterMutexLock logging_lock{&report_generation_mutex_}; + absl::WriterMutexLock logging_lock{report_generation_mutex_}; ProfileReportGenerator gen{snapshots_, report_sink}; diff --git a/centipede/rusage_stats_test.cc b/centipede/rusage_stats_test.cc index 69d1a76b2..7f5e0580f 100644 --- a/centipede/rusage_stats_test.cc +++ b/centipede/rusage_stats_test.cc @@ -91,7 +91,7 @@ class CpuHog { } // Let one of the hogs notify the caller that the hogging is over. { - absl::MutexLock lock{&mu_}; + absl::MutexLock lock{mu_}; if (!hogging_stopped->HasBeenNotified()) { hogging_stopped->Notify(); } diff --git a/centipede/util.cc b/centipede/util.cc index c483f52b9..376d7b4c7 100644 --- a/centipede/util.cc +++ b/centipede/util.cc @@ -176,7 +176,7 @@ static std::vector *dirs_to_delete_at_exit // Atexit handler added by CreateLocalDirRemovedAtExit(). // Deletes all dirs in dirs_to_delete_at_exit. static void RemoveDirsAtExit() { - absl::MutexLock lock(&dirs_to_delete_at_exit_mutex); + absl::MutexLock lock(dirs_to_delete_at_exit_mutex); for (auto &dir : *dirs_to_delete_at_exit) { std::error_code error; std::filesystem::remove_all(dir, error); @@ -195,7 +195,7 @@ void CreateLocalDirRemovedAtExit(std::string_view path) { << "Unable to clean up existing dir " << path << ": " << error.message(); std::filesystem::create_directories(path); // Add to dirs_to_delete_at_exit. - absl::MutexLock lock(&dirs_to_delete_at_exit_mutex); + absl::MutexLock lock(dirs_to_delete_at_exit_mutex); if (!dirs_to_delete_at_exit) { dirs_to_delete_at_exit = new std::vector(); atexit(&RemoveDirsAtExit);