Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Statistics collection and thread safety fixes for AZ::IO::DedicatedCache #507

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dkondrashkin
Copy link

More fixes for problems addressed by #494

While previous pull request fixed most of the issues the one remained:

  • DedicatedCache::DestroyDedicatedCache() call can happen right between DedicatedCache::CollectStatistics() call and any code that makes use of statistics collected (e.g. System.cpp @ 1745 or Device.cpp @ 96). This leads to accessing invalid memory through string views stored in statistics values and, particularly, to crashes on consoles.

The solution proposed (apart form guarding internal data members with locks) is to postpone removal of m_cachedStatNames entries until the very beginning of the next DedicatedCache::CollectStatistics() call.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@AMZN-alexpete
Copy link

Thanks for submitting these additional fixes @dkondrashkin, we're looking over the change and will update this PR with status changes or questions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants