Debugging support in third_party/android_crazy_linker needs to be cleaned up to avoid a few issues:
- The API provides a way to defer certain modifications of
process-global state (i.e. the list of libraries visible from GDB)
to a different thread, in order to minimize race conditions when
the system linker tries to modify the same value. There is
no reliable and safe way to do this, unfortunately
However, the implementation of ScopedDelayedCallbackPoster is racy
(it just modifies a global boolean flag on scope entry/exit, which
is not thread-safe since it can be used by several Chromium threads
at the same time).
- The API is also a lot more complicated than necessary (it exposes
callbacks to the crazy-linker clients for no good reason).
- Finally, the implementation is buggy, since it sends potentially
dangling pointers to the client. This can result in runtime crashes
in certain cases (e.g. if a library if loaded and unloaded before
the callback actually runs).
This bug is to track the issue.
Comment 1 by bugdroid1@chromium.org
, Jan 30 2018