Skip to content

fix: prevent agent abort when optional BPF program is missing from ELF#11640

Open
mijonOfTheMoon wants to merge 1 commit intodeepflowio:mainfrom
mijonOfTheMoon:fix-abort-on-missing-bpf-prog
Open

fix: prevent agent abort when optional BPF program is missing from ELF#11640
mijonOfTheMoon wants to merge 1 commit intodeepflowio:mainfrom
mijonOfTheMoon:fix-abort-on-missing-bpf-prog

Conversation

@mijonOfTheMoon
Copy link
Copy Markdown

@mijonOfTheMoon mijonOfTheMoon commented Apr 20, 2026

This PR is for:

  • Agent

Fixes SIGABRT (exit code 134) when optional BPF program is missing from ELF in CE builds

Steps to reproduce the bug

  • Deploy CE image registry.cn-hongkong.aliyuncs.com/deepflow-ce/deepflow-agent:v7.1 on Debian 12, kernel 6.1.0-43-amd64
  • Enable continuous profiler (default config)
  • Agent logs ERROR [src/ebpf/user/table.c:132] bpf_obj__get_prog_by_name() not find "df_PE_python_unwind"
  • Agent exits with code 134 (SIGABRT)

Changes to fix the bug

  • In agent/src/ebpf/user/table.c, function insert_prog_to_map(): downgrade ebpf_error() to ebpf_warning() for the program-not-found case. The function already returns early after logging, so the abort is unnecessary.

Affected branches

  • main

Checklist

  • Added unit test to verify the fix.
  • Verified eBPF program runs successfully on linux 4.14.x.
  • Verified eBPF program runs successfully on linux 4.19.x.
  • Verified eBPF program runs successfully on linux 5.2.x.

Note: This change only affects userspace logging (ebpf_error → ebpf_warning) in table.c. No eBPF kernel programs were modified.

insert_prog_to_map() calls ebpf_error() when a BPF program is not found in the ELF object. ebpf_error maps to ERROR_ABORT which triggers abort() via os_panic(), crashing the agent with SIGABRT (exit 134).

This is a problem for CE builds where language-specific unwinder programs (e.g. df_PE_python_unwind) are absent from the compiled binary. The function already handles the missing program gracefully by returning early, so the abort is unnecessary.

Downgrade ebpf_error to ebpf_warning so the missing program is logged without crashing the agent.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 20, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants