[Bug runtime/25852] New: Avoid allocating the temp string buffer for kernel backtraces on the kernel stack
agentzh at gmail dot com
sourceware-bugzilla@sourceware.org
Sat Apr 18 19:42:18 GMT 2020
https://sourceware.org/bugzilla/show_bug.cgi?id=25852
Bug ID: 25852
Summary: Avoid allocating the temp string buffer for kernel
backtraces on the kernel stack
Product: systemtap
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: runtime
Assignee: systemtap at sourceware dot org
Reporter: agentzh at gmail dot com
Target Milestone: ---
I've noted that for large -DMAXBACKTRACE=N values, the kernel module won't even
compile at all:
```
$ /opt/stap/bin/stap -DMAXBACKTRACE=80 -e 'probe oneshot { print_backtrace() }'
In file included from
/tmp/stap9dNBFe/stap_e6cbcb21af7634fac8b4ca07b2e07a58_1196_src.c:83:
/opt/stap/share/systemtap/runtime/stack.c: In function
‘_stp_stack_print_fallback.isra.0.constprop’:
/opt/stap/share/systemtap/runtime/stack.c:235:1: error: the frame size of 648
bytes is larger than 512 bytes [-Werror=frame-larger-than=]
235 | }
| ^
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.build:265:
/tmp/stap9dNBFe/stap_e6cbcb21af7634fac8b4ca07b2e07a58_1196_src.o] Error 1
make: *** [Makefile:1652: /tmp/stap9dNBFe] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed. [man error::pass4]
```
This is due to the fact that in the stap runtime C function
`_stp_stack_print_fallback`, the local variable `unsigned long
entries[MAXBACKTRACE]` would take too much space on the kernel stack. Shall we
instead allocate this out of the stack, like in the ctx data structure?
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Systemtap
mailing list