Bug 1898360 - systemtap kernel module doesn't compile with current f33 kernel
Summary: systemtap kernel module doesn't compile with current f33 kernel
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemtap
Version: 33
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Frank Ch. Eigler
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-16 20:50 UTC by Ken Raeburn
Modified: 2020-11-18 23:24 UTC (History)
10 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-11-18 23:24:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ken Raeburn 2020-11-16 20:50:55 UTC
Description of problem:
systemtap creates kernel modules that are not compatible with the latest kernel headers distributed

Version-Release number of selected component (if applicable):
4.4-0.20200805git82b8e1a07.fc33

How reproducible:
100%

Steps to Reproduce:
1. Set up a machine with current Fedora 33 software including systemtap. I used vagrant with a simple config file (comments and blank lines removed):
    Vagrant.configure("2") do |config|
      config.vm.box = "fedora/33-cloud-base"
      config.vm.provider "libvirt" do |v|
        v.memory = 2048
        v.cpus = 4
      end
      config.vm.provision "shell", inline: <<-END
        dnf install -y systemtap
        dnf upgrade -y
      END
    end
"vagrant up" to set up the VM (I got box version v33.20201019.0 downloaded), then "vagrant reload" to restart using the newly updated kernel.
2. Run a simple stap test: "stap -e 'probe begin { print("hi\n"); exit(); }'"

Actual results:
In file included from /usr/share/systemtap/runtime/linux/runtime.h:234,
                 from /usr/share/systemtap/runtime/runtime.h:26,
                 from /tmp/stapa8JzLf/stap_94e89f92720b927faef3d2f94f2e4bc2_1002_src.c:21:
/usr/share/systemtap/runtime/linux/access_process_vm.h: In function ‘__access_process_vm_’:
/usr/share/systemtap/runtime/linux/access_process_vm.h:52:36: error: passing argument 1 of ‘get_user_pages_remote’ from incompatible pointer type [-Werror=incompatible-pointer-types]
   52 |       ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma);
      |                                    ^~~
      |                                    |
      |                                    struct task_struct *
In file included from ./include/linux/kallsyms.h:12,
                 from ./include/linux/ftrace.h:11,
                 from ./include/linux/kprobes.h:29,
                 from /usr/share/systemtap/runtime/linux/runtime.h:21,
                 from /usr/share/systemtap/runtime/runtime.h:26,
                 from /tmp/stapa8JzLf/stap_94e89f92720b927faef3d2f94f2e4bc2_1002_src.c:21:
./include/linux/mm.h:1714:46: note: expected ‘struct mm_struct *’ but argument is of type ‘struct task_struct *’
 1714 | long get_user_pages_remote(struct mm_struct *mm,
      |                            ~~~~~~~~~~~~~~~~~~^~
In file included from /usr/share/systemtap/runtime/linux/runtime.h:234,
                 from /usr/share/systemtap/runtime/runtime.h:26,
                 from /tmp/stapa8JzLf/stap_94e89f92720b927faef3d2f94f2e4bc2_1002_src.c:21:
/usr/share/systemtap/runtime/linux/access_process_vm.h:52:41: error: passing argument 2 of ‘get_user_pages_remote’ makes integer from pointer without a cast [-Werror=int-conversion]
   52 |       ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma);
      |                                         ^~
      |                                         |
      |                                         struct mm_struct *
In file included from ./include/linux/kallsyms.h:12,
                 from ./include/linux/ftrace.h:11,
                 from ./include/linux/kprobes.h:29,
                 from /usr/share/systemtap/runtime/linux/runtime.h:21,
                 from /usr/share/systemtap/runtime/runtime.h:26,
                 from /tmp/stapa8JzLf/stap_94e89f92720b927faef3d2f94f2e4bc2_1002_src.c:21:
./include/linux/mm.h:1715:22: note: expected ‘long unsigned int’ but argument is of type ‘struct mm_struct *’
 1715 |        unsigned long start, unsigned long nr_pages,
      |        ~~~~~~~~~~~~~~^~~~~
In file included from /usr/share/systemtap/runtime/linux/runtime.h:234,
                 from /usr/share/systemtap/runtime/runtime.h:26,
                 from /tmp/stapa8JzLf/stap_94e89f92720b927faef3d2f94f2e4bc2_1002_src.c:21:
/usr/share/systemtap/runtime/linux/access_process_vm.h:52:54: error: passing argument 5 of ‘get_user_pages_remote’ makes pointer from integer without a cast [-Werror=int-conversion]
   52 |       ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma);
      |                                                      ^~~~~
      |                                                      |
      |                                                      int
In file included from ./include/linux/kallsyms.h:12,
                 from ./include/linux/ftrace.h:11,
                 from ./include/linux/kprobes.h:29,
                 from /usr/share/systemtap/runtime/linux/runtime.h:21,
                 from /usr/share/systemtap/runtime/runtime.h:26,
                 from /tmp/stapa8JzLf/stap_94e89f92720b927faef3d2f94f2e4bc2_1002_src.c:21:
./include/linux/mm.h:1716:46: note: expected ‘struct page **’ but argument is of type ‘int’
 1716 |        unsigned int gup_flags, struct page **pages,
      |                                ~~~~~~~~~~~~~~^~~~~
