RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2145105 - [bcctool] tcpdrop: Failed to attach BPF program b'trace_tcp_drop' to kprobe b'tcp_drop'
Summary: [bcctool] tcpdrop: Failed to attach BPF program b'trace_tcp_drop' to kprobe b...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: bcc
Version: 8.8
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jerome Marchand
QA Contact: Jon Trossbach
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-11-23 07:43 UTC by Zhiqian Guan
Modified: 2023-05-16 10:06 UTC (History)
4 users (show)

Fixed In Version: bcc-0.25.0-2.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-16 08:40:57 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-140263 0 None None None 2022-11-23 07:59:22 UTC
Red Hat Product Errata RHBA-2023:2879 0 None None None 2023-05-16 08:41:01 UTC

Description Zhiqian Guan 2022-11-23 07:43:57 UTC
Description of problem:
bcctool tcpdrop tool reported below error:

[root@netqe2 ~]# cd /usr/share/bcc/tools/
[root@netqe2 tools]# ./tcpdrop
cannot attach kprobe, probe entry may not exist
Traceback (most recent call last):
  File "./tcpdrop", line 200, in <module>
    b.attach_kprobe(event="tcp_drop", fn_name="trace_tcp_drop")
  File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 841, in attach_kprobe
    (fn_name, event))
Exception: Failed to attach BPF program b'trace_tcp_drop' to kprobe b'tcp_drop'
[root@netqe2 tools]# uname -r
4.18.0-438.el8.x86_64
[root@netqe2 tools]# rpm -q bcc
bcc-0.24.0-2.el8.x86_64

Version-Release number of selected component (if applicable):
4.18.0-438.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
1. install bcc tools
2. run tcpdrop
3.

Actual results:
fail to run

Expected results:
no error

Additional info:

Comment 1 Jerome Marchand 2022-11-30 16:14:12 UTC
(In reply to Zhiqian Guan from comment #0)
> Description of problem:
> bcctool tcpdrop tool reported below error:
> 
> [root@netqe2 ~]# cd /usr/share/bcc/tools/
> [root@netqe2 tools]# ./tcpdrop
> cannot attach kprobe, probe entry may not exist

As mention here, the probe entry does not exist. The reason being that the function has been inlined.

There has been some discussion about adding a tracepoint for dropped packets, but until this happens, there is no reliable way to trace that.

However, the error message could be improved to better inform the user. As a matter of fact, it has been done upstream and the fix will be brought by the next rebase. 

> Traceback (most recent call last):
>   File "./tcpdrop", line 200, in <module>
>     b.attach_kprobe(event="tcp_drop", fn_name="trace_tcp_drop")
>   File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 841, in
> attach_kprobe
>     (fn_name, event))
> Exception: Failed to attach BPF program b'trace_tcp_drop' to kprobe
> b'tcp_drop'
> [root@netqe2 tools]# uname -r
> 4.18.0-438.el8.x86_64
> [root@netqe2 tools]# rpm -q bcc
> bcc-0.24.0-2.el8.x86_64
> 
> Version-Release number of selected component (if applicable):
> 4.18.0-438.el8.x86_64
> 
> How reproducible:
> 100%
> 
> Steps to Reproduce:
> 1. install bcc tools
> 2. run tcpdrop
> 3.
> 
> Actual results:
> fail to run
> 
> Expected results:
> no error
> 
> Additional info:

Comment 3 Jon Trossbach 2023-01-08 19:54:35 UTC
Should this be moved to 9.0?

