Improve `uprobe` dynamic library path resolution to be `glibc`-agnostic
Opened this issue · 0 comments
epompeii commented
Currently, when you provide Aya a target to attach a uprobe
to, it has the following resolution strategy:
aya/aya/src/programs/uprobe.rs
Line 112 in 5a43bed
- Check if the
pid
is set; if so find the lib in theproc
maps - Check if an absolute path is provided; if so assume that the path is to a binary/library path
- Otherwise, fallback to looking up a dynamic library in
ld.so.cache
However, the use of ld.so.cache
is specific to glibc
. Even though Aya can be compiled to musl
targets, this prevents using uprobe
s with dynamic library resolution in non-glibc
environments, such as Alpine.
Improve the uprobe
dynamic library path resolution to be glibc
-agnostic.
This will likely involve searching for the provided dynamic library in PATH
ourselves, instead of relying ld.so.cache
.