Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 2243335 - Systemtap compile error
Summary: Systemtap compile error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: systemtap
Version: 38
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Frank Ch. Eigler
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-10-11 18:59 UTC by Chung
Modified: 2023-11-03 18:35 UTC (History)
6 users (show)

Fixed In Version: systemtap-5.0~pre16958465gca71442b-1.fc38 systemtap-5.0~pre16958465gca71442b-1.fc39
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-10-20 00:41:53 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Chung 2023-10-11 18:59:44 UTC
stap fails to compile simple stp file.

Reproducible: Always

Steps to Reproduce:
1.Create the following stp file

cat > simple-test.stp 
# Script to test basic System Tap functionality.

global tickCounter = 0;
global vmallocCounter = 0;

function sayHello()
%{
    printk("systemtap script says hello\n");
%}

probe begin
{
    sayHello();
    printf("hello\n");
}

probe timer.ms(100)
{
    tickCounter++;
}

function sayGoodbye()
%{
    printk("systemtap script says goodbye\n");
%}

// Force use of some basic debug info.
probe kernel.function("vmalloc")
{
    vmallocCounter++;
}

probe end
{
    sayGoodbye();
    printf("counter = %d\nvmalloc = %d\nbye!\n", tickCounter, vmallocCounter);
}

2. stap -v -F -g --disable-cache ./simple-test.stp 

3.  
#  stap -v -F -g --disable-cache ./simple-test.stp 
Pass 1: parsed user script and 486 library scripts using 136468virt/107716res/15616shr/91400data kb, in 160usr/50sys/444real ms.
Pass 2: analyzed script: 4 probes, 2 functions, 0 embeds, 2 globals using 301204virt/203272res/20968shr/190432data kb, in 4390usr/610sys/51571real ms.
Pass 3: translated to C into "/tmp/stap07SM83/stap_1345_src.c" using 301220virt/203444res/21140shr/190448data kb, in 100usr/70sys/177real ms.
In file included from /usr/share/systemtap/runtime/linux/runtime.h:266,
                 from /usr/share/systemtap/runtime/runtime.h:26,
                 from /tmp/stap07SM83/stap_1345_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:57:36: error: passing argument 1 of ‘get_user_pages_remote’ from incompatible pointer type [-Werror=incompatible-pointer-types]
   57 |       ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma);
      |                                    ^~~
      |                                    |
      |                                    struct task_struct *
In file included from ./include/linux/kallsyms.h:13,
                 from ./include/linux/ftrace.h:13,
                 from ./include/linux/kprobes.h:28,
                 from /usr/share/systemtap/runtime/linux/runtime.h:21:
./include/linux/mm.h:2397:46: note: expected ‘struct mm_struct *’ but argument is of type ‘struct task_struct *’
 2397 | long get_user_pages_remote(struct mm_struct *mm,
      |                            ~~~~~~~~~~~~~~~~~~^~
/usr/share/systemtap/runtime/linux/access_process_vm.h:57:41: error: passing argument 2 of ‘get_user_pages_remote’ makes integer from pointer without a cast [-Werror=int-conversion]
   57 |       ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma);
      |                                         ^~
      |                                         |
      |                                         struct mm_struct *
./include/linux/mm.h:2398:42: note: expected ‘long unsigned int’ but argument is of type ‘struct mm_struct *’
 2398 |                            unsigned long start, unsigned long nr_pages,
      |                            ~~~~~~~~~~~~~~^~~~~
/usr/share/systemtap/runtime/linux/access_process_vm.h:57:54: error: passing argument 5 of ‘get_user_pages_remote’ makes pointer from integer without a cast [-Werror=int-conversion]
   57 |       ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma);
      |                                                      ^~~~~
      |                                                      |
      |                                                      int
./include/linux/mm.h:2399:66: note: expected ‘struct page **’ but argument is of type ‘int’
 2399 |                            unsigned int gup_flags, struct page **pages,
      |                                                    ~~~~~~~~~~~~~~^~~~~
/usr/share/systemtap/runtime/linux/access_process_vm.h:57:61: error: passing argument 6 of ‘get_user_pages_remote’ makes pointer from integer without a cast [-Werror=int-conversion]
   57 |       ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma);
      |                                                             ^
      |                                                             |
      |                                                             int
./include/linux/mm.h:2400:33: note: expected ‘int *’ but argument is of type ‘int’
 2400 |                            int *locked);
      |                            ~~~~~^~~~~~
/usr/share/systemtap/runtime/linux/access_process_vm.h:57:13: error: too many arguments to function ‘get_user_pages_remote’
   57 |       ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma);
      |             ^~~~~~~~~~~~~~~~~~~~~
./include/linux/mm.h:2397:6: note: declared here
 2397 | long get_user_pages_remote(struct mm_struct *mm,
      |      ^~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.build:243: /tmp/stap07SM83/stap_1345_src.o] Error 1
make: *** [Makefile:2046: /tmp/stap07SM83] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compiled C into "stap_1345.ko" in 19290usr/2530sys/22658real ms.
Pass 4: compilation failed.  [man error::pass4]
[root@vm-10-0-185-68 ~]# cat simple-test.stp 
# Script to test basic System Tap functionality.