Comment 4 Jerome Marchand 2023-01-09 17:34:31 UTC
(In reply to Jerome Marchand from comment #1)
> (In reply to Zhiqian Guan from comment #0)
> > Description of problem:
> > bcctool tcpdrop tool reported below error:
> > 
> > [root@netqe2 ~]# cd /usr/share/bcc/tools/
> > [root@netqe2 tools]# ./tcpdrop
> > cannot attach kprobe, probe entry may not exist
> 
> As mention here, the probe entry does not exist. The reason being that the
> function has been inlined.
> 
> There has been some discussion about adding a tracepoint for dropped
> packets, but until this happens, there is no reliable way to trace that.
> 
> However, the error message could be improved to better inform the user. As a
> matter of fact, it has been done upstream and the fix will be brought by the
> next rebase. 
> 
> > Traceback (most recent call last):
> >   File "./tcpdrop", line 200, in <module>
> >     b.attach_kprobe(event="tcp_drop", fn_name="trace_tcp_drop")
> >   File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 841, in
> > attach_kprobe
> >     (fn_name, event))
> > Exception: Failed to attach BPF program b'trace_tcp_drop' to kprobe
> > b'tcp_drop'

My earlier assessment was wrong. The error message above is not the one from tcpdrop tool, but the generic bcc error message when trying to attach a non-existent kprobe.

As it turned out, on RHEL 8 kernel, get_kprobe_functions("tcp_drop") does not return None due to the presence of tcp_drop_reason and a bug in get_kprobe_functions().
I sent a pull request upstream:
https://github.com/iovisor/bcc/pull/4426


> > [root@netqe2 tools]# uname -r
> > 4.18.0-438.el8.x86_64
> > [root@netqe2 tools]# rpm -q bcc
> > bcc-0.24.0-2.el8.x86_64
> > 
> > Version-Release number of selected component (if applicable):
> > 4.18.0-438.el8.x86_64
> > 
> > How reproducible:
> > 100%
> > 
> > Steps to Reproduce:
> > 1. install bcc tools
> > 2. run tcpdrop
> > 3.
> > 
> > Actual results:
> > fail to run
> > 
> > Expected results:
> > no error
> > 
> > Additional info:

Comment 9 Jon Trossbach 2023-01-22 01:13:48 UTC
Per my email with Jerome on Jan 9, 2023:

Me:
>> Okay but I ran it against yesterday's 8.8 image and got the same error message as Zhiqian.
Jerome:
> Ah, indeed. Looks like there is another bug in bcc and it has to be
fixed upstream. Then yes, we have to move this bz to 8.9.

The same error message is still here. Do you not care an just want to push this through with same error message for 8.8?

[root@cloud-qe-01 tools]# uname -r
4.18.0-451.el8.x86_64
[root@cloud-qe-01 tools]# rpm -q bcc
bcc-0.24.0-2.el8.x86_64

[root@cloud-qe-01 ~]# cd /usr/share/bcc/tools/
[root@cloud-qe-01 tools]# ./tcpdrop
cannot attach kprobe, probe entry may not exist
Traceback (most recent call last):
  File "./tcpdrop", line 200, in <module>
    b.attach_kprobe(event="tcp_drop", fn_name="trace_tcp_drop")
  File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 841, in attach_kprobe
    (fn_name, event))
Exception: Failed to attach BPF program b'trace_tcp_drop' to kprobe b'tcp_drop'

Comment 10 Jerome Marchand 2023-01-23 08:31:07 UTC
(In reply to Jon Trossbach from comment #9)
> Per my email with Jerome on Jan 9, 2023:
> 
> Me:
> >> Okay but I ran it against yesterday's 8.8 image and got the same error message as Zhiqian.
> Jerome:
> > Ah, indeed. Looks like there is another bug in bcc and it has to be
> fixed upstream. Then yes, we have to move this bz to 8.9.
> 
> The same error message is still here. Do you not care an just want to push
> this through with same error message for 8.8?
> 
> [root@cloud-qe-01 tools]# uname -r
> 4.18.0-451.el8.x86_64
> [root@cloud-qe-01 tools]# rpm -q bcc
> bcc-0.24.0-2.el8.x86_64

That should be bcc-0.25.0-2.el8

> 
> [root@cloud-qe-01 ~]# cd /usr/share/bcc/tools/
> [root@cloud-qe-01 tools]# ./tcpdrop
> cannot attach kprobe, probe entry may not exist
> Traceback (most recent call last):
>   File "./tcpdrop", line 200, in <module>
>     b.attach_kprobe(event="tcp_drop", fn_name="trace_tcp_drop")
>   File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 841, in
> attach_kprobe
>     (fn_name, event))
> Exception: Failed to attach BPF program b'trace_tcp_drop' to kprobe
> b'tcp_drop'

Comment 11 Jon Trossbach 2023-01-23 18:41:33 UTC
Hey thanks!

I didn't catch the bcc-0.25.0-2.el8 repo in brew earlier.

Jerome had to point me to it:
> there is also some automation that create a repo for all
brew build on RHEL. You can add the repo to /etc/yum.repos.d/:
http://brew-task-repos.usersys.redhat.com/repos/official/bcc/0.25.0/2.el8/bcc-0.25.0-2.el8.repo

I'll know where to look next time.


Results, they look good:

[root@netqe4 ~]# cd /usr/share/bcc/tools/
[root@netqe4 tools]# ./tcpdrop
WARNING: tcp_drop() kernel function not found or traceable. Use tracpoint:skb:kfree_skb instead.
TIME     PID     IP SADDR:SPORT          > DADDR:DPORT          STATE (FLAGS)

^C[root@netqe4 tools]# uname -r
4.18.0-451.el8.x86_64
[root@netqe4 tools]# rpm -q bcc
bcc-0.25.0-2.el8.x86_64

Pre-verification complete.

Comment 14 Jon Trossbach 2023-01-24 19:31:31 UTC
Looks good moving to verified.

[root@dell-per730-01 ~]# cd /usr/share/bcc/tools/
[root@dell-per730-01 tools]# ./tcpdrop 
WARNING: tcp_drop() kernel function not found or traceable. Use tracpoint:skb:kfree_skb instead.
TIME     PID     IP SADDR:SPORT          > DADDR:DPORT          STATE (FLAGS)

^C[root@dell-per730-01 tools]# uname -r
4.18.0-451.el8.x86_64
[root@dell-per730-01 tools]# rpm -q bcc
bcc-0.25.0-2.el8.x86_64

Comment 17 errata-xmlrpc 2023-05-16 08:40:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (bcc bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2879


Note You need to log in before you can comment on or make changes to this bug.