Bug 30459 - Ko compilation failures with kernel 6.1/6.2 kernel headers
Summary: Ko compilation failures with kernel 6.1/6.2 kernel headers
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-18 05:33 UTC by agentzh
Modified: 2023-06-07 17:57 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description agentzh 2023-05-18 05:33:12 UTC
For some nontrivial stap scripts compiled with Fedora 36's 6.1 and 6.2 kernels, the kernel build system trows out the following compilation errors:

```
In file included from /opt/stap-plus/share/systemtap/runtime/linux/runtime.h:301,
                 from /opt/stap-plus/share/systemtap/runtime/runtime.h:26,
                 from /tmp/stapzRqxL5/stap_61c4c192c40cf6ad899afb44bb419d45_1848_src.c:17:
/opt/stap-plus/share/systemtap/runtime/sym.c: In function ‘_stp_usermodule_check’:
/opt/stap-plus/share/systemtap/runtime/sym.c:983:1: error: the frame size of 2056 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
  983 | }
      | ^
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.build:250: /tmp/stapzRqxL5/stap_61c4c192c40cf6ad899afb44bb419d45_1848_src.o] Error 1
make: *** [Makefile:2016: /tmp/stapzRqxL5] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed.  [man error::pass4]
```

An unused C array is allocated on the stack, which triggers this error. I'll prepare a patch to fix this.
Comment 1 agentzh 2023-05-18 05:46:53 UTC
I'd propose this patch to fix this issue: https://gist.github.com/agentzh/b171be912307c1a63bd2c5374f3698ed
Comment 2 William Cohen 2023-05-25 19:10:57 UTC
The proposed fix to remove the large unused array has been checked into systemtap.  Can this PR be closed now?
Comment 3 William Cohen 2023-06-07 17:57:35 UTC
This appears to addressed with the removal of the unused array in the _stp_usermodule_check function.