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

marticak at gmx dot com sourceware-bugzilla@sourceware.org
Thu Oct 1 16:03:14 GMT 2026


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

--- Comment #1 from Martin Cermak <marticak at gmx dot com> ---
The following ai-generated patch helps on aarch64:

$ 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.
diff --git a/tapset/linux/context.stp b/tapset/linux/context.stp
index 7f47bfd8b..ac1e8470d 100644
--- a/tapset/linux/context.stp
+++ b/tapset/linux/context.stp
@@ -321,9 +321,10 @@ function cpu:long ()
  */
 function registers_valid:long ()
 %{ /* pure */ /* unprivileged */ /* stable */
-       STAP_RETVALUE = (c->user_mode_p
-                           ? (CONTEXT->uregs != NULL)
-                           : (CONTEXT->kregs != NULL));
+       STAP_RETVALUE = (CONTEXT->sregs != NULL)
+               || (c->user_mode_p
+                   ? (CONTEXT->uregs != NULL)
+                   : (CONTEXT->kregs != NULL));
 %}

 /**
$ 

The problem stil persists on ppc64le, and I'm not sure about s390x for now.

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


More information about the Systemtap mailing list