diff options
author | Kweku Adams <kwekua@google.com> | 2019-08-20 19:08:15 -0700 |
---|---|---|
committer | Kweku Adams <kwekua@google.com> | 2019-08-20 19:13:15 -0700 |
commit | f6ea6733b06809740a3a0dc651335a1635f7ff63 (patch) | |
tree | 9b878840c894ae1e711b2e38891ac1cc67fad9d2 /rs/java/android/renderscript/ProgramFragmentFixedFunction.java | |
parent | 8cfff7b8b215c0913781f2d81117e0652088a8da (diff) |
Address static cache access issues.
ArrayMap and ArraySet are not thread safe, so callers are expected to
lock around their instances before calling any methods. However, if a
caller fails to lock, there can be races that end up corrupting the
cache pool (despite having the class level lock held). A corrupted pool
causes issues for other ArrayMap/Set instances, even if those instances
are properly used under locks. There's no way to guard against cache
pool corruption without making ArrayMap/Set fully thread-safe, changing
the pool structure, or appropriately locking around each ArrayMap/Set
instance.
For now, we make ArraySet throw ConcurrentModificationException on a best
effort basis to provide better awareness when an ArraySet is accessed
concurrently without any locks and try to detect when the cache is
corrupted.
Bug: 62282384
Bug: 73549921
Bug: 122969275
Bug: 139015193
Bug: 139401479
Test: atest CtsUtilTestCases:ArrayMapTest
Test: atest CtsUtilTestCases:ArraySetTest
Test: atest FrameworksCoreTests:ArrayMapTest
Test: atest FrameworksCoreTests:ArraySetTest
Change-Id: Icd76630b25afd9f3627239301ffa5c37da25ea18
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions