sched_getcpu on ppc64le produces an illegal instruction
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
qemu (Ubuntu) |
New
|
High
|
Unassigned |
Bug Description
I'm getting SIGILL on a call to sched_getcpu:
gcc 6.3.0 201700221 (Ubuntu 6.3.0-8ubuntu1) and libc6:ppc64el 2.24-7ubuntu2
$ cat example.c
#define _GNU_SOURCE
#include <sched.h>
int main(void)
{
return sched_getcpu();
}
gcc -g example.c -o example
./example
Illegal instruction
$ gdb ./example
GNU gdb (Ubuntu 7.12.50.
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc64le-
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://
Find the GDB manual and other documentation resources online at:
<http://
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./example...done.
(gdb) run
Starting program: /home/king/example
Program received signal SIGILL, Illegal instruction.
__kernel_getcpu ()
at /build/
32 /build/
(gdb) where
#0 __kernel_getcpu ()
at /build/
#1 0x00003fffb7ea08e8 in sched_getcpu ()
at ../sysdeps/
#2 0x00000000200007f0 in main () at example.c:7
Changed in glibc (Ubuntu): | |
importance: | Undecided → High |
Hi Colin, what system is this on?
The failing instruction should be a read of SPRG3:
│0x3fffb7f807c8 <__kernel_getcpu> mfspr r5,259
which should be fine to execute in userspace. There was a NUMA_BALANCING bug around that time where we'd end up mapping the vdso no execute, but I don't think Ubuntu is enabling that feature.