bpftrace-0.15.0-r1 declares that it runs with LLVM-15, but does not: $bpftrace -e 'tracepoint:raw_syscalls:sys_enter { @[comm] = count(); }' bpftrace: /usr/lib/llvm/15/include/llvm/IR/Type.h:389: llvm::Type* llvm::Type::getNonOpaquePointerElementType() const: Assertion `NumContainedTys && "Attempting to get element type of opaque pointer"' failed. zsh: IOT instruction bpftrace -e 'tracepoint:raw_syscalls:sys_enter { @[comm] = count(); }' Lowering to 14 makes it work: Reproducible: Always Steps to Reproduce: 1. emerge bpftrace-0.15.0-r1 with llvm-15 2. run a probe 3. failure In theory it *should* work since commit https://github.com/iovisor/bpftrace/commit/f94e0188ace7fe999f5032e6bbf696b5078f6918 is in 0.15.0, but apparently it does not.
Forgot to add "lowering to 14 makes it work:" $bpftrace -e 'tracepoint:raw_syscalls:sys_enter { @[comm] = count(); }' Attaching 1 probe... ^C @[rpcbind]: 1 @[X:gdrv0]: 2 @[kded5]: 3 @[gpg-agent]: 3 @[kiod5]: 3 @[kwalletd5]: 3 @[C2 CompilerThre]: 3 @[C1 CompilerThre]: 3 @[kglobalaccel5]: 3 @[init]: 4 @[gmain]: 4 ..
Btw I think 0.16 suffers from the same problem since it also warns about this: /tmp/bpftrace/src/ast/passes/codegen_llvm.cpp:1272:71: warning: 'llvm::Type* llvm::Type::getPointerElementType() const' is deprecated: Deprecated without replacement, see https://llvm.org/docs/OpaquePointers.html for context and migration instructions [-Wdeprecated-declarations]
Just in time someone made a PR with a workaround fix for llvm-15: https://github.com/iovisor/bpftrace/pull/2367 The 3-line fix in that PR seems to do the trick, so with that applied we can keep -15 as upper version bound.
I've also taken the liberty to unkeyword 0.16.0 in the PR because that stuff doesn't even properly build upstream.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d4bcc14d16dfcab91d9bdce6fb920ec95511da4 commit 4d4bcc14d16dfcab91d9bdce6fb920ec95511da4 Author: Holger Hoffstätte <holger@applied-asynchrony.com> AuthorDate: 2022-09-26 08:51:49 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-09-27 21:41:35 +0000 dev-util/bpftrace: add fix to work properly with LLVM-15 Closes: https://bugs.gentoo.org/872842 Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com> Signed-off-by: Sam James <sam@gentoo.org> ...-0.15.0-r1.ebuild => bpftrace-0.15.0-r2.ebuild} | 1 + .../files/bpftrace-0.15.0-llvm-15-pointers.patch | 30 ++++++++++++++++++++++ 2 files changed, 31 insertions(+)