iovisor / iovisor/bcc

BPF: Failed to attach BPF to device eth0: Cannot allocate memory

Open
#3,617 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
5d 13h
Merged PRs (30d)
3

Description

Hi,
i am getting below error when running a bpf program(socket filtering) in GKE 1.20 cluster.

Host Info:
OS: Container-Optimized OS(COS)
BUILD_ID=16108.470.1
Kernel: 5.4.120+
BCC Version: 0.16.0-3.el8

Error:
`Traceback (most recent call last):
File "bpf-parser-l7flowmap.py", line 354, in
attach_interfaces_to_sock(iface)
File "bpf-parser-l7flowmap.py", line 251, in attach_interfaces_to_sock
BPF.attach_raw_socket(function_flow_bpf_filter, iface)
File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 552, in attach_raw_socket
% (dev, errstr))
Exception: Failed to attach BPF to device b'eth0': Cannot allocate memory`

Can someone help me why throwing "Cannot Allocate memory". There is lots of memory available in the host.
Facing this issue only in GKE cluster

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with bpf-parser-l7flowmap.py at attach_interfaces_to_sock and the BPF.attach_raw_socket call shown in the traceback. Reproduce the failure in the stated GKE 1.20, COS, and kernel 5.4.120+ environment, then investigate why attaching to eth0 reports memory exhaustion despite available host memory; done means documenting the cause and a verified resolution or limitation.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.