The ServiceTrackerPrivate holds a listener token. In ServiceTracker::Close(), the listener token is passed through a std::move() outside of the synchronized region for the ServiceTrackerPrivate, creating a data race when Open() and Close() calls are made concurrently.
This race is warned by TSan, but is currently suppressed.
Moving the RemoveListener call in ServiceTracker::Close() will likely resolve the race, but the possibility of re-entrancy should be examined before implementing this solution.
To Reproduce:
- Remove ServiceTracker lines from tsan_suppressions.txt
- Run usFrameworkTests (specifically ServiceTrackerTest.ServiceTrackerConcurrentOpenClose) in TSan
The ServiceTrackerPrivate holds a listener token. In ServiceTracker::Close(), the listener token is passed through a std::move() outside of the synchronized region for the ServiceTrackerPrivate, creating a data race when Open() and Close() calls are made concurrently.
This race is warned by TSan, but is currently suppressed.
Moving the RemoveListener call in ServiceTracker::Close() will likely resolve the race, but the possibility of re-entrancy should be examined before implementing this solution.
To Reproduce: