-
-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Failed to attach uprobe at client side #312
Comments
adding sample code for reproducing issue |
I'm sorry that i'm a bit confusing. Could please make the following things clearer?
|
Which executable : https://github.com/ls1mardyn/ls1-mardyn How to run : standalone application
===================================================== Failure : Tried same app with bpftime. Server : cd ls1-MarDyn/build/src Error : Failed to attach uprobe to some functions ; case GUM_INSTRUMENTATION_ERROR_WRONG_SIGNATURE: Please do let me know if you are anymore queries. |
@Officeyutong please let me know if you need more clarity . I am kind off stuck here , we had to delay integration of bpftime into our project. bpftime working fine with other application but failing for this application. https://github.com/ls1mardyn/ls1-mardyn |
Sorry I'm too busy these days, I'll investigate into this issue and give you a reply in two days |
Could you please send me a precompiled (statically linked is better) bpftracer for x86-64? It's difficult to get your source compiled |
Attaching bpftracer built with following tools Need root access and check ulimit limits for that user , may need to increase base on number of uprobes. For attaching normal kernel uprobes |
Unable to repdocude except limitation of
I didn't encounter any issues related with attach, I have done the following test:
bpftime is built with the newest commit. So now I think there might be some issues on the binary you produced. Can you send me a copy of |
I could attach uprobes for default binary and working fine. I will check if there are any issues with generated MarDyn binary. sorry for deviating from main question : Does bpftime support attaching multiple pids (of running processes) like example https://github.com/eunomia-bpf/bpftime (Quick start section) |
Hi @Officeyutong . I managed to create small reproducer for the issue. Issue happening with AMD compiler(AOCC) you can download from here: https://www.amd.com/en/developer/aocc.html Same application compiled with GCC and Clang working fine with bpftime. Reproduced with : Bpf client side error : 2024-08-27 05:00:43][error][1401954] Failed to execute frida gum_interceptor_attach for function 555da3ee37b0 Bpf Server side : Success 2024-08-27 05:56:45][info][1422282] Created uprobe/uretprobe perf event handler, module name /home/user/data/expr/probe_limits, offset 7b0 Process maps : Maps of app Failed function address 555da3ee37b0, falling outside execution mapped region of process. Server side attached using proper file offset 00000000000017b0 <op_0> (File Offset: 0x7b0): we are u Application #include <stdio.h> void attribute ((noinline)) op_0() int main()t |
Just attach them seperately, call |
Will AOCC work on an Intel CPU? I don't have any AMD cpu machine now |
AOCC should work with intel CPU, its same x86 . Except for some special optimization flags. above application compiled with aocc/clang application.c -o application Make sure its aocc/clange not system default clang . Please do "which clang" and Give absolute path of AOCC compiler. |
"yes, AOCC should work with intel CPU, its same x86 . Except for some special optimization flags. above application compiled with aocc/clang application.c -o application Make sure its aocc/clange not system default clang . Please do "which clang" and Give absolute path of AOCC compiler." |
@Officeyutong How do we achieve same with bpftime . Are there any places we have to run bpftime with sudo (must ?? ) Modes of running bpftime
attach to it: $ sudo bpftime attach 101771 # You may need to run make install in root
Run with LD_PRELOAD directly Why do we need to use sudo in 1st method , is it necessary and Could you please let me know which cases we need to use sudo and which use case not. We would like to avoid use of Sudo along with bpf programs. (run bpf program as non root). we would like to use attach method without sudo , is it possible. |
Describe the bug
Trying to attach uprobe to application functions. Issue occurred when client trying to instrument application failed to inject or attach probe to certain functions.
Same bpf code able to attach uprobes to appilcation with kernel uprobes.
After adding some debugs ,looks like we are hitting following issue GUM_INSTRUMENTATION_ERROR_WRONG_SIGNATURE.
To Reproduce
Attaching sample programs user space bpf and kernel bpf code.
Application : https://github.com/ls1mardyn/ls1-mardyn
How to build :
make;g++ -g bpftracer.cpp -o bpftracer -lbpf -lelf
Make sure bpftime bundled libbpf and system installed libbpf is same (libbpf.so.1.3.0)
How to run :
./bpftracer "absulute path to executable" "function pattern or name"
tracer_code.zip
functionpattern "*" traces all functions in executable ".text" section.
Server :
LD_PRELOAD=build/runtime/syscall-server/libbpftime-syscall-server.so /home/user/bpftracer
Client :
application https://github.com/ls1mardyn/ls1-mardyn ( build clang one )
cd ls1-MarDyn/build/src
LD_PRELOAD=/home/user/bpftime/build/runtime/agent/libbpftime-agent.so ./MarDyn ../../examples/EOX/305K_liq/config.xml --steps 50
The text was updated successfully, but these errors were encountered: