Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 809362 - dev-util/bpftrace-0.13.0-r1: Could not resolve symbol: /proc/self/exe:BEGIN_trigger
Summary: dev-util/bpftrace-0.13.0-r1: Could not resolve symbol: /proc/self/exe:BEGIN_t...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-21 09:00 UTC by WGH
Modified: 2021-11-07 20:59 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 WGH 2021-08-21 09:00:08 UTC
Built-in BEGIN bpftrace event is broken.

Reproducible: Always

Steps to Reproduce:
1. bpftrace -e 'BEGIN { @++ }'
Actual Results:  
Attaching 1 probe...
ERROR: Could not resolve symbol: /proc/self/exe:BEGIN_trigger


This is bug 754648 again, except RESTRICT=strip no longer helps for some reason. Maybe see bug 754648 comment 4
Comment 1 Marko Weber Bürgermeister 2021-10-31 10:12:00 UTC
(In reply to WGH from comment #0)
> Built-in BEGIN bpftrace event is broken.
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> 1. bpftrace -e 'BEGIN { @++ }'
> Actual Results:  
> Attaching 1 probe...
> ERROR: Could not resolve symbol: /proc/self/exe:BEGIN_trigger
> 
> 
> This is bug 754648 again, except RESTRICT=strip no longer helps for some
> reason. Maybe see bug 754648 comment 4

i can acknowledge this.
i recompiled kernel mutiple times with different debug settings.
i compiled bpftrace with -g with split with nosplit etc etc etc

bpftrace do not work on gentoo.

i always get = ERROR: Could not resolve symbol: /proc/self/exe:BEGIN_trigger

on debian i get same error.
BUT; after  "apt install bpftrace-debugsysmbols" it works !
Comment 2 Patrick McLean gentoo-dev 2021-11-01 17:23:49 UTC
Does this help (I haven't been able to reproduce this locally):

diff --git a/dev-util/bpftrace/bpftrace-0.14.0-r2.ebuild b/dev-util/bpftrace/bpftrace-0.14.0-r2.ebuild
index 483f341c490..579122a8090 100644
--- a/dev-util/bpftrace/bpftrace-0.14.0-r2.ebuild
+++ b/dev-util/bpftrace/bpftrace-0.14.0-r2.ebuild
@@ -94,5 +94,6 @@ src_configure() {

 src_install() {
        cmake_src_install
+       dostrip -x /usr/bin/bpftrace
        doman man/man8/*.?
 }
Comment 3 Larry the Git Cow gentoo-dev 2021-11-07 20:59:38 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e576dd19c0e1bdc56ad8e9f356490f456f8dc604

commit e576dd19c0e1bdc56ad8e9f356490f456f8dc604
Author:     Jakov Smolić <jsmolic@gentoo.org>
AuthorDate: 2021-11-07 20:58:15 +0000
Commit:     Jakov Smolić <jsmolic@gentoo.org>
CommitDate: 2021-11-07 20:58:39 +0000

    dev-util/bpftrace: Statically link (partially), avoid stripping bpftrace
    
    bpftrace is currently broken due to BEGIN_trigger symbol missing. To fix this,
    we need to avoid stripping the binary since it clearly needs to have
    symbols to work properly, and we also need to link some of the libraries
    statically into the binary, namely some internal libraries provided by
    bpftrace need to be statically linked, otherwise the binary will still
    end up missing the needed symbol (upstream issue -
    https://github.com/iovisor/bpftrace/issues/954). For previous versions
    it was enough to skip stripping the binary, but BEGIN_trigger symbol was
    moved to libbpftrace several versions ago, so even if it is present as
    a .so library the symbol won't be found.
    
    Closes: https://bugs.gentoo.org/809362
    Signed-off-by: Jakov Smolić <jsmolic@gentoo.org>

 dev-util/bpftrace/bpftrace-0.14.0-r3.ebuild | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)