Bug 2304012

Summary: systemtap fails on compiling a minimal script
Product: [Fedora] Fedora Reporter: Neil Horman <nhorman>
Component: systemtapAssignee: Frank Ch. Eigler <fche>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 40CC: amerey, fche, mcermak, mjw, scox, wcohen
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: systemtap-5.2~pre17250223gd07e4284-1.fc39 systemtap-5.2~pre17250223gd07e4284-1.fc40 systemtap-5.2~pre17250223gd07e4284-1.fc41 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-09-06 03:52:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Neil Horman 2024-08-11 12:19:10 UTC
I'm following the instructions here:
https://sourceware.org/systemtap/wiki/SecureBoot

to get a stap environment set up

I've got the server running, and its found with the right kernel version

But when I run the command:
stap --use-server=hmsbeagle.lan  -e 'probe begin {exit()}'

It fails with 

```
Using a compile server.
WARNING: The domain name, hmsbeagle.lan, does not match the DNS name(s) on the server certificate:
  hmsbeagle
  hmsbeagle.local
In file included from ./include/linux/percpu.h:5,
                 from ./arch/x86/include/asm/msr.h:15,
                 from ./arch/x86/include/asm/tsc.h:10,
                 from ./arch/x86/include/asm/timex.h:6,
                 from ./include/linux/timex.h:67,
                 from ./include/linux/time32.h:13,
                 from ./include/linux/time.h:60,
                 from ./include/linux/jiffies.h:10,
                 from ./include/linux/ktime.h:25,
                 from ./include/linux/timer.h:6,
                 from ./include/linux/workqueue.h:9,
                 from ./include/linux/srcu.h:21,
                 from ./include/linux/notifier.h:16,
                 from ./arch/x86/include/asm/uprobes.h:13,
                 from ./include/linux/uprobes.h:49,
                 from ./include/linux/mm_types.h:16,
                 from ./include/linux/mmzone.h:22,
                 from ./include/linux/gfp.h:7,
                 from /usr/share/systemtap/runtime/linux/runtime_defines.h:1,
                 from /usr/share/systemtap/runtime/runtime_defines.h:8,
                 from <server>/stap000000/stap_2f454ad0ed06963cdb17736720407859_958_src.c:12:
./include/linux/alloc_tag.h:212:2: error: expected identifier or ‘(’ before ‘{’ token
  212 | ({                                                                      \
      |  ^
./include/linux/vmalloc.h:147:33: note: in expansion of macro ‘alloc_hooks’
  147 | #define vzalloc(...)            alloc_hooks(vzalloc_noprof(__VA_ARGS__))
      |                                 ^~~~~~~~~~~
/usr/share/systemtap/runtime/linux/alloc.c:408:14: note: in expansion of macro ‘vzalloc’
  408 | static void *vzalloc(unsigned long size)
      |              ^~~~~~~
./include/linux/alloc_tag.h:212:2: error: expected identifier or ‘(’ before ‘{’ token
  212 | ({                                                                      \
      |  ^
./include/linux/vmalloc.h:153:33: note: in expansion of macro ‘alloc_hooks’
  153 | #define vmalloc_node(...)       alloc_hooks(vmalloc_node_noprof(__VA_ARGS__))
      |                                 ^~~~~~~~~~~
/usr/share/systemtap/runtime/linux/alloc.c:443:14: note: in expansion of macro ‘vmalloc_node’
  443 | static void *vmalloc_node(unsigned long size, int node __attribute__((unused)))
      |              ^~~~~~~~~~~~
./include/linux/alloc_tag.h:212:2: error: expected identifier or ‘(’ before ‘{’ token
  212 | ({                                                                      \
      |  ^
./include/linux/vmalloc.h:156:33: note: in expansion of macro ‘alloc_hooks’
  156 | #define vzalloc_node(...)       alloc_hooks(vzalloc_node_noprof(__VA_ARGS__))
      |                                 ^~~~~~~~~~~
/usr/share/systemtap/runtime/linux/alloc.c:450:14: note: in expansion of macro ‘vzalloc_node’
  450 | static void *vzalloc_node(unsigned long size, int node)
      |              ^~~~~~~~~~~~
In file included from /usr/share/systemtap/runtime/runtime.h:26,
                 from <server>/stap000000/stap_2f454ad0ed06963cdb17736720407859_958_src.c:21:
/usr/share/systemtap/runtime/stp_task_work.c: In function ‘stp_task_work_cancel’:
/usr/share/systemtap/runtime/stp_task_work.c:13:123: error: passing argument 2 of ‘(bool (*)(struct task_struct *, struct callback_head *))kallsyms_task_work_cancel’ from incompatible pointer type [-Wincompatible-pointer-types]
   13 | #define task_work_cancel(a,b) ibt_wrapper(struct callback_head *, (* (task_work_cancel_fn)kallsyms_task_work_cancel)((a), (b)))
      |                                                                                                                           ^~~
      |                                                                                                                           |
      |                                                                                                                           task_work_func_t {aka void (*)(struct callback_head *)}
/usr/share/systemtap/runtime/linux/runtime.h:317:21: note: in definition of macro ‘ibt_wrapper’
  317 |   rettype retval = (function);                  \
      |                     ^~~~~~~~
/usr/share/systemtap/runtime/stp_task_work.c:107:17: note: in expansion of macro ‘task_work_cancel’
  107 |         twork = task_work_cancel(task, func);
      |                 ^~~~~~~~~~~~~~~~
/usr/share/systemtap/runtime/stp_task_work.c:13:123: note: expected ‘struct callback_head *’ but argument is of type ‘task_work_func_t’ {aka ‘void (*)(struct callback_head *)’}
   13 | #define task_work_cancel(a,b) ibt_wrapper(struct callback_head *, (* (task_work_cancel_fn)kallsyms_task_work_cancel)((a), (b)))
      |                                                                                                                           ^~~
/usr/share/systemtap/runtime/linux/runtime.h:317:21: note: in definition of macro ‘ibt_wrapper’
  317 |   rettype retval = (function);                  \
      |                     ^~~~~~~~
/usr/share/systemtap/runtime/stp_task_work.c:107:17: note: in expansion of macro ‘task_work_cancel’
  107 |         twork = task_work_cancel(task, func);
      |                 ^~~~~~~~~~~~~~~~
/usr/share/systemtap/runtime/linux/runtime.h:317:20: error: incompatible types when initializing type ‘struct callback_head *’ using type ‘bool’ {aka ‘_Bool’}
  317 |   rettype retval = (function);                  \
      |                    ^
/usr/share/systemtap/runtime/stp_task_work.c:13:31: note: in expansion of macro ‘ibt_wrapper’
   13 | #define task_work_cancel(a,b) ibt_wrapper(struct callback_head *, (* (task_work_cancel_fn)kallsyms_task_work_cancel)((a), (b)))
      |                               ^~~~~~~~~~~
/usr/share/systemtap/runtime/stp_task_work.c:107:17: note: in expansion of macro ‘task_work_cancel’
  107 |         twork = task_work_cancel(task, func);
      |                 ^~~~~~~~~~~~~~~~
In file included from /usr/share/systemtap/runtime/linux/runtime.h:207:
/usr/share/systemtap/runtime/transport/relay_v2.c: In function ‘__stp_relay_wakeup_timer’:
/usr/share/systemtap/runtime/linux/debug.h:47:36: error: suggest braces around empty body in an ‘else’ statement [-Werror=empty-body]
   47 | #define dbug_trans(level, args...) ;
      |                                    ^
/usr/share/systemtap/runtime/transport/relay_v2.c:195:17: note: in expansion of macro ‘dbug_trans’
  195 |                 dbug_trans(0, "relay_v2 wakeup timer expiry\n");
      |                 ^~~~~~~~~~
/usr/share/systemtap/runtime/transport/symbols.c: In function ‘_stp_set_stext’:
/usr/share/systemtap/runtime/linux/debug.h:103:34: error: suggest braces around empty body in an ‘else’ statement [-Werror=empty-body]
  103 | #define dbug_sym(level, args...) ;
      |                                  ^
/usr/share/systemtap/runtime/transport/symbols.c:44:17: note: in expansion of macro ‘dbug_sym’
   44 |                 dbug_sym(1, "found kernel _stext load address: 0x%lx\n",
      |                 ^~~~~~~~
<server>/stap000000/stap_2f454ad0ed06963cdb17736720407859_958_src.c: At top level:
<server>/stap000000/stap_2f454ad0ed06963cdb17736720407859_958_src.c:103:1: error: ‘static’ is not at beginning of declaration [-Werror=old-style-declaration]
  103 | } static stap_probes[];
      | ^
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.build:244: <server>/stap000000/stap_2f454ad0ed06963cdb17736720407859_958_src.o] Error 1
make: *** [Makefile:1946: <server>/stap000000] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed.  [man error::pass4]
Kernel version 6.10.3 is outside tested range 2.6.32 ... 6.9-rc0
Passes: via server failed.  Try again with another '-v' option.
The kernel on your system requires modules to be signed for loading.
The module created by compiling your script must be signed by a systemtap compile-server.  [man stap-server]
--use-server was automatically selected in order to request compilation by a compile-server.
```

