[Bug runtime/30123] New: bitfield.exp fails with fresh kernels

mcermak at redhat dot com sourceware-bugzilla@sourceware.org
Tue Feb 14 14:01:04 GMT 2023


https://sourceware.org/bugzilla/show_bug.cgi?id=30123

            Bug ID: 30123
           Summary: bitfield.exp fails with fresh kernels
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
          Assignee: systemtap at sourceware dot org
          Reporter: mcermak at redhat dot com
  Target Milestone: ---

With Rawhide or recent RHEL9, the bitfield.exp testcase fails.  The problem
seems to be with @cast().  To demonstrate it, let's have the following code
snippet:

=======8<=======
%{
#include <linux/tcp.h>
static struct tcphdr foo = {0};
%}

function get_ptr:long() %{ STAP_RETVALUE = (long)&foo; /* pure */ %}


probe begin {
    ptr = get_ptr()

    # setter1 (seems to work)
    %{ foo.ack = 1 %}

    # setter2 (doesn't seem to work)
    # @cast(ptr, "tcphdr", "kernel<linux/tcp.h>")->ack = 1

    # printer1 (seems to work)
    println(%{ foo.ack %})

    # printer2 (doesn't seem to work)
    println(@cast(ptr, "tcphdr", "kernel<linux/tcp.h>")->ack)

    exit()
}
=======8<=======

A success is to write 1 to foo->ack and then read/print it.  When embedded C is
used, things work fine.  Using @cast() however, the experiment fails both to
write the data, and to read it.  Tested with 6.2.0-0.rc8.57.fc39 and
5.14.0-252.el9.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Systemtap mailing list