Bug 13480 - ARM missing syscall.sigaltstack
Summary: ARM missing syscall.sigaltstack
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: tapsets (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-07 15:27 UTC by Mark Wielaard
Modified: 2023-10-05 01:16 UTC (History)
2 users (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 Mark Wielaard 2011-12-07 15:27:46 UTC
syscall.sigaltstack is missing on ARM.

Other architectures define this through a arch specific tapset/<arch>/syscalls.stp

Running /root/systemtap/testsuite/buildok/syscalls-arch-detailed.stp
starting /root/systemtap/testsuite/buildok/syscalls-arch-detailed.stp
spawn1 stap -p4 /root/systemtap/testsuite/buildok/syscalls-arch-detailed.stp
spawn stap -p4 /root/systemtap/testsuite/buildok/syscalls-arch-detailed.stp
semantic error: probe point mismatch at position 1  (alternatives: accept access acct add_key adjtimex alarm bdflush bind brk capget capset chdir chmod chown chown16 chroot clock_getres clock_gettime clock_nanosleep clock_settime close compat_adjtimex compat_clock_nanosleep compat_execve compat_futex compat_futimesat compat_getitimer compat_io_setup compat_io_submit compat_nanosleep compat_ppoll compat_pselect6 compat_pselect7 compat_recvmmsg compat_select compat_setitimer compat_signalfd compat_sys_msgctl compat_sys_msgrcv compat_sys_msgsnd compat_sys_recvmsg compat_sys_semctl compat_sys_semtimedop compat_sys_sendmsg compat_sys_shmat compat_sys_shmctl compat_sys_utimes compat_utime compat_utimensat compat_vmsplice connect creat delete_module dup dup2 epoll_create epoll_ctl epoll_pwait epoll_wait eventfd execve exit exit_group faccessat fadvise64 fadvise64_64 fchdir fchmod fchmodat fchown fchown16 fchownat fcntl fdatasync fgetxattr flistxattr flock fork fremovexattr fsetxattr fstat fstatat fstatfs fstatfs64 fsync ftruncate ftruncate64 futex futimesat get_mempolicy getcwd getdents getegid geteuid getgid getgroups gethostname getitimer getpeername getpgid getpgrp getpid getppid getpriority getresgid getresuid getrlimit getrusage getsid getsockname getsockopt gettid gettimeofday getuid getxattr init_module inotify_add_watch inotify_init inotify_rm_watch io_cancel io_destroy io_getevents io_setup io_submit ioctl ioperm ioprio_get ioprio_set kexec_load keyctl kill lchown lchown16 lgetxattr link linkat listen listxattr llistxattr llseek lookup_dcookie lremovexattr lseek lsetxattr lstat madvise mbind migrate_pages mincore mkdir mkdirat mknod mknodat mlock mlockall mmap2 modify_ldt mount move_pages mprotect mq_getsetattr mq_notify mq_open mq_timedreceive mq_timedsend mq_unlink mremap msgctl msgget msgrcv msgsnd msync munlock munlockall munmap nanosleep nfsservctl ni_syscall nice open openat pause personality pipe pivot_root poll ppoll prctl pread pselect6 pselect7 ptrace pwrite pwrite32 quotactl read readahead readdir readlink readlinkat readv reboot recv recvfrom recvmmsg recvmsg remap_file_pages removexattr rename renameat request_key restart_syscall rmdir rt_sigaction rt_sigaction32 rt_sigpending rt_sigprocmask rt_sigqueueinfo rt_sigreturn rt_sigsuspend rt_sigtimedwait sched_get_priority_max sched_get_priority_min sched_getaffinity sched_getparam sched_getscheduler sched_rr_get_interval sched_setaffinity sched_setparam sched_setscheduler sched_yield select semctl semget semop semtimedop send sendfile sendmsg sendto set_mempolicy set_tid_address setdomainname setfsgid setfsuid setgid setgroups sethostname setitimer setpgid setpriority setregid setregid16 setresgid setresgid16 setresuid setresuid16 setreuid setreuid16 setrlimit setsid setsockopt settimeofday settimeofday32 setuid setxattr sgetmask shmat shmctl shmdt shmget shutdown sigaction sigaction32 signal signalfd sigpending sigprocmask sigreturn sigsuspend socket socketpair splice ssetmask stat statfs statfs64 stime swapoff swapon symlink symlinkat sync sysctl sysfs sysinfo syslog tee tgkill time timer_create timer_delete timer_getoverrun timer_gettime timer_settime timerfd times tkill truncate tux umask umount uname unlink unlinkat unshare uselib ustat ustat32 utime utimensat utimes vhangup vmsplice wait4 waitid write writev): identifier 'sigaltstack' at /root/systemtap/testsuite/buildok/syscalls-arch-detailed.stp:33:15 while resolving probe point syscall.sigaltstack
semantic error: probe point mismatch at position 1  (alternatives: accept access acct add_key adjtimex alarm bdflush bind brk capget capset chdir chmod chown chown16 chroot clock_getres clock_gettime clock_nanosleep clock_settime close compat_adjtimex compat_clock_nanosleep compat_execve compat_futex compat_futimesat compat_getitimer compat_io_setup compat_io_submit compat_nanosleep compat_ppoll compat_pselect6 compat_pselect7 compat_recvmmsg compat_select compat_setitimer compat_signalfd compat_sys_msgctl compat_sys_msgrcv compat_sys_msgsnd compat_sys_recvmsg compat_sys_semctl compat_sys_semtimedop compat_sys_sendmsg compat_sys_shmat compat_sys_shmctl compat_sys_utimes compat_utime compat_utimensat compat_vmsplice connect creat delete_module dup dup2 epoll_create epoll_ctl epoll_pwait epoll_wait eventfd execve exit exit_group faccessat fadvise64 fadvise64_64 fchdir fchmod fchmodat fchown fchown16 fchownat fcntl fdatasync fgetxattr flistxattr flock fork fremovexattr fsetxattr fstat fstatat fstatfs fstatfs64 fsync ftruncate ftruncate64 futex futimesat get_mempolicy getcwd getdents getegid geteuid getgid getgroups gethostname getitimer getpeername getpgid getpgrp getpid getppid getpriority getresgid getresuid getrlimit getrusage getsid getsockname getsockopt gettid gettimeofday getuid getxattr init_module inotify_add_watch inotify_init inotify_rm_watch io_cancel io_destroy io_getevents io_setup io_submit ioctl ioperm ioprio_get ioprio_set kexec_load keyctl kill lchown lchown16 lgetxattr link linkat listen listxattr llistxattr llseek lookup_dcookie lremovexattr lseek lsetxattr lstat madvise mbind migrate_pages mincore mkdir mkdirat mknod mknodat mlock mlockall mmap2 modify_ldt mount move_pages mprotect mq_getsetattr mq_notify mq_open mq_timedreceive mq_timedsend mq_unlink mremap msgctl msgget msgrcv msgsnd msync munlock munlockall munmap nanosleep nfsservctl ni_syscall nice open openat pause personality pipe pivot_root poll ppoll prctl pread pselect6 pselect7 ptrace pwrite pwrite32 quotactl read readahead readdir readlink readlinkat readv reboot recv recvfrom recvmmsg recvmsg remap_file_pages removexattr rename renameat request_key restart_syscall rmdir rt_sigaction rt_sigaction32 rt_sigpending rt_sigprocmask rt_sigqueueinfo rt_sigreturn rt_sigsuspend rt_sigtimedwait sched_get_priority_max sched_get_priority_min sched_getaffinity sched_getparam sched_getscheduler sched_rr_get_interval sched_setaffinity sched_setparam sched_setscheduler sched_yield select semctl semget semop semtimedop send sendfile sendmsg sendto set_mempolicy set_tid_address setdomainname setfsgid setfsuid setgid setgroups sethostname setitimer setpgid setpriority setregid setregid16 setresgid setresgid16 setresuid setresuid16 setreuid setreuid16 setrlimit setsid setsockopt settimeofday settimeofday32 setuid setxattr sgetmask shmat shmctl shmdt shmget shutdown sigaction sigaction32 signal signalfd sigpending sigprocmask sigreturn sigsuspend socket socketpair splice ssetmask stat statfs statfs64 stime swapoff swapon symlink symlinkat sync sysctl sysfs sysinfo syslog tee tgkill time timer_create timer_delete timer_getoverrun timer_gettime timer_settime timerfd times tkill truncate tux umask umount uname unlink unlinkat unshare uselib ustat ustat32 utime utimensat utimes vhangup vmsplice wait4 waitid write writev): identifier 'sigaltstack' at /root/systemtap/testsuite/buildok/syscalls-arch-detailed.stp:33:15 while resolving probe point syscall.sigaltstack
        source: probe syscall.sigaltstack

        source: probe syscall.sigaltstack
                              ^

                              ^
[...]
Pass 2: analysis failed.  Try again with another '--vp 01' option.

Pass 2: analysis failed.  Try again with another '--vp 01' option.
wait results: 5725 exp16 0 1
FAIL: buildok/syscalls-arch-detailed.stp
Comment 1 David Smith 2011-12-07 15:59:31 UTC
This wouldn't be hard to add.  Could you run the following command on your arm system?

# stap -L 'kernel.function("*sigaltstack*")'
Comment 2 Mark Wielaard 2011-12-17 01:07:58 UTC
The only entry point visible is do_sigaltstack, which unfortunately is too generic (it would also catch some calls to sigreturn for example).

The sigaltstack syscall is defined in  as:

CALL(sys_sigaltstack_wrapper)
(which has sycall number 186)

sys_sigaltstack_wrapper comes from linux/arch/arm/kernel/entry-common.S:

sys_sigaltstack_wrapper:
                ldr     r2, [sp, #S_OFF + S_SP]
                b       do_sigaltstack
ENDPROC(sys_sigaltstack_wrapper)

Unfortunately this means no dwarf is generated for this symbol, which makes it "invisible" to stap (or at least any argument processing will be invisible unless done by hand).
Comment 3 David Smith 2013-06-04 19:59:05 UTC
The following kernel commit switched arm to using the generic sigaltstack:

====
commit ec93ac8663ad5fcccd44c3768b23c93b87610fc2
Author: Al Viro <viro@zeniv.linux.org.uk>
Date:   Sun Dec 23 01:52:54 2012 -0500

    arm: switch to generic sigaltstack
    
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
====

Looks like this commit is present in 3.9. So, for 3.9+ kernels, this issue should be fixed.

If we want to try to fix this for kernels <= 3.8, we could either:

1) Use 'do_sigaltstack' for syscall.sigaltstack, since sys_sigaltstack just seems to be a wrapper for it anyway.

2) To just get things to compile, use 'never' for syscall.sigaltstack.
Comment 4 William Cohen 2023-10-05 01:16:29 UTC
Current kernels have the change mentioned in comment 3 and this is works with on Fedora 36 32-bit arm system running systemtap git commit ca71442b93af:

$ uname -a; ../install/bin/stap -V; ../install/bin/stap -v -p4 testsuite/buildok/syscalls-arch-detailed.stp
Linux fedora 6.2.15-100.fc36.armv7hl #1 SMP Thu May 11 17:07:19 UTC 2023 armv7l armv7l armv7l GNU/Linux
Systemtap translator/driver (version 5.0/0.189, release-4.8-147-gca71442b)
Copyright (C) 2005-2023 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
tested kernel versions: 2.6.32 ... 6.5
enabled features: AVAHI BPF JAVA PYTHON3 LIBRPM LIBSQLITE3 LIBVIRT LIBXML2 NLS NSS READLINE MONITOR_LIBS JSON_C
Pass 1: parsed user script and 510 library scripts using 138272virt/113664res/8704shr/104772data kb, in 9580usr/3210sys/14467real ms.
Pass 2: analyzed script: 3 probes, 15 functions, 99 embeds, 1 global using 144120virt/120844res/10036shr/110620data kb, in 1395340usr/615420sys/2419355real ms.
Pass 3: translated to C into "/tmp/stapHr0AWr/stap_06b653405b3c0d4438a94f0f4741ef8f_71834_src.c" using 144120virt/120972res/10164shr/110620data kb, in 90usr/30sys/139real ms.
/home/wcohen/.systemtap/cache/06/stap_06b653405b3c0d4438a94f0f4741ef8f_71834.ko
Pass 4: compiled C into "stap_06b653405b3c0d4438a94f0f4741ef8f_71834.ko" in 423150usr/147880sys/724350real ms.