[Bug runtime/34702] New: probe syscall.close { println(fd)} broken on non-x86_64

marticak at gmx dot com sourceware-bugzilla@sourceware.org
Thu Oct 1 15:17:12 GMT 2026


https://sourceware.org/bugzilla/show_bug.cgi?id=34702

            Bug ID: 34702
           Summary: probe syscall.close { println(fd)} broken on
                    non-x86_64
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
          Assignee: systemtap at sourceware dot org
          Reporter: marticak at gmx dot com
  Target Milestone: ---

With current codebase (fb0527413470e0fcb59763d1509b8d997f6a2b97),
tests/Regression/semantic-errors-bz953776-28 fails like this on non-x86_64
arches (both rhel-9 and 10):

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   case-1
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 11:36:56 ] :: [  BEGIN   ] :: Running 'stap  -E 'probe
timer.s(900){error("probe timeout after 15 minutes")}' -v -e 'probe
syscall.close { println(fd); exit(); }''
Pass 1: parsed user script and 478 library scripts using
359496virt/121596res/14588shr/139124data kb, in 200usr/180sys/145real ms.
Pass 2: analyzed script: 3 probes, 13 functions, 96 embeds, 2 globals using
784480virt/133424res/19452shr/564108data kb, in 2250usr/310sys/2150real ms.
Pass 3: translated to C into
"/tmp/stapGiCwV3/stap_0b71cca119a2377c2fee40f2f896c4f3_67147_src.c" using
784592virt/133804res/19644shr/564220data kb, in 0usr/0sys/3real ms.
In file included from
/tmp/stapGiCwV3/stap_0b71cca119a2377c2fee40f2f896c4f3_67147_aux_0.c:6:
/usr/share/systemtap/runtime/linux/compat_unistd.h:1921:31: error:
"LINUX_VERSION_CODE" is not defined, evaluates to 0 [-Werror=undef]
 1921 | #if !(defined(__aarch64__) && LINUX_VERSION_CODE >=
KERNEL_VERSION(5,3,0))
      |                               ^~~~~~~~~~~~~~~~~~
/usr/share/systemtap/runtime/linux/compat_unistd.h:1921:53: error:
"KERNEL_VERSION" is not defined, evaluates to 0 [-Werror=undef]
 1921 | #if !(defined(__aarch64__) && LINUX_VERSION_CODE >=
KERNEL_VERSION(5,3,0))
      |                                                     ^~~~~~~~~~~~~~
/usr/share/systemtap/runtime/linux/compat_unistd.h:1921:67: error: missing
binary operator before token "("
 1921 | #if !(defined(__aarch64__) && LINUX_VERSION_CODE >=
KERNEL_VERSION(5,3,0))
      |                                                                   ^
/usr/share/systemtap/runtime/linux/compat_unistd.h:1944:31: error:
"LINUX_VERSION_CODE" is not defined, evaluates to 0 [-Werror=undef]
 1944 | #if !(defined(__aarch64__) && LINUX_VERSION_CODE >=
KERNEL_VERSION(3,19,0))
      |                               ^~~~~~~~~~~~~~~~~~
/usr/share/systemtap/runtime/linux/compat_unistd.h:1944:53: error:
"KERNEL_VERSION" is not defined, evaluates to 0 [-Werror=undef]
 1944 | #if !(defined(__aarch64__) && LINUX_VERSION_CODE >=
KERNEL_VERSION(3,19,0))
      |                                                     ^~~~~~~~~~~~~~
/usr/share/systemtap/runtime/linux/compat_unistd.h:1944:67: error: missing
binary operator before token "("
 1944 | #if !(defined(__aarch64__) && LINUX_VERSION_CODE >=
KERNEL_VERSION(3,19,0))
      |                                                                   ^
/usr/share/systemtap/runtime/linux/compat_unistd.h:2008:31: error:
"LINUX_VERSION_CODE" is not defined, evaluates to 0 [-Werror=undef]
 2008 | #if !(defined(__aarch64__) && LINUX_VERSION_CODE >=
KERNEL_VERSION(5,3,0))
      |                               ^~~~~~~~~~~~~~~~~~
/usr/share/systemtap/runtime/linux/compat_unistd.h:2008:53: error:
"KERNEL_VERSION" is not defined, evaluates to 0 [-Werror=undef]
 2008 | #if !(defined(__aarch64__) && LINUX_VERSION_CODE >=
KERNEL_VERSION(5,3,0))
      |                                                     ^~~~~~~~~~~~~~
/usr/share/systemtap/runtime/linux/compat_unistd.h:2008:67: error: missing
binary operator before token "("
 2008 | #if !(defined(__aarch64__) && LINUX_VERSION_CODE >=
KERNEL_VERSION(5,3,0))
      |                                                                   ^
/usr/share/systemtap/runtime/linux/compat_unistd.h:2115:31: error:
"LINUX_VERSION_CODE" is not defined, evaluates to 0 [-Werror=undef]
 2115 | #if !(defined(__aarch64__) && LINUX_VERSION_CODE >=
KERNEL_VERSION(3,19,0))
      |                               ^~~~~~~~~~~~~~~~~~
/usr/share/systemtap/runtime/linux/compat_unistd.h:2115:53: error:
"KERNEL_VERSION" is not defined, evaluates to 0 [-Werror=undef]
 2115 | #if !(defined(__aarch64__) && LINUX_VERSION_CODE >=
