From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mw0qc-0002G0-Gx for qemu-devel@nongnu.org; Thu, 08 Oct 2009 17:48:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mw0qX-0002BS-QP for qemu-devel@nongnu.org; Thu, 08 Oct 2009 17:48:29 -0400 Received: from [199.232.76.173] (port=38930 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mw0qX-0002B8-CJ for qemu-devel@nongnu.org; Thu, 08 Oct 2009 17:48:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39829) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mw0qW-0004XM-TA for qemu-devel@nongnu.org; Thu, 08 Oct 2009 17:48:25 -0400 Date: Thu, 8 Oct 2009 23:46:06 +0200 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] Re: [PATCH] qemu: work around for "posix-aio-compat" Message-ID: <20091008214606.GA8580@redhat.com> References: <20091008203740.GA20727@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: qemu-devel@nongnu.org On Fri, Oct 09, 2009 at 01:13:12AM +0400, malc wrote: > On Fri, 9 Oct 2009, malc wrote: > > > On Thu, 8 Oct 2009, Michael S. Tsirkin wrote: > > > > > With commit ee3993069ff55fa6f1c64daf1e09963e340db8e4, > > > "posix-aio-compat: avoid signal race when spawning a thread" > > > winxp installation on a raw format file fails > > > during disk format, with a message "your > > > disk may be damaged". > > > > > > This commit moved signal mask from aio thread to creating thread. > > > It turns out if we keep the mask in aio thread as well, the problem > > > disappears. It should not be needed, but since this is harmless, let's > > > keep it around until someone inclined to debug pthread library internals > > > can check this issue. > > > > > > While we are at it, convert sigprocmask to pthread_sigmask > > > as per posix. > > > > Thanks for the work you've put into it, i'll try to see how all of this > > works on my x86 machine. > > > > [..snip..] > > Nope, still can not reproduce... So indeed it appears someone is needed, > who: > > a. Can reproduce > b. Cares > > FWIW, in essence sigfillset is this: > > # define __sigfillset(set) \ > (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ > sigset_t *__set = (set); \ > while (--__cnt >= 0) __set->__val[__cnt] = ~0UL; \ > 0; })) > > So the thing that works for you can be replaced with some dummy loop > or something, Exactly. I just did this: sigset_t xset; static void *aio_thread(void *unused) { pid_t pid; sigset_t set; /* block all signals */ /* Should not be necessary as we should inherit mask * from creating thread. However, without this, * on FC11, WinXP installation fails during disk format * saying disk was damaged. pthread library bug? * */ memset(&set, 0, sizeof set); memcpy(&xset, &set, sizeof set); and it also helps. > IOW not good enough, we need to understand the problem, > and as mentioned above, i can not be of any help here, can't repro, > sorry. > > -- > mailto:av1474@comtv.ru