Launchpad has imported 3 comments from the remote bug at
https://sourceware.org/bugzilla/show_bug.cgi?id=26814.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2020-10-29T20:02:02+00:00 Balint Reczey wrote:

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
...

...

Reply at:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1896281/comments/3

------------------------------------------------------------------------
On 2020-10-29T20:07:41+00:00 Andreas Schwab wrote:

errno is only defined if sched_rr_get_interval returns -1.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1896281/comments/4

------------------------------------------------------------------------
On 2020-10-29T20:35:09+00:00 Balint Reczey wrote:

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:~#

Reply at:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1896281/comments/5


** Changed in: glibc
       Status: Unknown => Invalid

** Changed in: glibc
   Importance: Unknown => Medium

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1896281

Title:
  glibc 2.32 leaks errno in sched_rr_get_interval fallback

To manage notifications about this bug go to:
https://bugs.launchpad.net/glibc/+bug/1896281/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to