linuxaddress-sanitizerbpfdynamic-analysisbcc-bpf

bpftrace: uprobe target file does not exist or is not executable


I want to use bpftrace to trace functions inside libasan library, which is inside /usr/lib/x86_64-linux-gnu/.

However

sudo bpftrace -e 'uretprobe:/usr/lib/x86_64-linux-gnu/libasan.so.4: __interceptor_malloc { printf("pid: %d, malloc %p\n", pid, retval); }'

gives error: uprobe target file '/usr/lib/x86_64-linux-gnu/libasan.so.4' does not exist or is not executable

I have tried: export LD_LIBRARY_PATH="/lib:/usr/lib:/usr/local/lib" but it does not help.

How can make the library executable for bpftrace? I need it to trace allocations done in a Firefox process. Thanks!

EDIT: I just found out that the permission on libasan is -rw-r--r--, which means it is indeed not executable. How should I make it executable?


Solution

  • I fixed it by doing chmod +x libasan.so.4.0.0