Skip to content
Merged
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
6 changes: 6 additions & 0 deletions centipede/sancov_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ void ThreadLocalSancovState::TraceMemCmp(uintptr_t caller_pc, const uint8_t *s1,
}

void ThreadLocalSancovState::OnThreadStart() {
if (tls.started) return;
termination_detector.EnsureAlive();
tls.started = true;
// Always trace threads by default. Internal threads that do not want tracing
Expand All @@ -145,6 +146,11 @@ void ThreadLocalSancovState::OnThreadStart() {
}

void ThreadLocalSancovState::OnThreadStop() {
if (tls.sancov_lowest_sp == nullptr) {
// This can happen only before OnTheadStart() or after OnThreadStop() -
// nothing to do if that's the case.
return;
}
tls.traced = false;
LockGuard lock(sancov_state->tls_list_mu);
const size_t sancov_lowest_sp = *tls.sancov_lowest_sp;
Expand Down
Loading