Bug 2052114 - stap "Pass 4: compilation failed. [man error::pass4]"
Summary: stap "Pass 4: compilation failed. [man error::pass4]"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: systemtap
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Frank Ch. Eigler
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-08 18:19 UTC by Vít Ondruch
Modified: 2022-05-16 02:04 UTC (History)
8 users (show)

Fixed In Version: systemtap-4.7-1.fc36 systemtap-4.7-1.fc35
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-10 01:54:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Vít Ondruch 2022-02-08 18:19:51 UTC
Description of problem:
On a clean Rawhide machine, I did following:

~~~
# dnf install gdb /usr/bin/stap /usr/bin/staprun ruby-doc
Last metadata expiration check: 2:13:09 ago on Tue 08 Feb 2022 04:43:41 PM CET.
Dependencies resolved.
===================================================================================================================================================================================================================
 Package                                            Architecture                           Version                                                         Repository                                         Size
===================================================================================================================================================================================================================
Installing:
 ruby-doc                                           noarch                                 3.1.0-160.fc36                                                  beaker-Everything                                 4.9 M
 systemtap-client                                   x86_64                                 4.7~pre16395042gefae8a3d-2.fc36                                 beaker-Everything                                 3.6 M
 systemtap-runtime                                  x86_64                                 4.7~pre16395042gefae8a3d-2.fc36                                 beaker-Everything                                 442 k
Installing dependencies:

... snip ...

# stap-prep 
Configuring for kernel release 5.17.0-0.rc2.20220204gitdcb85f85fa6f.86.fc36.x86_64
Please wait, attempting to download /lib/modules/5.17.0-0.rc2.20220204gitdcb85f85fa6f.86.fc36.x86_64/vmlinuz debuginfo

... snip ...

# stap -v /usr/share/doc/ruby-doc/ruby-exercise.stp --suppress-handler-errors
Pass 1: parsed user script and 483 library scripts using 120812virt/96676res/17264shr/79196data kb, in 230usr/320sys/702real ms.
Pass 2: analyzed script: 18 probes, 7 functions, 1 embed, 0 globals using 198712virt/104108res/20276shr/91564data kb, in 300usr/360sys/3130real ms.
Pass 3: translated to C into "/tmp/stap8lSBmt/stap_8dd1df4e3a5394d7d925bb15cc14a7d1_13031_src.c" using 199008virt/104780res/20688shr/91860data kb, in 190usr/1610sys/1964real ms.
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (GCC) 12.0.1 20220202 (Red Hat 12.0.1-0)
  You are using:           gcc (GCC) 12.0.1 20220205 (Red Hat 12.0.1-0)
/tmp/stap8lSBmt/stap_8dd1df4e3a5394d7d925bb15cc14a7d1_13031_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:288: /tmp/stap8lSBmt/stap_8dd1df4e3a5394d7d925bb15cc14a7d1_13031_src.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1841: /tmp/stap8lSBmt] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compiled C into "stap_8dd1df4e3a5394d7d925bb15cc14a7d1_13031.ko" in 870usr/3980sys/5438real ms.
Pass 4: compilation failed.  [man error::pass4]
~~~

I have realized, that I'm still probably missing systemtap-devel:

~~~
# dnf install gdb /usr/bin/stap /usr/bin/staprun systemtap-devel ruby-doc
Last metadata expiration check: 2:30:07 ago on Tue 08 Feb 2022 04:43:41 PM CET.
Package gdb-11.1-12.fc36.x86_64 is already installed.
Package systemtap-client-4.7~pre16395042gefae8a3d-2.fc36.x86_64 is already installed.
Package systemtap-runtime-4.7~pre16395042gefae8a3d-2.fc36.x86_64 is already installed.
Package ruby-doc-3.1.0-160.fc36.noarch is already installed.
Dependencies resolved.
===================================================================================================================================================================================================================
 Package                                                      Architecture                       Version                                                       Repository                                     Size
===================================================================================================================================================================================================================
Installing:
 systemtap-devel                                              x86_64                             4.7~pre16395042gefae8a3d-2.fc36                               beaker-Everything                             2.1 M
Installing dependencies:
 elfutils-devel                                               x86_64                             0.186-1.fc36                                                  beaker-Everything                              55 k

... snip ..

