On 2019-11-15 at 14:51 UTC, David Malcolm wrote:
Thinking aloud: does anyone ever use symbol overriding for anything
other than glibc?
Yes. It is particularly useful for "spear fishing" debugging of lower-level
interfaces in large, complex multi-process applications. By some means
you determine that [part of] the bug involves a bad parameter to
a particular API, but a conditional breakpoint in gdb has too much overhead
(if you can figure out at all how to invoke gdb in the cloud of processes.)
So: LD_PRELOAD a .so which overrides the API and checks the parameter.
If no problem then pass control to the original implementation via RTLD_NEXT.
If bad, then raise an alarm, prepare a backtrace, pause or spin until
rescued by manual attach of gdb, etc.