Skip to content

Conversation

@therealak12
Copy link
Contributor

I opened this PR to address issue#1818.

In my experience, the problem has been occurring since version v0.19.0 (it does not appear in v0.18.0), specifically for the aesni_intel kernel module. The error encountered is:

apply CO-RE relocations: load BTF for kmod aesni_intel: read string section: string table is empty
exit status 1

I've checked stat /sys/kernel/btf/aesni_intel. It shows 24 bytes, which is for the BTF header, but it has no content.

@dylandreimerink
Copy link
Member

This seems to be a duplicate / alternative PR for https://github.com/cilium/ebpf/pull/1828/files

@therealak12
Copy link
Contributor Author

This seems to be a duplicate / alternative PR for https://github.com/cilium/ebpf/pull/1828/files

That one returns a non-empty list while the file is empty. IMHO, this is a better solution.

Fixes: cilium#1818
Signed-off-by: therealak12 <[email protected]>
Signed-off-by: Lorenz Bauer <[email protected]>
@lmb
Copy link
Collaborator

lmb commented Jul 30, 2025

Thanks for adding the test, that was useful. Rebased this on main and changed it to use the approach where newStringTable deals with emptiness.

@lmb lmb changed the title Don't try to load strings when btf file is empty btf: don't try to load strings when file is empty Jul 30, 2025
@lmb lmb merged commit 41958b7 into cilium:main Jul 30, 2025
18 checks passed
@therealak12
Copy link
Contributor Author

I assumed introducing an outer check on StringLen could help avoid unnecessary function and system calls.

@lmb
Copy link
Collaborator

lmb commented Jul 30, 2025

There are no system calls performed, and function calls are not really measurable at this level. Maybe you mean because the original code did some io.Read? That is gone now.

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.

3 participants