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

Failure to build 0.27.0 (issues with gobpf/bcc) #2113

Closed
daurnimator opened this issue Sep 5, 2022 · 5 comments
Closed

Failure to build 0.27.0 (issues with gobpf/bcc) #2113

daurnimator opened this issue Sep 5, 2022 · 5 comments
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Milestone

Comments

@daurnimator
Copy link

# github.com/iovisor/gobpf/bcc
/build/go/pkg/mod/github.com/iovisor/gobpf@v0.2.0/bcc/module.go:230:132: not enough arguments in call to (_C2func_bcc_func_load)
	have (unsafe.Pointer, _Ctype_int, *_Ctype_char, *_Ctype_struct_bpf_insn, _Ctype_int, *_Ctype_char, _Ctype_uint, _Ctype_int, *_Ctype_char, _Ctype_uint, nil)
	want (unsafe.Pointer, _Ctype_int, *_Ctype_char, *_Ctype_struct_bpf_insn, _Ctype_int, *_Ctype_char, _Ctype_uint, _Ctype_int, *_Ctype_char, _Ctype_uint, *_Ctype_char, _Ctype_int)
$ pacman -Q libbcc
bcc 0.25.0-1

Upstream issue: iovisor/gobpf#314

@tpaschalis
Copy link
Member

Hey there, thanks for the report. This seems to be another case of gobpf not yet being updated to match a recent bcc version; these new arguments were introduced in 1 and 2 which were part of v0.25. We'll be keeping an eye out on the upstream issue.

For the time being, you could either use the -tags noebpf flag to opt-out of building the ebpf_exporter on your system, or (if possible) downgrade to an older bcc version. Our build pipeline just installs libbpfcc-dev using apt and it seems to be working; are you installing bcc from source using a more recent version?

@daurnimator
Copy link
Author

For the time being, you could either use the -tags noebpf flag to opt-out of building the ebpf_exporter on your system, or (if possible) downgrade to an older bcc version. Our build pipeline just installs libbpfcc-dev using apt and it seems to be working; are you installing bcc from source using a more recent version?

I am packaging grafana-agent for ArchLinux. We could disable ebpf, but anyone using that would suddenly either get errors, or have missing metrics.
We would not downgrade libbpfcc for all ArchLinux users for this issue.

@tpaschalis
Copy link
Member

tpaschalis commented Sep 6, 2022

Oh, I see, thanks for your efforts!

The issue is that the gobpf library needs to match the exact bcc version, that's why they also suggest pinning the gobpf version to follow a single bcc release. Let's see if the upstream issue gains any traction; even then I would be hesitant to upgrade since it would be breaking for other users as well.

We're looking into a couple of alternatives for making working with bcc easier. In the meantime, while not ideal, disabling the integration could be a decent tradeoff.

Users wouldn't get errors, just missing metrics and a "the ebpf integration is not available; enabling it will do nothing" log line; maybe we should make a better job at letting them understand they'd have to go about building the Agent themselves with the matching bcc version if they want to use this specific integration.

@martinetd
Copy link

martinetd commented Sep 7, 2022

@tpaschalis the patch suggested in iovisor/gobpf#311 will keep working with older bcc versions as well, just keep using the latest gobpf.
For this case it's really just the new bcc release that changed its API without much warning, so the rest of the ecosystem needs a bit of time to catch up...

@rfratto rfratto added this to the v0.30.0 milestone Nov 3, 2022
@tpaschalis
Copy link
Member

I'm closing this as wontfix. For now we have removed the problematic bundled ebpf_exporter that was using gobpf/bcc.

If we bring this back, we should look into either using cloudflare/ebpf_exporter's release v2.0 which moves away from BCC or something based on cilium's go-ebpf to avoid such issues with static linking.

@tpaschalis tpaschalis closed this as not planned Won't fix, can't repro, duplicate, stale Dec 14, 2022
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Feb 22, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
No open projects
Development

No branches or pull requests

4 participants