Skip to content

bcc attach_uprobe returns EACCESS error under Deban 12 #5387

@drusong

Description

@drusong

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions