Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Regression: libbpf migration causes 'Operation not permitted' when loading maps #146

Closed
Tracked by #162
rsdy opened this issue May 12, 2021 · 4 comments · Fixed by #167
Closed
Tracked by #162

Regression: libbpf migration causes 'Operation not permitted' when loading maps #146

rsdy opened this issue May 12, 2021 · 4 comments · Fixed by #167
Assignees
Labels
bug Something isn't working

Comments

@rsdy
Copy link
Collaborator

rsdy commented May 12, 2021

I have not managed to find why this happens, but I am getting an Operation not permitted error when running foniod with the latest main branch.

Reverting 1b3c5a6 and c33138d. makes foniod work as expected.

@rhdxmr I will try to get more information about what specifically is failing here, but so far I've been able to localize the error to the Map::with_map_def call. If you have run into errors like this, I'd be happy to try any ideas.

@rsdy
Copy link
Collaborator Author

rsdy commented May 12, 2021

I have a hunch we're running into this:
https://github.com/iovisor/bcc/blob/master/src/cc/libbpf.c#L294

I will port this logic and see if that fixes the issue.

edit: running ulimit -l 100000000000 fixes the issue, so we definitely need to replicate the retry logic on map creation.

@rsdy rsdy mentioned this issue Aug 5, 2021
7 tasks
@rhdxmr
Copy link
Collaborator

rhdxmr commented Aug 16, 2021

@rsdy I can not reproduce the error. How can you do that?

@rhdxmr
Copy link
Collaborator

rhdxmr commented Aug 16, 2021

Quote from Merge tag 'net-next-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next

BPF switch from crude rlimit-based to memcg-based memory accounting

cf) https://lwn.net/Articles/827664/

I am using kernel v5.11 so I could not reproduce rlimit error with my machine.
Ok.. I will test this problem using the older kernel via VM and write some code for fixing it

@rsdy
Copy link
Collaborator Author

rsdy commented Aug 16, 2021

I think the best approach here is porting the fallback logic from bcc's libbpf. We lost this when we moved away from using that lib as the core.

I tested this on kernel 5.10.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants