Bug 2232542

Summary: [bcc] Type: 'unsigned char[256]' not recognized. Please define the data with ctypes manually.
Product: Red Hat Enterprise Linux 9 Reporter: Adrián Moreno <amorenoz>
Component: bccAssignee: Jerome Marchand <jmarchan>
Status: CLOSED MIGRATED QA Contact: Ziqian SUN (Zamir) <zsun>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: ctrautma, echaudro, jmarchan, ldoskova, ralongi, rdossant, tredaelli
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-25 17:10:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Adrián Moreno 2023-08-17 10:11:38 UTC
Description of problem:

When you build a program using bcc's automatic C types binding that contains a simple type such as "unsigned char[256]" a runtime error is triggered:

"""
Type: 'unsigned char[256]' not recognized. Please define the data with ctypes manually.

Exception ignored on calling ctypes callback function: <function RingBuf.open_ring_buffer.<locals>.ringbuf_cb_ at 0x7ff64df49940>
"""

I tracked the error to be a regression introduced in 0.24 by:

ca1d3fd0 bcc: Fix array type handling due to llvm changes

I also fixed the issue upstream with:

8f8e9a2c bcc: Fix multi-word array type handling (#4412)

However, we (OVS team) ship some BCC scripts for rhel-9 as part of openvswitch3.1-test package which are affected by this.
So this is a request to z-stream the fix to the relevant rhel-9 versions.

Version-Release number of selected component (if applicable):

From 0.24 up to 0.26 both included.

How reproducible:

100%

Steps to Reproduce:
1. Run a BCC program with "unsigned char []" as a Ctype that is shared between ebpf and userspace, e.g: https://github.com/openvswitch/ovs/blob/master/utilities/usdt-scripts/upcall_cost.py


Actual results:

An exception is thrown:
"""
Type: 'unsigned char[256]' not recognized. Please define the data with ctypes manually.

Exception ignored on calling ctypes callback function: <function RingBuf.open_ring_buffer.<locals>.ringbuf_cb_ at 0x7ff64df49940>
"""

Expected results:

No exception should be thrown.

Additional info:

Comment 1 Adrián Moreno 2023-08-17 12:30:19 UTC
I think we also need this in rhel8. Just checked and it ships with bcc 0.25 which is also affected.

Comment 2 RHEL Program Management 2023-09-25 16:52:34 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 3 RHEL Program Management 2023-09-25 17:10:41 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.