commit | 0744d72e304fddd5453d05f8e06fa85c0467e86d | [log] [tgz] |
---|---|---|
author | Nicolas Geoffray <ngeoffray@google.com> | Mon Apr 19 08:46:32 2021 +0100 |
committer | Nicolas Geoffray <ngeoffray@google.com> | Mon Apr 19 12:43:16 2021 +0000 |
tree | 25ed932d34a9a440acdda406cdd580d9a74b7e94 | |
parent | 0b943287e7dec0cbe1734752f5a1f30f3c29973b [diff] |
Fix race in GetPrimaryOatFile. GetPrimaryOatFile is broken and racy: - Broken as it returns the first entry of a set, which isn't guaranteed to be the primary oat file. - Racy as is returns an .oat file and then drops the oat_file_manager lock, so the OatFile may be concurrently deleted. This CL fixes the race by only returning the information needed by the only user of GetPrimaryOatFile. Test: test.py Change-Id: I512cb82a1c8856c06abf9bb243a5eeee33701dd1