Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-8674

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

    • bcc-0.28.0-3.el9
    • sst_kernel_tps
    • ssg_core_kernel
    • 14
    • 19
    • None
    • False
    • Hide

      None

      Show
      None
    • No
    • None
    • If docs needed, set a value
    • None

      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:

            jmarchan@redhat.com Jerome Marchand
            amorenoz@redhat.com Adrian Moreno
            Jerome Marchand Jerome Marchand
            Ziqian (Zamir) SUN Ziqian (Zamir) SUN
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: