iovisor / iovisor/bcc

bcc attach_uprobe returns EACCESS error under Deban 12

Open
#5,387 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

recently i've encountered a strange bpf_load problem using bcc, and hopefully can find some clues here. thanks for helping first.
the Problem is : **when try to attach a uprobe using bcc cpp library, the bpf program encounters a `bpf_load` EACCESS error Under Debian 12, while the same program can run successfully under Debian 10.**

the code triggers the error:
```
auto attach_res =
bpf.attach_uprobe(db_exe_path, MYSQL_DISPATCH_COMMAND_FUNC, "dispatch_command_entry");
if (!attach_res.ok()) {
LOG(ERROR) << attach_res.msg();
goto clear_ebpf;
}
```
through a rough investigation, i thinks it is the load_func function of bcc library which triggered the error:

Image

and when using strace to run the failed program to catch bpf system call, the following error was caught, it seems that the error occurred during BPF_LOAD
Image

and the following has been cheked and can be considered OK:
1. executable to be attached and its symbols
2. bpf security issues
3. **i wrote a simple cpp program and directly compile and run it under the same Debian 12 host, then use a python script to test. It turned out to work fine that the bpf program can be loaded and attached**.

Anyone has any suggestions? thanks for your help.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the bpf.attach_uprobe call and inspect the BCC load_func path mentioned in the report. Reproduce the failure on Debian 12, compare it with Debian 10 and the working direct C++/Python test, and use the captured BPF system call to narrow the failing stage. Done means identifying a reproducible cause and documenting the relevant fix or missing environment detail.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, debian, linux
Domain
operating-systems, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.