ERROR::PASS4(7stap)

πŸ‘‘ NAME

okay so bestie, welcome to error::pass4 β€” section 7stap of the systemtap manual, aka the one that explains systemtap pass-4 errors. πŸ’…


✨ DESCRIPTION ✨

So pass 4 is the compilation era of the whole systemtap saga, and when stuff goes wrong here it's usually giving one of like, a few causes. Let's get into it 🫢

🌸 kernel or OS version changes

The systemtap runtime and the embedded-C fragments living in the tapset library are literally designed to be portable across a huge range of OS versions. Slay. But β€” incompatibilities can absolutely happen when some OS changes roll through, like kernel modifications that change functions, types, or macros that systemtap references. 😭

Upstream builds of systemtap (that's git://sourceware.org/git/systemtap.git) are often quickly updated to include the relevant fixes, so try getting or making an updated build. Basically: build systemtap from git if you're working with very young kernels. If the issue is still there after that, report the problem to the systemtap developers. πŸŽ€

πŸ¦‹ buggy embedded-C code

Embedded-C code in your own guru-mode script? Yeah, systemtap cannot check it, it just gets passed through verbatim to the compiler. Errors in those little snippets of code may get found during the pass-4 compiler invocation, though they may be hard to identify from the compiler errors alone. πŸ’€

πŸ“ incompatible embedded-C code

The interface standards between systemtap-generated code and embedded-C code occasionally change. For example, before version 1.8, arguments were passed using the macros THIS->foo and THIS->__retvalue, but from version 1.8 onward they're passed using STAP_ARG_foo and STAP_RETVALUE. So either adjust your embedded-C code to current standards, or use the stap --compatible=VERSION option to make systemtap use a different one. ✨

πŸ’œ compiler bugs and mysteries

Messages like "internal compiler error" are giving <em>compiler problems</em>, not you problems. These should be reported to the compiler developers in the form of a preprocessed .i file, plus the compiler command line. To gather the relevant info, run:

stap -k --vp 0003 -p4 ....

Systemtap will report the saved temporary directory, and the compiler command line it attempted. Go to that directory to find the main generated file stap_NNNNN_src.c. Then force the compiler to produce a preprocessed file with:

make -C /lib/modules/`uname -r`/build M=`pwd` stap_NNNNN_src.i

(note the .i suffix, bestie πŸ‘€), and the compiler command line should be in the file .stap_NNNNN_src.i.cmd.

ngl this one is the "not me debugging the compiler at 2am" pipeline. iconic but also 😭

🌈 SEE ALSO


and that's the whole page fr fr πŸ’– this was ERROR::PASS4(7stap), part of the systemtap manual, brought to you by section 7stap β€” go off and compile something cute, you got this πŸ«Άβœ¨πŸŽ€

πŸ“¦ where this page comes from