Actual Results:  

#  stap -v -F -g --disable-cache ./simple-test.stp 
Pass 1: parsed user script and 486 library scripts using 136468virt/107716res/15616shr/91400data kb, in 160usr/50sys/444real ms.
Pass 2: analyzed script: 4 probes, 2 functions, 0 embeds, 2 globals using 301204virt/203272res/20968shr/190432data kb, in 4390usr/610sys/51571real ms.
Pass 3: translated to C into "/tmp/stap07SM83/stap_1345_src.c" using 301220virt/203444res/21140shr/190448data kb, in 100usr/70sys/177real ms.
In file included from /usr/share/systemtap/runtime/linux/runtime.h:266,
                 from /usr/share/systemtap/runtime/runtime.h:26,
                 from /tmp/stap07SM83/stap_1345_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:57:36: error: passing argument 1 of ‘get_user_pages_remote’ from incompatible pointer type [-Werror=incompatible-pointer-types]
   57 |       ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma);
      |                                    ^~~
      |                                    |
      |                                    struct task_struct *
In file included from ./include/linux/kallsyms.h:13,
                 from ./include/linux/ftrace.h:13,
                 from ./include/linux/kprobes.h:28,
                 from /usr/share/systemtap/runtime/linux/runtime.h:21:
./include/linux/mm.h:2397:46: note: expected ‘struct mm_struct *’ but argument is of type ‘struct task_struct *’
 2397 | long get_user_pages_remote(struct mm_struct *mm,
      |                            ~~~~~~~~~~~~~~~~~~^~
/usr/share/systemtap/runtime/linux/access_process_vm.h:57:41: error: passing argument 2 of ‘get_user_pages_remote’ makes integer from pointer without a cast [-Werror=int-conversion]
   57 |       ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma);
      |                                         ^~
      |                                         |
      |                                         struct mm_struct *
./include/linux/mm.h:2398:42: note: expected ‘long unsigned int’ but argument is of type ‘struct mm_struct *’
 2398 |                            unsigned long start, unsigned long nr_pages,
      |                            ~~~~~~~~~~~~~~^~~~~
/usr/share/systemtap/runtime/linux/access_process_vm.h:57:54: error: passing argument 5 of ‘get_user_pages_remote’ makes pointer from integer without a cast [-Werror=int-conversion]
   57 |       ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma);
      |                                                      ^~~~~
      |                                                      |
      |                                                      int
./include/linux/mm.h:2399:66: note: expected ‘struct page **’ but argument is of type ‘int’
 2399 |                            unsigned int gup_flags, struct page **pages,
      |                                                    ~~~~~~~~~~~~~~^~~~~
/usr/share/systemtap/runtime/linux/access_process_vm.h:57:61: error: passing argument 6 of ‘get_user_pages_remote’ makes pointer from integer without a cast [-Werror=int-conversion]
   57 |       ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma);
      |                                                             ^
      |                                                             |
      |                                                             int
./include/linux/mm.h:2400:33: note: expected ‘int *’ but argument is of type ‘int’
 2400 |                            int *locked);
      |                            ~~~~~^~~~~~
/usr/share/systemtap/runtime/linux/access_process_vm.h:57:13: error: too many arguments to function ‘get_user_pages_remote’
   57 |       ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma);
      |             ^~~~~~~~~~~~~~~~~~~~~
./include/linux/mm.h:2397:6: note: declared here
 2397 | long get_user_pages_remote(struct mm_struct *mm,
      |      ^~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.build:243: /tmp/stap07SM83/stap_1345_src.o] Error 1
make: *** [Makefile:2046: /tmp/stap07SM83] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compiled C into "stap_1345.ko" in 19290usr/2530sys/22658real ms.
Pass 4: compilation failed.  [man error::pass4]
[root@vm-10-0-185-68 ~]# cat simple-test.stp 
# Script to test basic System Tap functionality.


Expected Results:  
No error


This happen with the latest Fedora release with 37 and 38, kernel version 3.5.5
I can reproduce it in 1minutetip system,

Comment 1 Frank Ch. Eigler 2023-10-11 19:06:12 UTC
In a few weeks, a new version of systemtap will include the kernel compatibility fixes - along with better diagnostics for this annoying case.  Until then, we'll put up a testing channel targeted rebuild of a snapshot that is known to work with 5.5 kernels.

Comment 2 Fedora Update System 2023-10-11 19:22:15 UTC
FEDORA-2023-763a14526d has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-763a14526d

Comment 3 Fedora Update System 2023-10-11 19:26:24 UTC
FEDORA-2023-a640ad0d27 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-a640ad0d27

Comment 4 Fedora Update System 2023-10-12 02:25:07 UTC
FEDORA-2023-763a14526d has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-763a14526d`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-763a14526d

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2023-10-12 03:00:21 UTC
FEDORA-2023-a640ad0d27 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-a640ad0d27`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-a640ad0d27

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2023-10-20 00:41:53 UTC
FEDORA-2023-a640ad0d27 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 7 Fedora Update System 2023-11-03 18:35:46 UTC
FEDORA-2023-763a14526d has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


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