vivier / qemu-m68k

Other
40 stars 6 forks source link

cmake 3.11.x lockups qemu-m68k and qemu-sh4 #30

Closed glaubitz closed 6 years ago

glaubitz commented 6 years ago

cmake 3.11.x locks up qemu-m68k and qemu-sh4 when trying to build a source code which uses cmake. qemu-arm is not affected by this issue.

The change with cmake that caused this issue is the integration of libuv for asynchronous I/O.

I will provide some strace output later. I'm still in the process of gaining more data.

glaubitz commented 6 years ago

qemu from upstream (91fe7a376ad46e3cc5e82d418aad22173c948a3c) is affected as well:

root@nofan:/local_scratch/sid-m68k-sbuild> ps aux |grep cmake
glaubitz 31427  0.0  0.0 4241940 6228 ?        Sl   15:40   0:00 /usr/bin/qemu-m68k-static /bin/sh -c cd /build/ksyntax-highlighting-yc9ySx/ksyntax-highlighting-5.47.0/obj-m68k-linux-gnu/data && /usr/bin/cmake -E cmake_autogen /build/ksyntax-highlighting-yc9ySx/ksyntax-highlighting-5.47.0/obj-m68k-linux-gnu/data/CMakeFiles/SyntaxHighlightingData_autogen.dir/AutogenInfo.cmake Debian
glaubitz 31433  0.0  0.1 4242908 22680 ?       Sl   15:40   0:00 /usr/bin/qemu-m68k-static /usr/bin/cmake -E cmake_autogen /build/ksyntax-highlighting-yc9ySx/ksyntax-highlighting-5.47.0/obj-m68k-linux-gnu/data/CMakeFiles/SyntaxHighlightingData_autogen.dir/AutogenInfo.cmake Debian
glaubitz 31436  0.0  0.0 4241940 6148 ?        Sl   15:40   0:00 /usr/bin/qemu-m68k-static /bin/sh -c cd /build/ksyntax-highlighting-yc9ySx/ksyntax-highlighting-5.47.0/obj-m68k-linux-gnu/src/indexer && /usr/bin/cmake -E cmake_autogen /build/ksyntax-highlighting-yc9ySx/ksyntax-highlighting-5.47.0/obj-m68k-linux-gnu/src/indexer/CMakeFiles/katehighlightingindexer_autogen.dir/AutogenInfo.cmake Debian
glaubitz 31442  0.0  0.1 4242912 21900 ?       Sl   15:40   0:00 /usr/bin/qemu-m68k-static /usr/bin/cmake -E cmake_autogen /build/ksyntax-highlighting-yc9ySx/ksyntax-highlighting-5.47.0/obj-m68k-linux-gnu/src/indexer/CMakeFiles/katehighlightingindexer_autogen.dir/AutogenInfo.cmake Debian
root     31534  0.0  0.0  22200   976 pts/1    S+   15:42   0:00 grep cmake
root@nofan:/local_scratch/sid-m68k-sbuild> strace -p 31427
strace: Process 31427 attached
wait4(-1, ^Cstrace: Process 31427 detached
 <detached ...>
root@nofan:/local_scratch/sid-m68k-sbuild> strace -p 31433
strace: Process 31433 attached
clock_gettime(CLOCK_MONOTONIC, {tv_sec=4943113, tv_nsec=20243776}) = 0
epoll_pwait(9, ^Cstrace: Process 31433 detached
 <detached ...>
root@nofan:/local_scratch/sid-m68k-sbuild> strace -p 31436
strace: Process 31436 attached
wait4(-1, ^Cstrace: Process 31436 detached
 <detached ...>
root@nofan:/local_scratch/sid-m68k-sbuild> strace -p 31442
strace: Process 31442 attached
clock_gettime(CLOCK_MONOTONIC, {tv_sec=4943125, tv_nsec=526360496}) = 0
epoll_pwait(9, ^Cstrace: Process 31442 detached
 <detached ...>
root@nofan:/local_scratch/sid-m68k-sbuild>
glaubitz commented 6 years ago

Use this tarball to test: https://people.debian.org/~glaubitz/sid-m68k-cmake.tgz

root@nofan:~> cd /local_scratch/sid-m68k-sbuild/
root@nofan:/local_scratch/sid-m68k-sbuild> mount -o bind /proc ./proc
root@nofan:/local_scratch/sid-m68k-sbuild> chroot .
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
(sid-m68k-sbuild)root@nofan:/# cd root/kwayland-5.47.0/build/
(sid-m68k-sbuild)root@nofan:~/kwayland-5.47.0/build# make
[  0%] Automatic MOC for target KF5WaylandClient

The process hangs after the last message. With cmake versions prior to version 3.11, it works.

vivier commented 6 years ago

I've run the chroot on a real m68040, and it hangs at the same place:

[pid 1849] epoll_ctl(10, EPOLL_CTL_ADD, 11, {EPOLLIN, {u32=0, u64=11}}) = 0 [pid 1849] epoll_ctl(10, EPOLL_CTL_ADD, 13, {EPOLLIN, {u32=0, u64=13}}) = 0 [pid 1849] epoll_wait(10, [{EPOLLIN, {u32=0, u64=13}}], 1024, -1) = 1 [pid 1849] clock_gettime(CLOCK_MONOTONIC, {tv_sec=2235, tv_nsec=194691242}) = 0 [pid 1849] read(13, "\0\0\0\0\0\0\0\1", 1024) = 8 [pid 1849] clock_gettime(CLOCK_MONOTONIC, {tv_sec=2235, tv_nsec=201574242}) = 0 [pid 1849] epoll_wait(10,

glaubitz commented 6 years ago

I just tested cmake from git master and this seems to fix problem for me, both on qemu-system as well as qemu-user.

So, I guess we can close this issue as invalid.