android: crazy_linker: Load system libraries with system linker.
Add a way to detect system libraries, and fallback to the system linker whenever they need to be loaded. This is needed because Chrome probes a few system libraries like libEGL.so to check that certain GL-related symbols are available. It does that by using dlopen() + multiple dlsym() + dlclose(), which end up being performed through the crazy linker wrappers (e.g. WrapDlopen()). When enabling the crazy linker, it seems this happens everytime the user navigates to a different web page! Due to the way the code works before this CL, this ended up loading said system libraries with the crazy linker, which is problematic because: - If the system library was already loaded in the Zygote, this would create a duplicate copy, loaded at a different address. Also this is much slower than simply incrementing the reference-count of an existing system library entry. - This creates pending RDebug-related tasks, which happen to be racy, and the source of runtime crashes. By detecting system libraries properly, the code can now always fall back to use the system linker to load them, avoiding these two problems entirely. In particular, it is hoped that this will decrease the amount of runtime crashes described in 831403. BUG=843987,831403 R=pasko@chromium.org, agrieve@chromium.org, rcmilroy@chromium.org Change-Id: I86d89d6a812b778cf962aa5da028449b2b79f1fa Reviewed-on: https://chromium-review.googlesource.com/1236656Reviewed-by:agrieve <agrieve@chromium.org> Commit-Queue: David Turner <digit@chromium.org> Cr-Commit-Position: refs/heads/master@{#592861}
Showing
Please register or sign in to comment