[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static |
Date: |
Fri, 30 Nov 2012 17:17:43 -0000 |
Actually I just managed to interact with a hung qemu under a debugger
sufficiently to confirm what is happening here.
CMake's code for running child processes (in kwsys/ProcessUNIX.c) does this:
"On UNIX, a child process is forked to exec the program. Three output pipes
are read by the parent process using a select call to block until data are
ready. Two of the pipes are stdout and stderr for the child. The third is a
special pipe populated by a signal handler to indicate that a child has
terminated. This is used in conjunction with the timeout on the select call to
implement a timeout for program even when it closes stdout and stderr and at
the same time avoiding races."
So (assuming no timeout set up) we can get the following race:
* spawn child process
* parent gets to point of making select() syscall
* this takes the parent process into qemu's linux-user/main.c code
* child process exits
* host kernel sends SIGCHLD to parent
* qemu's signal handler queues this SIGCHLD and does a cpu_exit, which will
make the parent take the signal at the next basic block
* parent code (still inside main.c or syscall.c) does the actual host select()
syscall
* this blocks forever, because the thing that would wake it up is the signal
handler writing to the pipe we're selecting on, but we will never run the
signal handler until select exits
Fixing this bug will indeed require the significant rework I referred to
in comment #14, I'm afraid. Don't hold your breath...
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/955379
Title:
cmake hangs with qemu-arm-static
Status in QEMU:
New
Status in Linaro QEMU:
New
Status in “qemu-linaro” package in Ubuntu:
Confirmed
Bug description:
I'm using git commit 3e7ecd976b06f... configured with --target-list
=arm-linux-user --static in a chroot environment to compile some
things. I ran into this problem with both pcl and opencv-2.3.1. cmake
consistently freezes at some point during its execution, though in a
different spot each time, usually during a step when it's searching
for some libraries. For instance, pcl most commonly stops after:
[snip]
-- Boost version: 1.46.1
-- Found the following Boost libraries:
-- system
-- filesystem
-- thread
-- date_time
-- checking for module 'eigen3'
-- found eigen3, version 3.0.1
which is perplexing because it freezes after finding what it wants,
not during the search. When it does get past that point, it does so
almost immediately but freezes somewhere else.
I'm using 64-bit Ubuntu 11.10 with kernel release 3.0.0-16-generic
with an Intel i5.
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/955379/+subscriptions
- [Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static, (continued)
- [Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static, Launchpad Bug Tracker, 2012/11/23
- [Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static, Tim Penhey, 2012/11/25
- [Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static, Janne Karhunen, 2012/11/28
- [Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static, Janne Karhunen, 2012/11/29
- [Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static, Janne Karhunen, 2012/11/29
- [Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static, Peter Maydell, 2012/11/30
- [Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static, Janne Karhunen, 2012/11/30
- [Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static, Peter Maydell, 2012/11/30
- [Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static,
Peter Maydell <=