Reproducible: Always

Steps to Reproduce:
1.follow the instructions at https://sourceware.org/systemtap/wiki/SecureBoot

Actual Results:  
failed compilation

Expected Results:  
error regarding the need for an additional MOK key

Comment 1 Frank Ch. Eigler 2024-08-30 19:52:14 UTC
Looks like impact from kernel rebases.  A stap backport is coming shortly.

Comment 2 Fedora Update System 2024-08-30 20:01:55 UTC
FEDORA-2024-e33854a64b (systemtap-5.2~pre17250223gd07e4284-1.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-e33854a64b

Comment 3 Fedora Update System 2024-08-30 20:02:15 UTC
FEDORA-2024-b4e453e470 (systemtap-5.2~pre17250223gd07e4284-1.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-b4e453e470

Comment 4 Fedora Update System 2024-08-30 20:02:51 UTC
FEDORA-2024-053e9322ab (systemtap-5.2~pre17250223gd07e4284-1.fc39) has been submitted as an update to Fedora 39.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-053e9322ab

Comment 5 Fedora Update System 2024-08-31 02:13:48 UTC
FEDORA-2024-b4e453e470 has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-b4e453e470`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-b4e453e470

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

Comment 6 Fedora Update System 2024-08-31 02:55:27 UTC
FEDORA-2024-053e9322ab 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-2024-053e9322ab`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-053e9322ab

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

Comment 7 Fedora Update System 2024-08-31 03:38:30 UTC
FEDORA-2024-e33854a64b has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-e33854a64b`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-e33854a64b

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

Comment 8 Martin Cermak 2024-09-05 07:12:14 UTC
Verified with kernel-6.10.6-100.fc39 and systemtap-5.2~pre17250223gd07e4284-1.fc39 .

Comment 9 Martin Cermak 2024-09-05 07:28:10 UTC
Verified also with kernel-6.10.6-200.fc40 and systemtap-5.2~pre17250223gd07e4284-1.fc40 .

Comment 10 Fedora Update System 2024-09-06 03:52:55 UTC
FEDORA-2024-053e9322ab (systemtap-5.2~pre17250223gd07e4284-1.fc39) has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2024-09-06 04:03:07 UTC
FEDORA-2024-b4e453e470 (systemtap-5.2~pre17250223gd07e4284-1.fc40) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 12 Fedora Update System 2024-09-13 20:46:25 UTC
FEDORA-2024-e33854a64b (systemtap-5.2~pre17250223gd07e4284-1.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.