# stap -v /usr/share/doc/ruby-doc/ruby-exercise.stp --suppress-handler-errors
Pass 1: parsed user script and 483 library scripts using 120812virt/96512res/17088shr/79196data kb, in 250usr/320sys/1263real ms.
Pass 2: analyzed script: 18 probes, 7 functions, 1 embed, 0 globals using 123208virt/100808res/18652shr/81592data kb, in 30usr/20sys/75real ms.
Pass 3: translated to C into "/tmp/stap3VNis6/stap_db0b25954fb017e7c52654b8e0189065_13031_src.c" using 123688virt/101808res/19116shr/82072data kb, in 230usr/1630sys/3936real ms.
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (GCC) 12.0.1 20220202 (Red Hat 12.0.1-0)
  You are using:           gcc (GCC) 12.0.1 20220205 (Red Hat 12.0.1-0)
In file included from /usr/share/systemtap/runtime/transport/procfs.c:13,
                 from /usr/share/systemtap/runtime/transport/transport.c:72,
                 from /usr/share/systemtap/runtime/linux/print.c:17,
                 from /usr/share/systemtap/runtime/print.c:17,
                 from /usr/share/systemtap/runtime/runtime_context.h:22,
                 from /tmp/stap3VNis6/stap_db0b25954fb017e7c52654b8e0189065_13031_src.c:436:
/usr/share/systemtap/runtime/proc_fs_compatibility.h:29:13: error: static declaration of ‘proc_set_user’ follows non-static declaration
   29 | static void proc_set_user(struct proc_dir_entry *de, kuid_t uid, kgid_t gid)
      |             ^~~~~~~~~~~~~
In file included from /usr/share/systemtap/runtime/linux/runtime.h:22,
                 from /usr/share/systemtap/runtime/runtime.h:26,
                 from /tmp/stap3VNis6/stap_db0b25954fb017e7c52654b8e0189065_13031_src.c:21:
./include/linux/proc_fs.h:112:13: note: previous declaration of ‘proc_set_user’ with type ‘void(struct proc_dir_entry *, kuid_t,  kgid_t)’
  112 | extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t);
      |             ^~~~~~~~~~~~~
/usr/share/systemtap/runtime/proc_fs_compatibility.h: In function ‘proc_set_user’:
/usr/share/systemtap/runtime/proc_fs_compatibility.h:31:11: error: invalid use of undefined type ‘struct proc_dir_entry’
   31 |         de->uid = __kuid_val(uid);
      |           ^~
/usr/share/systemtap/runtime/proc_fs_compatibility.h:32:11: error: invalid use of undefined type ‘struct proc_dir_entry’
   32 |         de->gid = __kgid_val(gid);
      |           ^~
/usr/share/systemtap/runtime/proc_fs_compatibility.h: At top level:
/usr/share/systemtap/runtime/proc_fs_compatibility.h:47:13: error: static declaration of ‘proc_remove’ follows non-static declaration
   47 | static void proc_remove(struct proc_dir_entry *de)
      |             ^~~~~~~~~~~
./include/linux/proc_fs.h:124:13: note: previous declaration of ‘proc_remove’ with type ‘void(struct proc_dir_entry *)’
  124 | extern void proc_remove(struct proc_dir_entry *);
      |             ^~~~~~~~~~~
/usr/share/systemtap/runtime/proc_fs_compatibility.h: In function ‘proc_remove’:
/usr/share/systemtap/runtime/proc_fs_compatibility.h:49:21: error: invalid use of undefined type ‘struct proc_dir_entry’
   49 |         if (de && de->subdir == NULL) {
      |                     ^~
/usr/share/systemtap/runtime/proc_fs_compatibility.h:50:36: error: invalid use of undefined type ‘struct proc_dir_entry’
   50 |                 if (atomic_read(&de->count) != LAST_ENTRY_COUNT)
      |                                    ^~
In file included from ./include/asm-generic/bug.h:22,
                 from ./arch/x86/include/asm/bug.h:84,
                 from ./include/linux/bug.h:5,
                 from ./include/linux/mmdebug.h:5,
                 from ./include/linux/gfp.h:5,
                 from /usr/share/systemtap/runtime/linux/runtime_defines.h:20,
                 from /usr/share/systemtap/runtime/runtime_defines.h:8,
                 from /tmp/stap3VNis6/stap_db0b25954fb017e7c52654b8e0189065_13031_src.c:12:
/usr/share/systemtap/runtime/proc_fs_compatibility.h:54:34: error: invalid use of undefined type ‘struct proc_dir_entry’
   54 |                                de->name);
      |                                  ^~
