summaryrefslogtreecommitdiff
path: root/annotations/generate_annotated_java_files.py
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2016-08-18 14:15:58 +0100
committerNarayan Kamath <narayan@google.com>2016-08-24 17:25:20 +0000
commit36d074286912d876489c6ff21bc0c41016180dad (patch)
tree7e5d287f21d7ca3b8500f61728ba923ff19eb593 /annotations/generate_annotated_java_files.py
parent4c3078609421ce333468dd415d62980e68d35c9e (diff)
ZipFile: Never change file offset during I/O operations.
Use pread instead read and eliminate unnecessary calls to lseek. dalvik.system.VMClassLoader maintains a cache of JarFile objects that it creates whenever it loads resources from them. This cache may be populated in the zygote as a side effect of preloading classes. When processes are forked from the zygote, the file descriptors associated with these JarFile objects point to the same kernel file description and may end up stepping on each others toes. To avoid such issues, we never make any offset changes to the associated file. Note that we have a guarantee that the file will never be closed in any forked process because the associated JarFile objects can never be collected. test: run cts -m CtsLibcoreTestCases / ZipStressTest / manual testing to trigger the race condition. bug: 30407219 bug: 30904760 (cherry picked from commit 0393d3c84ed9bd24bcf0dac3782a1cc23400ace8) (cherry picked from commit 50c5924a4a1f78b7722d97dc958317027e25e214) Change-Id: I1d2be54e768f668616e5b53e038d80fab5aa7e18
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions