When sched_rr_get_interval_time64 is not implemented glibc falls back to sched_rr_get_interval syscall but does not clear errno. This breaks 'unhide quick' and a few other unhide commands giving false positives as a result. The problem is observed only on armhf in Ubuntu CI. https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1896281 test.c: #include <stdio.h> #include <errno.h> #include <sched.h> int main() { struct timespec tp; errno = 0; sched_rr_get_interval(1, &tp); perror("error"); return 0; } strace ./a.out ... sched_rr_get_interval_time64(1, 0xfff88678) = -1 ENOSYS (Function not implemented) sched_rr_get_interval(1, {tv_sec=0, tv_nsec=0}) = 0 dup(2) = 3 fcntl64(3, F_GETFL) = 0x402 (flags O_RDWR|O_APPEND) brk(NULL) = 0x1942000 brk(0x1963000) = 0x1963000 fstat64(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x3), ...}) = 0 write(3, "error: Function not implemented\n", 32error: Function not implemented ) = 32 ... ...
errno is only defined if sched_rr_get_interval returns -1.
root@gg-armhf:~# cat test.c #include <stdio.h> #include <errno.h> #include <sched.h> int main() { struct timespec tp; errno = 0; int ret = sched_rr_get_interval(1, &tp); printf("ret == %d\n", ret); perror("error"); return 0; } root@gg-armhf:~# ./a.out ret == 0 error: Function not implemented root@gg-armhf:~#
I think this is similar (In reply to Balint Reczey from comment #2) > root@gg-armhf:~# cat test.c > #include <stdio.h> > #include <errno.h> > #include <sched.h> > int main() { > struct timespec tp; > errno = 0; > int ret = sched_rr_get_interval(1, &tp); > printf("ret == %d\n", ret); > perror("error"); > return 0; > } > root@gg-armhf:~# ./a.out > ret == 0 > error: Function not implemented > root@gg-armhf:~# The errno value after a successful call does not give you any meaningful information. But I think this is similar to the recent stat y2038 support where it triggered some invalid used within glibc itself. I think it would be better to use INTERNAL_SYSCALL_CALL in such cases and only sets the errno in case of failure.