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

[systemtap] /usr/bin/stap provided by two packages, but fails if systemtap-devel not installed

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Normal Normal
    • None
    • rhel-9.5
    • systemtap
    • None
    • Low
    • Upstream
    • rhel-sst-pt-perf-debug
    • ssg_platform_tools
    • 2
    • False
    • Hide

      None

      Show
      None
    • No
    • None
    • None
    • None
    • Unspecified Release Note Type - Unknown
    • All
    • None

      What were you trying to do that didn't work?

      I was trying to help QE test if we had fixed a bug in qemu-trace-stap, which calls stap under the hood.  In the process, we discovered that the systemtap packaging is wonky.  At this point, it's no longer an issue in qemu-trace-stap, but something that is worth the systemtap team deciding whether to improve.

      Please provide the package NVR for which bug is seen:

      I reproduced this on Fedora 40, but suspect the same issues will be seen in RHEL 9.5 unless changes are made.

      systemtap-client-5.1-1.fc40.x86_64

      How reproducible:

      100%

      Steps to reproduce

      1. dnf install qemu-tools '*/bin/stap'
      2. notice that systemtap-client is now installed, but not systemtap-devel
      3. qemu-trace-stap run `which qemu-kvm` 'nbd_send*'
      4. dnf install -y systemtap-devel
      5. rpm -qf /usr/bin/stap

      Expected results

      If stap requires headers to be installed to work, then installing the binary should pull in those headers by dependency, rather than by manual action. Also, it is unusual to have multiple RPMs claim the same binary.

      Actual results

      after step 3, I get an error:/tmp/stapxUvHmF/stap_10b3cca198cbae600b4323c636f811a3_5442_src.c:12:10: fatal error: runtime_defines.h: No such file or directory
         12 | #include "runtime_defines.h"
            |          ^~~~~~~~~~~~~~~~~~~
      compilation terminated.
      make[1]: *** [scripts/Makefile.build:244: /tmp/stapxUvHmF/stap_10b3cca198cbae600b4323c636f811a3_5442_src.o] Error 1
      make[1]: *** Waiting for unfinished jobs....
      /tmp/stapxUvHmF/stap_symbols.c:3:10: fatal error: sym.h: No such file or directory
          3 | #include <sym.h>
            |          ^~~~~~~
      compilation terminated.
      make[1]: *** [scripts/Makefile.build:244: /tmp/stapxUvHmF/stap_symbols.o] Error 1
      make: *** [Makefile:1930: /tmp/stapxUvHmF] Error 2
      WARNING: kbuild exited with status: 2
      Pass 4: compilation failed.  [man error::pass4]
      Kernel version 6.9.5 is outside tested range 2.6.32 ... 6.9-rc0

      after step 4, repeating step 3 works as desired.

      after step 5, I see that the binary is claimed by two RPMs, which is unusual:

      systemtap-client-5.1-1.fc40.x86_64
      systemtap-devel-5.1-1.fc40.x86_64

            [RHEL-47342] [systemtap] /usr/bin/stap provided by two packages, but fails if systemtap-devel not installed

            New upstream description text for -client:

            This package contains/requires only the components needed to
            use systemtap scripts by compiling them using a local or a remote
            systemtap-server service, then run them using a local or
            remote systemtap-runtime.  It includes script samples and
            documentation, and a copy of the tapset library for reference.
            It does NOT include all the components for running a systemtap
            script in a self-contained fashion; for that, use the -devel
            subpackage instead.

            Frank Eigler added a comment - New upstream description text for -client: This package contains/requires only the components needed to use systemtap scripts by compiling them using a local or a remote systemtap-server service, then run them using a local or remote systemtap-runtime.  It includes script samples and documentation, and a copy of the tapset library for reference. It does NOT include all the components for running a systemtap script in a self-contained fashion; for that, use the -devel subpackage instead.

            systemtap-client is meant for use with a local or remote systemtap-server (thus the name).  In that configuration, it does not need the headers etc., because it uploads systemtap scripts to the server for compilation. The error is in not having a server around.  It's not clear how at the RPM dependency level, the -client RPM can do anything about that.  I'll tweak the subrpm description to make this clear.

            In the mean time, your testing will want to switch to systemtap-devel.

            Frank Eigler added a comment - systemtap-client is meant for use with a local or remote systemtap-server (thus the name).  In that configuration, it does not need the headers etc., because it uploads systemtap scripts to the server for compilation. The error is in not having a server around.  It's not clear how at the RPM dependency level, the -client RPM can do anything about that.  I'll tweak the subrpm description to make this clear. In the mean time, your testing will want to switch to systemtap-devel.

            An "rpm -qi of systemtap-client rpm says:

            Description :
            This package contains/requires the components needed to develop
            systemtap scripts, and compile them using a local systemtap-devel
            or a remote systemtap-server installation, then run them using a
            local or remote systemtap-runtime.  It includes script samples and
            documentation, and a copy of the tapset library for reference.

            The files mentioned as missing are in /usr/share/systemtap/runtime and
            are a part of systemtap-devel.  That seems to indicate that it would a
            dependency on systemtap-devel.  systemtap-client doesn't have a
            dependency on systemtap-devel to allow smaller installation to use
            --use-server option and not install all the other dependencies of
            systemtap-devel on the machine.  Seems like stap command could do some
            check to determine whether only --user-server would work and mention
            either use --user-server option or install systemtap-devel package.

            William Cohen added a comment - An "rpm -qi of systemtap-client rpm says: Description : This package contains/requires the components needed to develop systemtap scripts, and compile them using a local systemtap-devel or a remote systemtap-server installation, then run them using a local or remote systemtap-runtime.  It includes script samples and documentation, and a copy of the tapset library for reference. The files mentioned as missing are in /usr/share/systemtap/runtime and are a part of systemtap-devel.  That seems to indicate that it would a dependency on systemtap-devel.  systemtap-client doesn't have a dependency on systemtap-devel to allow smaller installation to use --use-server option and not install all the other dependencies of systemtap-devel on the machine.  Seems like stap command could do some check to determine whether only --user-server would work and mention either use --user-server option or install systemtap-devel package.

              rhtorsys Frank Eigler
              eblake_redhat Eric Blake
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: