Skip to content

elf_reader: do not panic in loadMapsif ELF file has no BTF #1807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2025

Conversation

paulcacheux
Copy link
Contributor

3f1a755 introduced the ability to read btf_decl_tag attributes set on maps but loadMaps is crashing if the ELF file has no BTF.

Fix this by checking if the BTF is there before querying it.

3f1a755 introduced the ability to read
btf_decl_tag attributes set on maps but `loadMaps` is crashing if the
ELF file has no BTF.

Fix this by checking if the BTF is there before querying it.

Signed-off-by: Paul Cacheux <paul.cacheux@datadoghq.com>
@paulcacheux paulcacheux requested a review from a team as a code owner June 19, 2025 19:27
Copy link
Collaborator

@lmb lmb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, how come you still have ELF without BTF?

@paulcacheux
Copy link
Contributor Author

paulcacheux commented Jun 20, 2025

Definitely not something we ship, just something that we run in our CI and that it seems is using some outdated build commands (that I will update)

@lmb lmb merged commit 51ab2a4 into cilium:main Jun 20, 2025
31 of 33 checks passed
@ti-mo
Copy link
Collaborator

ti-mo commented Jun 23, 2025

Thanks! I've created a follow-up to this: #1810.

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.

4 participants