Skip to content
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

bpf2go: bogus "type name is used multiple times" error #1638

Open
mejedi opened this issue Dec 25, 2024 · 0 comments
Open

bpf2go: bogus "type name is used multiple times" error #1638

mejedi opened this issue Dec 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mejedi
Copy link
Contributor

mejedi commented Dec 25, 2024

Describe the bug

When (redundant) -type T option refers to a type that is already exposed because a variable of T exists, a bogus "type name is used multiple times" error is reported.

How to reproduce

//go:build ignore
// x.c
struct S {} s;
$ bpf2go --type S --go-package eee x x.c
Error: can't write /home/nickz/cilium-ebpf.git/x_bpfel.go: type name "xS" is used multiple times

The error occurs because variable's type is a copy produced in loadDataSections. We end up with two distinct objects.

Version information

v0.17.1

@mejedi mejedi added the bug Something isn't working label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant