diff options
author | songjinshi <songjinshi@xiaomi.com> | 2016-09-08 15:24:30 +0800 |
---|---|---|
committer | 金时 宋 <songjinshi@xiaomi.com> | 2016-09-20 01:31:19 +0000 |
commit | 49921f2c05cff6d4526b5b30f7b8e2d8bbabc069 (patch) | |
tree | 8abf1bb649ed595181f15c76225cfb0374e1f3e5 /tools/aapt2/java/JavaClassGenerator_test.cpp | |
parent | 0027ddf990c657d3db8c1179cc2cad2dfe19f79f (diff) |
[AssetManager]:Fix thread race caused double free issue.
The SharedZip's Asset is not thread-safety,the getResourceTableAsset()
and setResourceTableAsset(Asset* asset) function of the SharedZip is
not sync with a same lock.
Consider the following sequence of events:
Thread A calls setResourceTableAsset(Asset* asset),it will set
mResourceTableAsset = asset; then to calls getBuffer() of the asset.
Thread B calls getResourceTableAsset(),which return mResourceTableAsset,
then to calls getBuffer() of the mResourceTableAsset,the asset and
mResourceTableAsset is same one object.
Thread A to delete mZipInflater in getBuffer().
Thread B to delete mZipInflater in getBuffer().
It will cause crash becuase double delete mZipInflater in getBuffer().
https://code.google.com/p/android/issues/detail?id=211941
Change-Id: I5a7d67fdf64c4aa03f505b37a2fa840f4443d158
Signed-off-by: songjinshi <songjinshi@xiaomi.com>
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions