There are two bugs that caused bpftime unable to run bashreadline (example/libbpf-tools/bashreadline)
[x] bashrc seems to be incompatible with bpftime+bash. These can be temporarily solved by running bash using --norc. This is not fixed yet.
[x] All subprocesses spawned by bash will ended up with segmentation fault. This is caused by bpftime will not check if the injected process contains the module that uprobe requires, e.g we may attach a uprobe designed for /bin/bash @ 0x123456 to /bin/ls (a process that bash spawns). Under this way, resolve_function_addr_by_module_offset is unable to resolve the real address that should be attached, it returns nullptr, so a segmentation fault will be raised if we invoke frida to add a invocation listener. This issue was solved by checking /proc/self/maps and try to match each line for the desired module. If nothing was matched, we will reject this attach
There are two bugs that caused bpftime unable to run bashreadline (example/libbpf-tools/bashreadline)
--norc
. This is not fixed yet./bin/bash @ 0x123456
to/bin/ls
(a process that bash spawns). Under this way,resolve_function_addr_by_module_offset
is unable to resolve the real address that should be attached, it returns nullptr, so a segmentation fault will be raised if we invoke frida to add a invocation listener. This issue was solved by checking/proc/self/maps
and try to match each line for the desired module. If nothing was matched, we will reject this attachCloses #277