summary refs log tree commit diff stats
path: root/results/classifier/zero-shot/118/hypervisor/1705118
blob: 3c621d4f69d9929a17de09a2b95105158853c529 (plain) (blame)
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
hypervisor: 0.859
virtual: 0.824
graphic: 0.819
TCG: 0.801
vnc: 0.799
user-level: 0.798
debug: 0.790
ppc: 0.776
assembly: 0.766
device: 0.758
mistranslation: 0.755
KVM: 0.754
register: 0.753
semantic: 0.753
risc-v: 0.746
permissions: 0.742
kernel: 0.741
performance: 0.737
PID: 0.736
peripherals: 0.734
VMM: 0.709
socket: 0.706
architecture: 0.702
arm: 0.683
network: 0.682
x86: 0.678
files: 0.667
boot: 0.662
i386: 0.627

qemu user mode: rt signals not implemented for sparc guests

The documentation
<https://qemu.weilnetz.de/doc/qemu-doc.html#Features> says that
qemu in user mode supports POSIX signal handling.

Catching SIGSEGV according to POSIX, however, does not work on
  ppc, ppc64, ppc64le, s390x, sparc64.
It does work, however, on
  aarch64, alpha, arm, hppa, m68k, mips, mips64, sh4.

How to reproduce:
The attached program runs fine (exits with code 0) on
  - real hardware Linux/PowerPC64 (in 32-bit and 64-bit mode),
  - real hardware Linux/PowerPC64LE,
  - qemu-system-s390x emulated Linux/s390x,
  - real hardware Linux/SPARC64.
$ gcc -O -Wall testsigsegv.c; ./a.out; echo $?
0

For ppc:
$ powerpc-linux-gnu-gcc-5 -O -Wall -static testsigsegv.c -o testsigsegv-ppc
$ ~/inst-qemu/2.9.0/bin/qemu-ppc testsigsegv-ppc
$ echo $?
3

For ppc64:
$ powerpc64-linux-gnu-gcc-5 -O -Wall -static testsigsegv.c -o testsigsegv-ppc64
$ ~/inst-qemu/2.9.0/bin/qemu-ppc64 testsigsegv-ppc64
$ echo $?
3

For ppc64le:
$ powerpc64le-linux-gnu-gcc-5 -O -Wall -static testsigsegv.c -o testsigsegv-ppc64le
$ ~/inst-qemu/2.9.0/bin/qemu-ppc64le testsigsegv-ppc64le
$ echo $?
3

For s390x:
$ s390x-linux-gnu-gcc-5 -O -Wall -static testsigsegv.c -o testsigsegv-s390x
$ ~/inst-qemu/2.9.0/bin/qemu-s390x testsigsegv-s390x
$ echo $?
3
$ s390x-linux-gnu-gcc-5 -O -Wall -static testsigsegv.c -DAVOID_LINUX_S390X_COMPAT -o testsigsegv-s390x-a
$ ~/inst-qemu/2.9.0/bin/qemu-s390x testsigsegv-s390x-a
$ echo $?
0
So, the test fails here because the Linux/s390x kernel omits the least
significant 12 bits of the fault address in the 'si_addr' field. But
qemu-s390x is not compatible with the Linux/s390x behaviour: it puts
the complete fault address in the 'si_addr' field.

For sparc64:
$ sparc64-linux-gnu-gcc-5 -O -Wall -static testsigsegv.c -o testsigsegv-sparc64
$ ~/inst-qemu/2.9.0/bin/qemu-sparc64 testsigsegv-sparc64
Segmentation fault (core dumped)













The behaviour in qemu-2.10 is the same as in qemu-2.9.

This is an interesting collection of different bugs:
 * s390x is missing masking operations, as you describe
 * ppc is passing the PC of the offending insn, not the data address, into si_addr
 * sparc fails to record the address of a data fault and so passes 0 into si_addr
 * sparc also isn't implementing rt_sigaction correctly and so the calls in your test program fail EINVAL (your test program doesn't check the return value from sigaction, so it ploughs ahead and makes the faulting data access with the SIG_DFL behaviour for SEGV, hence the uncaught SEGV).

I'm putting together some patches for these.


...and also
 * SPARC doesn't implement setup_rt_frame(), so it can't deliver RT signals at all.
That's a bigger missing feature than the rest.


Patchset that fixes all the minor parts of this, leaving (probably) just sparc setup_rt_frame/rt_sigreturn:
https://lists.gnu.org/archive/html/qemu-devel/2017-11/msg00833.html


I confirm that in qemu-2.11, the ppc and s390x cases are fixed, however the sparc64 case is still failing:

$ ~/inst-qemu/2.11.0/bin/qemu-ppc testsigsegv-ppc
$ echo $?
0

$ ~/inst-qemu/2.11.0/bin/qemu-ppc64 testsigsegv-ppc64
$ echo $?
0

$ ~/inst-qemu/2.11.0/bin/qemu-ppc64le testsigsegv-ppc64le
$ echo $?
0

$ ~/inst-qemu/2.11.0/bin/qemu-s390x testsigsegv-s390x
$ echo $?
0
$ ~/inst-qemu/2.11.0/bin/qemu-s390x testsigsegv-s390x-a
$ echo $?
3

$ ~/inst-qemu/2.11.0/bin/qemu-sparc64 testsigsegv-sparc64
setup_rt_frame: not implemented
Segmentation fault (core dumped)


I don't suppose anybody's going to get round to implementing RT signals for SPARC any time soon, so let's retitle this bug to track the one remaining issue.


The QEMU project is currently moving its bug tracking to another system.
For this we need to know which bugs are still valid and which could be
closed already. Thus we are setting the bug state to "Incomplete" now.

If the bug has already been fixed in the latest upstream version of QEMU,
then please close this ticket as "Fix released".

If it is not fixed yet and you think that this bug report here is still
valid, then you have two options:

1) If you already have an account on gitlab.com, please open a new ticket
for this problem in our new tracker here:

    https://gitlab.com/qemu-project/qemu/-/issues

and then close this ticket here on Launchpad (or let it expire auto-
matically after 60 days). Please mention the URL of this bug ticket on
Launchpad in the new ticket on GitLab.

2) If you don't have an account on gitlab.com and don't intend to get
one, but still would like to keep this ticket opened, then please switch
the state back to "New" or "Confirmed" within the next 60 days (other-
wise it will get closed as "Expired"). We will then eventually migrate
the ticket automatically to the new system (but you won't be the reporter
of the bug in the new system and thus you won't get notified on changes
anymore).

Thank you and sorry for the inconvenience.


The situation in version 6.0.0 is the same as in version 2.11.0: The cases ppc, ppc64, ppc64le, s390x are fixed, but the sparc64 executable still crashes.


This is an automated cleanup. This bug report has been moved to QEMU's
new bug tracker on gitlab.com and thus gets marked as 'expired' now.
Please continue with the discussion here:

 https://gitlab.com/qemu-project/qemu/-/issues/311