FS#75718 - [bpftrace] 0.15.0-2 segfaults with bcc 0.25.0-1

Attached to Project: Community Packages
Opened by Fotis Xenakis (foxen) - Sunday, 28 August 2022, 16:31 GMT
Last edited by Anatol Pomozov (anatolik) - Monday, 29 August 2022, 18:56 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Anatol Pomozov (anatolik)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
bpftrace segfaults at startup when running any program. This is due to incompatibility with bcc 0.25.0-1 (libbcc_bpf.so). Presumably, bpftrace was built against bcc 0.24.0, but not updated when bcc was updated to 0.25.0 (bpftrace 0.15.0 fails to build with bcc 0.25.0, so I guess the package should require bcc 0.24.0?).

Stack trace attached (segfault due to wrong arguments to bcc_prog_load_xattr from libbcc_bpf.so)


Additional info:
- bpftrace 0.15.0-2
- bcc 0.25.0-1
- bcc commit introducing incompatibility (introduced in 0.25.0): https://github.com/iovisor/bcc/commit/185143bdec6134255363446f644acd766ffb3825
- bpftrace commit updating for it (in master, unreleased): https://github.com/iovisor/bpftrace/commit/fc940d31be140d54ceb4c7ae47371785f0b26b65


Steps to reproduce:
Run any program with bpftrace, e.g.
# bpftrace -e 'BEGIN { printf("Hello, world\n"); }'
This task depends upon

Closed by  Anatol Pomozov (anatolik)
Monday, 29 August 2022, 18:56 GMT
Reason for closing:  Fixed
Additional comments about closing:  bpftrace-0.15.0-3
Comment by Anatol Pomozov (anatolik) - Monday, 29 August 2022, 16:46 GMT
Thanks for the report. I confirm this issue.

I am looking at a way to get bpftrace patched against bcc 0.25, Upstream `master` branch fixed this compilation issue but it looks like backporting it to 0.25 is non-trivial. github user @martinetd provided a patch for 0.25, see https://github.com/iovisor/bpftrace/issues/2340
Comment by Anatol Pomozov (anatolik) - Monday, 29 August 2022, 17:14 GMT
Please try bpftrace-0.15.0-3 that should work with bcc-0.25 now:


```
sudo bpftrace -e 'BEGIN { printf("Hello, world\n"); }'
Attaching 1 probe...
Hello, world
```
Comment by Fotis Xenakis (foxen) - Monday, 29 August 2022, 18:04 GMT
Works great, thank you for taking care of this!

Loading...