This is an archive of the discontinued LLVM Phabricator instance.

tsan: fix a bug in trace part switching
ClosedPublic

Authored by dvyukov on Jul 14 2022, 8:00 AM.

Details

Summary

Callers of TraceSwitchPart expect that TraceAcquire will always succeed
after the call. It's possible that TryTraceFunc/TraceMutexLock in TraceSwitchPart
that restore the current stack/mutexset filled the trace part exactly up
to the TracePart::kAlignment gap and the next TraceAcquire won't succeed.
Skip the alignment gap after writing initial stack/mutexset to avoid that.

Diff Detail

Event Timeline

dvyukov created this revision.Jul 14 2022, 8:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2022, 8:00 AM
Herald added a subscriber: Enna1. · View Herald Transcript
dvyukov requested review of this revision.Jul 14 2022, 8:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2022, 8:00 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
melver accepted this revision.Jul 14 2022, 8:32 AM
This revision is now accepted and ready to land.Jul 14 2022, 8:32 AM
This revision was landed with ongoing or failed builds.Jul 14 2022, 8:49 AM
This revision was automatically updated to reflect the committed changes.