Skip to content

listenerToken data race in ServiceTrackerPrivate #710

@shane-riley

Description

@shane-riley

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions