Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 872842 - dev-util/bpftrace-0.15.0-r1: allows LLVM_MAX_SLOT=15 but only works with <=14
Summary: dev-util/bpftrace-0.15.0-r1: allows LLVM_MAX_SLOT=15 but only works with <=14
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux bug wranglers
URL: https://github.com/iovisor/bpftrace/i...
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2022-09-25 17:23 UTC by Holger Hoffstätte
Modified: 2022-09-27 21:41 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Hoffstätte 2022-09-25 17:23:12 UTC
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.
Comment 1 Holger Hoffstätte 2022-09-25 17:24:24 UTC
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
..
Comment 2 Holger Hoffstätte 2022-09-25 17:31:44 UTC
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]
Comment 3 Holger Hoffstätte 2022-09-26 07:28:14 UTC
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.
Comment 4 Holger Hoffstätte 2022-09-26 09:01:55 UTC
I've also taken the liberty to unkeyword 0.16.0 in the PR because that stuff doesn't even properly build upstream.
Comment 5 Larry the Git Cow gentoo-dev 2022-09-27 21:41:45 UTC
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(+)