In file included from /usr/share/systemtap/runtime/linux/runtime.h:234,
                 from /usr/share/systemtap/runtime/runtime.h:26,
                 from /tmp/stapa8JzLf/stap_94e89f92720b927faef3d2f94f2e4bc2_1002_src.c:21:
/usr/share/systemtap/runtime/linux/access_process_vm.h:52:61: error: passing argument 6 of ‘get_user_pages_remote’ makes pointer from integer without a cast [-Werror=int-conversion]
   52 |       ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma);
      |                                                             ^
      |                                                             |
      |                                                             int
In file included from ./include/linux/kallsyms.h:12,
                 from ./include/linux/ftrace.h:11,
                 from ./include/linux/kprobes.h:29,
                 from /usr/share/systemtap/runtime/linux/runtime.h:21,
                 from /usr/share/systemtap/runtime/runtime.h:26,
                 from /tmp/stapa8JzLf/stap_94e89f92720b927faef3d2f94f2e4bc2_1002_src.c:21:
./include/linux/mm.h:1717:32: note: expected ‘struct vm_area_struct **’ but argument is of type ‘int’
 1717 |        struct vm_area_struct **vmas, int *locked);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~
In file included from /usr/share/systemtap/runtime/linux/runtime.h:234,
                 from /usr/share/systemtap/runtime/runtime.h:26,
                 from /tmp/stapa8JzLf/stap_94e89f92720b927faef3d2f94f2e4bc2_1002_src.c:21:
/usr/share/systemtap/runtime/linux/access_process_vm.h:52:64: error: passing argument 7 of ‘get_user_pages_remote’ from incompatible pointer type [-Werror=incompatible-pointer-types]
   52 |    ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma);
      |                                                             ^~~~~
      |                                                             |
      |                                                             struct page **

In file included from ./include/linux/kallsyms.h:12,
                 from ./include/linux/ftrace.h:11,
                 from ./include/linux/kprobes.h:29,
                 from /usr/share/systemtap/runtime/linux/runtime.h:21,
                 from /usr/share/systemtap/runtime/runtime.h:26,
                 from /tmp/stapa8JzLf/stap_94e89f92720b927faef3d2f94f2e4bc2_1002_src.c:21:
./include/linux/mm.h:1717:43: note: expected ‘int *’ but argument is of type ‘struct page **’
 1717 |        struct vm_area_struct **vmas, int *locked);
      |                                      ~~~~~^~~~~~
In file included from /usr/share/systemtap/runtime/linux/runtime.h:234,
                 from /usr/share/systemtap/runtime/runtime.h:26,
                 from /tmp/stapa8JzLf/stap_94e89f92720b927faef3d2f94f2e4bc2_1002_src.c:21:
/usr/share/systemtap/runtime/linux/access_process_vm.h:52:13: error: too many arguments to function ‘get_user_pages_remote’
   52 |       ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma);
      |             ^~~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/kallsyms.h:12,
                 from ./include/linux/ftrace.h:11,
                 from ./include/linux/kprobes.h:29,
                 from /usr/share/systemtap/runtime/linux/runtime.h:21,
                 from /usr/share/systemtap/runtime/runtime.h:26,
                 from /tmp/stapa8JzLf/stap_94e89f92720b927faef3d2f94f2e4bc2_1002_src.c:21:
./include/linux/mm.h:1714:6: note: declared here
 1714 | long get_user_pages_remote(struct mm_struct *mm,
      |      ^~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.build:283: /tmp/stapa8JzLf/stap_94e89f92720b927faef3d2f94f2e4bc2_1002_src.o] Error 1
make: *** [Makefile:1784: /tmp/stapa8JzLf] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed.  [man error::pass4]


Expected results:
Prints message "hi" and exits

Additional info:
[vagrant@localhost ~]$ stap --version 
Systemtap translator/driver (version 4.4/0.182/0.180, rpm 4.4-0.20200805git82b8e1a07.fc33)
Copyright (C) 2005-2020 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
tested kernel versions: 2.6.32 ... 5.7.0
enabled features: AVAHI BOOST_STRING_REF DYNINST BPF JAVA PYTHON3 LIBRPM LIBSQLITE3 LIBVIRT LIBXML2 NLS NSS READLINE MONITOR_LIBS
[vagrant@localhost ~]$ uname -a
Linux localhost.localdomain 5.9.8-200.fc33.x86_64 #1 SMP Tue Nov 10 21:58:19 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[vagrant@localhost ~]$

Comment 1 Frank Ch. Eigler 2020-11-16 22:31:57 UTC
Please test out the 4.4-1 build from a week or two ago.  It's probably still in the -testing repo.

Comment 2 Andy Walsh 2020-11-18 23:17:21 UTC
I mentioned in the koji build [0], but will also report here that the updated build (4.4-1) works with Fedora 33 on kernel 5.9.8-200.fc33.

[vagrant@localhost ~]$ uname -r
5.9.8-200.fc33.x86_64
[vagrant@localhost ~]$ rpm -qa systemtap
systemtap-4.4-1.fc33.x86_64
[vagrant@localhost ~]$ sudo stap -e 'probe begin { print("hi\n"); exit(); }'
hi

[0] https://bodhi.fedoraproject.org/updates/FEDORA-2020-62d62d2302

Comment 3 Frank Ch. Eigler 2020-11-18 23:24:32 UTC
thanks very much for testing!


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