KERNEL_VERSION(3,19,0))
      |                                                     ^~~~~~~~~~~~~~
/usr/share/systemtap/runtime/linux/compat_unistd.h:2115:67: error: missing
binary operator before token "("
 2115 | #if !(defined(__aarch64__) && LINUX_VERSION_CODE >=
KERNEL_VERSION(3,19,0))
      |                                                                   ^
/usr/share/systemtap/runtime/linux/compat_unistd.h:2130:31: error:
"LINUX_VERSION_CODE" is not defined, evaluates to 0 [-Werror=undef]
 2130 | #if !(defined(__aarch64__) && LINUX_VERSION_CODE >=
KERNEL_VERSION(3,17,0))
      |                               ^~~~~~~~~~~~~~~~~~
/usr/share/systemtap/runtime/linux/compat_unistd.h:2130:53: error:
"KERNEL_VERSION" is not defined, evaluates to 0 [-Werror=undef]
 2130 | #if !(defined(__aarch64__) && LINUX_VERSION_CODE >=
KERNEL_VERSION(3,17,0))
      |                                                     ^~~~~~~~~~~~~~
/usr/share/systemtap/runtime/linux/compat_unistd.h:2130:67: error: missing
binary operator before token "("
 2130 | #if !(defined(__aarch64__) && LINUX_VERSION_CODE >=
KERNEL_VERSION(3,17,0))
      |                                                                   ^
/usr/share/systemtap/runtime/linux/compat_unistd.h:2250:31: error:
"LINUX_VERSION_CODE" is not defined, evaluates to 0 [-Werror=undef]
 2250 | #if !(defined(__aarch64__) && LINUX_VERSION_CODE >=
KERNEL_VERSION(3,19,0))
      |                               ^~~~~~~~~~~~~~~~~~
/usr/share/systemtap/runtime/linux/compat_unistd.h:2250:53: error:
"KERNEL_VERSION" is not defined, evaluates to 0 [-Werror=undef]
 2250 | #if !(defined(__aarch64__) && LINUX_VERSION_CODE >=
KERNEL_VERSION(3,19,0))
      |                                                     ^~~~~~~~~~~~~~
/usr/share/systemtap/runtime/linux/compat_unistd.h:2250:67: error: missing
binary operator before token "("
 2250 | #if !(defined(__aarch64__) && LINUX_VERSION_CODE >=
KERNEL_VERSION(3,19,0))
      |                                                                   ^
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.build:229:
/tmp/stapGiCwV3/stap_0b71cca119a2377c2fee40f2f896c4f3_67147_aux_0.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:2003: /tmp/stapGiCwV3] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compiled C into "stap_0b71cca119a2377c2fee40f2f896c4f3_67147.ko" in
3980usr/260sys/3368real ms.
Pass 4: compilation failed.  [man error::pass4]
Kernel version 6.12.0 is within tested range 3.10 ... 7.3.0-rc3
:: [ 11:37:02 ] :: [   FAIL   ] :: Command 'stap  -E 'probe
timer.s(900){error("probe timeout after 15 minutes")}' -v -e 'probe
syscall.close { println(fd); exit(); }'' (Expected 0, got 1)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 6s
::   Assertions: 0 good, 1 bad
::   RESULT: FAIL (case-1)


The macro definition can be fixed with:

$ git diff
diff --git a/runtime/linux/compat_unistd.h b/runtime/linux/compat_unistd.h
index 0817ef5f9..c8c4f4cb9 100644
--- a/runtime/linux/compat_unistd.h
+++ b/runtime/linux/compat_unistd.h
@@ -11,6 +11,8 @@
 #ifndef _COMPAT_UNISTD_H_
 #define _COMPAT_UNISTD_H_

+#include <linux/version.h>
+
 // Older kernels (like RHEL5) supported __NR_sendfile64. For newer
 // kernels, we'll just define __NR_sendfile64 in terms of
 // __NR_sendfile.
$

but then there is another problem:

el10 aarch64 # stap -v -e 'probe syscall.close { println(fd); exit(); }'
Pass 1: parsed user script and 470 library scripts using
359996virt/116992res/14464shr/134916data kb, in 180usr/180sys/174real ms.
Pass 2: analyzed script: 2 probes, 13 functions, 96 embeds, 2 globals using
784784virt/128060res/18832shr/559704data kb, in 2170usr/320sys/2109real ms.
Pass 3: translated to C into
"/tmp/stapKiVYIw/stap_0c3a8458f51a388d46a413682206d521_67508_src.c" using
785308virt/128676res/19088shr/560228data kb, in 0usr/0sys/3real ms.
Pass 4: compiled C into "stap_0c3a8458f51a388d46a413682206d521_67508.ko" in
44240usr/2580sys/14554real ms.
Pass 5: starting run.
ERROR: cannot access CPU registers in this context near identifier 'error' at
/usr/local/share/systemtap/tapset/logging.stp:129:9 (called from identifier
'assert' at /usr/local/share/systemtap/tapset/arm64/registers.stp:120:3)
(called from identifier '_stp_register' at
/usr/local/share/systemtap/tapset/arm64/registers.stp:149:9) (called from
identifier 'u_register' at /usr/local/s
WARNING: Number of errors: 1, skipped probes: 0
WARNING: /usr/local/bin/staprun exited with status: 1
Pass 5: run completed in 10usr/50sys/2184real ms.
Pass 5: run failed.  [man error::pass5]
el10 aarch64 #

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Systemtap mailing list