./include/linux/printk.h:418:33: note: in definition of macro ‘printk_index_wrap’
  418 |                 _p_func(_fmt, ##__VA_ARGS__);                           \
      |                                 ^~~~~~~~~~~
/usr/share/systemtap/runtime/proc_fs_compatibility.h:51:25: note: in expansion of macro ‘printk’
   51 |                         printk(KERN_ERR "Removal of %s from /proc"
      |                         ^~~~~~
/usr/share/systemtap/runtime/proc_fs_compatibility.h:55:37: error: invalid use of undefined type ‘struct proc_dir_entry’
   55 |                 remove_proc_entry(de->name, de->parent);
      |                                     ^~
/usr/share/systemtap/runtime/proc_fs_compatibility.h:55:47: error: invalid use of undefined type ‘struct proc_dir_entry’
   55 |                 remove_proc_entry(de->name, de->parent);
      |                                               ^~
make[1]: *** [scripts/Makefile.build:288: /tmp/stap3VNis6/stap_db0b25954fb017e7c52654b8e0189065_13031_src.o] Error 1
make: *** [Makefile:1841: /tmp/stap3VNis6] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compiled C into "stap_db0b25954fb017e7c52654b8e0189065_13031.ko" in 25660usr/19150sys/51277real ms.
Pass 4: compilation failed.  [man error::pass4]
~~~

But still no luck.

So shouldn't be the `stap-prep` enough? Shouldn't be all the dependencies properly define on package level? And afterall, what is the build failure?

Version-Release number of selected component (if applicable):
# rpm -qa systemtap*
systemtap-runtime-4.7~pre16395042gefae8a3d-2.fc36.x86_64
systemtap-client-4.7~pre16395042gefae8a3d-2.fc36.x86_64
systemtap-devel-4.7~pre16395042gefae8a3d-2.fc36.x86_64

# rpm -qa kernel*
kernel-core-5.17.0-0.rc2.20220204gitdcb85f85fa6f.86.fc36.x86_64
kernel-modules-5.17.0-0.rc2.20220204gitdcb85f85fa6f.86.fc36.x86_64
kernel-5.17.0-0.rc2.20220204gitdcb85f85fa6f.86.fc36.x86_64
kernel-headers-5.17.0-0.rc2.git0.1.fc36.x86_64
kernel-devel-5.17.0-0.rc2.20220204gitdcb85f85fa6f.86.fc36.x86_64


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
Kernel module compilation fails and therefore stap fails to run.


Expected results:
Stap runs just fine without too much fiddling.


Additional info:

Comment 1 Ben Cotton 2022-02-08 20:04:55 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 2 Frank Ch. Eigler 2022-03-09 23:07:51 UTC
This kernel incompatibility should be fixed in rawhide build systemtap-4.7~pre16468670g9f253544-1.fc37 .  A backport to f36 is also underway.

Comment 3 Fedora Update System 2022-03-09 23:28:07 UTC
FEDORA-2022-e150c6c1d8 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-e150c6c1d8

Comment 4 Fedora Update System 2022-03-11 19:24:22 UTC
FEDORA-2022-e150c6c1d8 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-e150c6c1d8`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-e150c6c1d8

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

Comment 5 Daniel Berrangé 2022-05-06 14:03:14 UTC
This breakage has impacted Fedora 35 too, so can you submit an rebase to 4.7 for that branch too.

Comment 6 Fedora Update System 2022-05-06 14:27:41 UTC
FEDORA-2022-de47808e83 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-de47808e83

Comment 7 Fedora Update System 2022-05-06 14:28:12 UTC
FEDORA-2022-ab48427f3e has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-ab48427f3e

Comment 8 Fedora Update System 2022-05-08 03:06:38 UTC
FEDORA-2022-ab48427f3e has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-ab48427f3e`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-ab48427f3e

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

Comment 9 Fedora Update System 2022-05-08 03:27:14 UTC
FEDORA-2022-de47808e83 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-de47808e83`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-de47808e83

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

Comment 10 Fedora Update System 2022-05-10 01:54:19 UTC
FEDORA-2022-ab48427f3e has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2022-05-16 02:04:57 UTC
FEDORA-2022-de47808e83 has been pushed to the Fedora 35 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.