Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix race condition in ReadableNativeMap
Summary: [Changelog][Internal] Guard call to the C++ ReadableNAtiveMap.importValues with a lock. Note that all the occurrences in this class (together with importTypes) already were protected by a lock, except of this one, which with the very high chance caused crashes in T145271136. My corresponding comment from the task, for justification: > If callstack to be trusted, the crash happens on the C++ side, in ReadableNativeMap::importValues(). It throws ArrayIndexOutOfBoundsException, which, looking at the code, seems to be only possible due to a corrupted data or race conditions. > Now, looking at the Java side of ReadableNativeMap, and the particular call site... it's very dodgy, since all other occurrences of calling to native importTypes/importValues are guarded by locks, but the one crashing isn't. NOTE: A couple of `importKeys()` instances appears to suffer from the same problem as well. Reviewed By: javache Differential Revision: D43398416 fbshipit-source-id: 5ea3301857517d99a9007ddf2739e49ca8136743
- Loading branch information