Re: [Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static

2012-12-04 Thread Peter Maydell
On 4 December 2012 11:21, Janne Karhunen 955...@bugs.launchpad.net wrote:
 And what would break if we make poll timeout instantly in case there are
 signals pending and restart the given syscall after handlers run?

If there are signals pending in the host kernel poll will *already*
return immediately. If there is a signal pending in the QEMU signal
queue (because the host kernel just delivered it to us) then there
will always be a window between the point where you say ok, queue
is empty and actually doing the host syscall, where a signal could
be delivered and put in the queue. You cannot fix this bug in the way
you are trying to: you must handle this case by longjumping out of
the signal handler. I've already sketched the correct design for
fixing this.

[to anybody in the peanut gallery who is thinking about pselect()
now: yes, you could perhaps hack something up with that, but it would
still be a big patch with a bunch of corner cases to review, and
it would only fix this bug for this particular syscall, not in
general.]

-- PMM

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/955379

Title:
  cmake hangs with qemu-arm-static

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/955379/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


Re: [Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static

2012-12-03 Thread agraf
On 01.12.2012, at 12:27, Peter Maydell wrote:

 On 1 December 2012 10:29, Janne Karhunen 955...@bugs.launchpad.net wrote:
 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
 
 Duh, makes sense, have to think about this. Thank you for great analysis
 :)
 
 Apparently have to dig into qemu's code to understand this better, but
 first thought was that do you think it would be possible to add some
 crude hack bit in qemu's signal handler which we could 'almost
 atomically' check prior to entering system poll/select/read/whatnot ?
 This bit would tell there are user signals queued and handlers should be
 executed first.. ?
 
 Nope, it's still not going to be non-racy that way (and it would still
 be a pretty invasive change so it doesn't really make it easier either
 I think).

Could you please try and see if this patch makes a difference?

http://repo.or.cz/w/qemu/agraf.git/patch/489924aa0115dc6cfcd4e91b0747da4ff8425d1f


Alex

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/955379

Title:
  cmake hangs with qemu-arm-static

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/955379/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


Re: [Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static

2012-12-03 Thread Peter Maydell
On 3 December 2012 21:20, Alexander Graf ag...@suse.de wrote:
 Could you please try and see if this patch makes a difference?

 http://repo.or.cz/w/qemu/agraf.git/patch/489924aa0115dc6cfcd4e91b0747da4ff8425d1f

I think the answer will turn out to be no (though it's worth
testing anyway), because the syscall we're blocking in in this
case is select(), which is a syscall which will exit when a
signal arrives anyway. That is, I think we're really hitting
the race condition of the signal arriving while we're in QEMU's
C code, rather than the stuck-in-blocking-syscall of the boehm
GC case.

-- PMM

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/955379

Title:
  cmake hangs with qemu-arm-static

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/955379/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


Re: [Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static

2012-12-01 Thread Peter Maydell
On 1 December 2012 10:29, Janne Karhunen 955...@bugs.launchpad.net wrote:
 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

 Duh, makes sense, have to think about this. Thank you for great analysis
 :)

 Apparently have to dig into qemu's code to understand this better, but
 first thought was that do you think it would be possible to add some
 crude hack bit in qemu's signal handler which we could 'almost
 atomically' check prior to entering system poll/select/read/whatnot ?
 This bit would tell there are user signals queued and handlers should be
 executed first.. ?

Nope, it's still not going to be non-racy that way (and it would still
be a pretty invasive change so it doesn't really make it easier either
I think).

-- PMM

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/955379

Title:
  cmake hangs with qemu-arm-static

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/955379/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


Re: [Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static

2012-11-28 Thread Peter Maydell
On 28 November 2012 08:42, Janne Karhunen 955...@bugs.launchpad.net wrote:
 Peter, I have qemu chrootable test case under which you could fire one
 command to hit the bug reliably. Only issue is, are you willing to take
 a peek at 100M extractable tarball? If not, I'll try to create a smaller
 one.

Yeah, 100M repro case tarball is manageable.

-- PMM

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/955379

Title:
  cmake hangs with qemu-arm-static

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/955379/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


Re: [Qemu-devel] [Bug 955379] Re: cmake hangs with qemu-arm-static

2012-11-25 Thread Peter Maydell
On 25 November 2012 20:40, Tim Penhey tim.pen...@canonical.com wrote:
 Peter, if you try to run the cmake file for lp:unity you should hit it.

I'm afraid that's way too little detail. Assume I know nothing about
launchpad, cmake or unity, and give me a set of instructions I
can run on a machine which isn't necessarily running ubuntu to
reproduce this, preferably with as small and limited a repro case
as possible. At least, it should be a command line that starts
out qemu some stuff...

thanks
-- PMM

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/955379

Title:
  cmake hangs with qemu-arm-static

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/955379/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs