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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
|
performance: 0.957
architecture: 0.955
debug: 0.954
i386: 0.953
assembly: 0.952
virtual: 0.952
TCG: 0.951
arm: 0.951
semantic: 0.949
graphic: 0.947
user-level: 0.947
permissions: 0.946
ppc: 0.944
device: 0.944
register: 0.942
mistranslation: 0.941
peripherals: 0.940
PID: 0.938
x86: 0.938
vnc: 0.938
network: 0.935
VMM: 0.935
hypervisor: 0.935
risc-v: 0.934
files: 0.933
KVM: 0.928
socket: 0.925
kernel: 0.916
boot: 0.894
mips linux-user builds occasionly crash randomly only to be fixed by a full clean re-build
From time to time I find check-tcg crashes with a one of the MIPS binaries. The last time it crashed was running the test:
./mips64el-linux-user/qemu-mips64el ./tests/tcg/mips64el-linux-user/threadcount
Inevitably after some time noodling around wondering what could be causing this weird behaviour I wonder if it is a build issue. I wipe all the mips* build directories, re-run configure and re-build and voila problem goes away.
It seems there must be some sort of build artefact which isn't being properly re-generated on a build update which causes weird problems. Additional data point if I:
rm -rf mips64el-linux-user
../../configure
make
then I see failures in mip32 builds - eg:
GEN mipsn32el-linux-user/config-target.h
In file included from /home/alex/lsrc/qemu.git/linux-user/syscall_defs.h:10,
from /home/alex/lsrc/qemu.git/linux-user/qemu.h:16,
from /home/alex/lsrc/qemu.git/linux-user/linuxload.c:5:
/home/alex/lsrc/qemu.git/linux-user/mips64/syscall_nr.h:1: error: unterminated #ifndef
#ifndef LINUX_USER_MIPS64_SYSCALL_NR_H
make[1]: *** [/home/alex/lsrc/qemu.git/rules.mak:69: linux-user/linuxload.o] Error 1
make[1]: *** Waiting for unfinished jobs....
which implies there is a cross dependency between different targets somewhere. If I executed:
rm -rf mips*
before re-configuring and re-building then everything works again.
syscall_nr.h is generated from syscall_n32.tbl and syscall_n64.tbl, so it should be under your build directory, not the source directory.
But if you did a build before the change, the dependency file .d will store a path in the src dir and the new file will not be generated in the build dir but in the previous place.
linux-user/mips64/Makefile.objs:
ifeq ($(TARGET_SYSTBL_ABI),n32)
%/syscall_nr.h: $(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)/syscall_n32.tbl $(syshdr)
$(call quiet-command, sh $(syshdr) $< $@ n32 "" 6000,"GEN","$@")
endif
ifeq ($(TARGET_SYSTBL_ABI),n64)
%/syscall_nr.h: $(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)/syscall_n64.tbl $(syshdr)
$(call quiet-command, sh $(syshdr) $< $@ n64 "" 5000,"GEN","$@")
endif
Normally this is cleaned up by the configure with:
for arch in alpha hppa m68k xtensa sh4 microblaze arm ppc s390x sparc sparc64 \
i386 x86_64 mips mips64 ; do
# remove the file if it has been generated in the source directory
rm -f "${source_path}/linux-user/${arch}/syscall_nr.h"
# remove the dependency files
for target in ${arch}*-linux-user ; do
test -d "${target}" && find "${target}" -type f -name "*.d" \
-exec grep -q "${source_path}/linux-user/${arch}/syscall_nr.h" {} \; \
-print | while read file ; do rm "${file}" "${file%.d}.o" ; done
done
don
OK the syscall_nr failure is a red hearing - that was affected by a stray generated file in my source tree (maybe I accidentally ran make in the top directory?).
However I've just run into the mips64le-linux-user crash again which didn't go away until I deleted all mips* directories and rebuilt.
четвртак, 18. јун 2020., Cornelia Huck <email address hidden> је написао/ла:
> On Mon, 15 Jun 2020 15:18:48 -0000
> Alex Bennée <email address hidden> wrote:
>
> > Public bug reported:
> >
> > >From time to time I find check-tcg crashes with a one of the MIPS
> > binaries. The last time it crashed was running the test:
> >
> > ./mips64el-linux-user/qemu-mips64el ./tests/tcg/mips64el-linux-
> > user/threadcount
> >
> > Inevitably after some time noodling around wondering what could be
> > causing this weird behaviour I wonder if it is a build issue. I wipe all
> > the mips* build directories, re-run configure and re-build and voila
> > problem goes away.
> >
> > It seems there must be some sort of build artefact which isn't being
> > properly re-generated on a build update which causes weird problems.
> > Additional data point if I:
> >
> > rm -rf mips64el-linux-user
> > ../../configure
> > make
> >
> > then I see failures in mip32 builds - eg:
> >
> > GEN mipsn32el-linux-user/config-target.h
> > In file included from /home/alex/lsrc/qemu.git/
> linux-user/syscall_defs.h:10,
> > from /home/alex/lsrc/qemu.git/linux-user/qemu.h:16,
> > from /home/alex/lsrc/qemu.git/
> linux-user/linuxload.c:5:
> > /home/alex/lsrc/qemu.git/linux-user/mips64/syscall_nr.h:1: error:
> unterminated #ifndef
> > #ifndef LINUX_USER_MIPS64_SYSCALL_NR_H
> >
> > make[1]: *** [/home/alex/lsrc/qemu.git/rules.mak:69:
> linux-user/linuxload.o] Error 1
> > make[1]: *** Waiting for unfinished jobs....
> >
> > which implies there is a cross dependency between different targets
> > somewhere. If I executed:
> >
> > rm -rf mips*
> >
> > before re-configuring and re-building then everything works again.
> >
> > ** Affects: qemu
> > Importance: Undecided
> > Status: New
> >
> >
> > ** Tags: build linux-user mips
> >
>
> FWIW, this does not seem to be a mips-only issue: I'm seeing the
> threadcount test fail with s390x-linux-user as well, and it also goes
> away (only) if I purge the build directory, re-configure, and re-build.
>
>
Valuable info!
четвртак, 18. јун 2020., Cornelia Huck <email address hidden> је написао/ла:
> On Mon, 15 Jun 2020 15:18:48 -0000
> Alex Bennée <email address hidden> wrote:
>
> > Public bug reported:
> >
> > >From time to time I find check-tcg crashes with a one of the MIPS
> > binaries. The last time it crashed was running the test:
> >
> > ./mips64el-linux-user/qemu-mips64el ./tests/tcg/mips64el-linux-
> > user/threadcount
> >
> > Inevitably after some time noodling around wondering what could be
> > causing this weird behaviour I wonder if it is a build issue. I wipe all
> > the mips* build directories, re-run configure and re-build and voila
> > problem goes away.
> >
> > It seems there must be some sort of build artefact which isn't being
> > properly re-generated on a build update which causes weird problems.
> > Additional data point if I:
> >
> > rm -rf mips64el-linux-user
> > ../../configure
> > make
> >
> > then I see failures in mip32 builds - eg:
> >
> > GEN mipsn32el-linux-user/config-target.h
> > In file included from /home/alex/lsrc/qemu.git/
> linux-user/syscall_defs.h:10,
> > from /home/alex/lsrc/qemu.git/linux-user/qemu.h:16,
> > from /home/alex/lsrc/qemu.git/
> linux-user/linuxload.c:5:
> > /home/alex/lsrc/qemu.git/linux-user/mips64/syscall_nr.h:1: error:
> unterminated #ifndef
> > #ifndef LINUX_USER_MIPS64_SYSCALL_NR_H
> >
> > make[1]: *** [/home/alex/lsrc/qemu.git/rules.mak:69:
> linux-user/linuxload.o] Error 1
> > make[1]: *** Waiting for unfinished jobs....
> >
> > which implies there is a cross dependency between different targets
> > somewhere. If I executed:
> >
> > rm -rf mips*
> >
> > before re-configuring and re-building then everything works again.
> >
> > ** Affects: qemu
> > Importance: Undecided
> > Status: New
> >
> >
> > ** Tags: build linux-user mips
> >
>
> FWIW, this does not seem to be a mips-only issue: I'm seeing the
> threadcount test fail with s390x-linux-user as well, and it also goes
> away (only) if I purge the build directory, re-configure, and re-build.
>
>
>
Alex, Cornelia,
Do you perhaps recall how did you obtain the original binaries (those with
the problem)? What would be your typical workflow? Perhaps "git-pull +
make" on existing, but not latest source tree?
Thanks,
Aleksandar
Aleksandar, Alex, see comment #1.
I think the problem happens because I moved the syscall_nr.h from source directory to build directory. If source directory is not cleaned up correctly, the build will not generate the new header in the build directory but in source directory and some targets that need 32bit, 64bit or a new API will only use the first one generated (as in this case they are all at the same place).
See the following PR: https://<email address hidden>/
Cornelia Huck <email address hidden> writes:
> On Thu, 18 Jun 2020 19:00:34 +0200
> Aleksandar Markovic <email address hidden> wrote:
>
>> четвртак, 18. јун 2020., Cornelia Huck <email address hidden> је написао/ла:
>>
>> > On Mon, 15 Jun 2020 15:18:48 -0000
>> > Alex Bennée <email address hidden> wrote:
>> >
>> > > Public bug reported:
>> > >
>> > > >From time to time I find check-tcg crashes with a one of the MIPS
>> > > binaries. The last time it crashed was running the test:
>> > >
>> > > ./mips64el-linux-user/qemu-mips64el ./tests/tcg/mips64el-linux-
>> > > user/threadcount
>> > >
>> > > Inevitably after some time noodling around wondering what could be
>> > > causing this weird behaviour I wonder if it is a build issue. I wipe all
>> > > the mips* build directories, re-run configure and re-build and voila
>> > > problem goes away.
>> > >
>> > > It seems there must be some sort of build artefact which isn't being
>> > > properly re-generated on a build update which causes weird problems.
>> > > Additional data point if I:
>> > >
>> > > rm -rf mips64el-linux-user
>> > > ../../configure
>> > > make
>> > >
>> > > then I see failures in mip32 builds - eg:
>> > >
>> > > GEN mipsn32el-linux-user/config-target.h
>> > > In file included from /home/alex/lsrc/qemu.git/
>> > linux-user/syscall_defs.h:10,
>> > > from /home/alex/lsrc/qemu.git/linux-user/qemu.h:16,
>> > > from /home/alex/lsrc/qemu.git/
>> > linux-user/linuxload.c:5:
>> > > /home/alex/lsrc/qemu.git/linux-user/mips64/syscall_nr.h:1: error:
>> > unterminated #ifndef
>> > > #ifndef LINUX_USER_MIPS64_SYSCALL_NR_H
>> > >
>> > > make[1]: *** [/home/alex/lsrc/qemu.git/rules.mak:69:
>> > linux-user/linuxload.o] Error 1
>> > > make[1]: *** Waiting for unfinished jobs....
>> > >
>> > > which implies there is a cross dependency between different targets
>> > > somewhere. If I executed:
>> > >
>> > > rm -rf mips*
>> > >
>> > > before re-configuring and re-building then everything works again.
>> > >
>> > > ** Affects: qemu
>> > > Importance: Undecided
>> > > Status: New
>> > >
>> > >
>> > > ** Tags: build linux-user mips
>> > >
>> >
>> > FWIW, this does not seem to be a mips-only issue: I'm seeing the
>> > threadcount test fail with s390x-linux-user as well, and it also goes
>> > away (only) if I purge the build directory, re-configure, and re-build.
>> >
>> >
>> >
>> Alex, Cornelia,
>>
>> Do you perhaps recall how did you obtain the original binaries (those with
>> the problem)? What would be your typical workflow? Perhaps "git-pull +
>> make" on existing, but not latest source tree?
>
> Just a bog-standard "pull some stuff, do make, create a branch and put
> some patches on it, do make, switch to another branch, do make, etc". No
> advanced fiddling with git history, doing make on a subtree, etc.
Same here. As I say the syscall_nr breakage was a different one. I'll
regularly just advance my tree and find this sort of breakage.
--
Alex Bennée
Does this problem still persist after we've switched the build system to meson?
[Expired for QEMU because there has been no activity for 60 days.]
|