1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
graphic: 0.643
performance: 0.587
user-level: 0.542
semantic: 0.487
device: 0.411
mistranslation: 0.381
virtual: 0.365
debug: 0.365
architecture: 0.359
PID: 0.353
assembly: 0.278
x86: 0.268
network: 0.268
peripherals: 0.230
hypervisor: 0.219
i386: 0.212
socket: 0.200
vnc: 0.198
arm: 0.191
ppc: 0.188
risc-v: 0.177
register: 0.159
kernel: 0.155
TCG: 0.151
permissions: 0.128
files: 0.120
boot: 0.114
KVM: 0.102
VMM: 0.098
VDSO on armeb seems broken
Description of problem:
I'm seeing the VDSO method for `__clock_gettime64()` crashing under `qemu-armeb` (stack trace under Additional information, below).
I rebuilt glibc with VDSO globally kludged off, and all was well.
Steps to reproduce:
```
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char **argv) {
time_t ts;
printf("%ld\n", time(&ts));
exit(0);
}
```
Results, first with VDSO active via a system snapshot, second with the patched glibc:
```
$ armeb-linux-gnueabihf-gcc -o /tmp/time /tmp/time.c
$ qemu-armeb -L /.mirrorsnaps/.rootsnap.prev/usr/armeb-linux-gnueabihf /tmp/time
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault
$ qemu-armeb -L /usr/armeb-linux-gnueabihf /tmp/time
1715123280
```
Additional information:
```
Program received signal SIGSEGV, Segmentation fault.
0x4082b462 in ?? ()
(gdb) bt
#0 0x4082b462 in ?? ()
#1 0x40bf64a4 in __GI___clock_gettime64 (clock_id=clock_id@entry=5, tp=tp@entry=0x407fe9c0)
at ../sysdeps/unix/sysv/linux/clock_gettime.c:42
#2 0x40be9f58 in __GI___time64 (timer=0x0) at ../sysdeps/unix/sysv/linux/time.c:60
#3 __time (timer=0x407fea04) at ../sysdeps/unix/sysv/linux/time.c:73
```
`clock_gettime.c:42` is
```
r = INTERNAL_VSYSCALL_CALL (vdso_time64, 2, clock_id, tp);
```
Interestingly, the problem doesn't occur on qemu-arm (little endian), all else equal.
|