fix: prevent agent abort when optional BPF program is missing from ELF#11640
Open
mijonOfTheMoon wants to merge 1 commit intodeepflowio:mainfrom
Open
fix: prevent agent abort when optional BPF program is missing from ELF#11640mijonOfTheMoon wants to merge 1 commit intodeepflowio:mainfrom
mijonOfTheMoon wants to merge 1 commit intodeepflowio:mainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is for:
Fixes SIGABRT (exit code 134) when optional BPF program is missing from ELF in CE builds
Steps to reproduce the bug
registry.cn-hongkong.aliyuncs.com/deepflow-ce/deepflow-agent:v7.1on Debian 12, kernel 6.1.0-43-amd64ERROR [src/ebpf/user/table.c:132] bpf_obj__get_prog_by_name() not find "df_PE_python_unwind"Changes to fix the bug
agent/src/ebpf/user/table.c, functioninsert_prog_to_map(): downgradeebpf_error()toebpf_warning()for the program-not-found case. The function already returns early after logging, so the abort is unnecessary.Affected branches
Checklist
Note: This change only affects userspace logging (ebpf_error → ebpf_warning) in table.c. No eBPF kernel programs were modified.