From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xi091-00011x-7S for qemu-devel@nongnu.org; Sat, 25 Oct 2014 08:08:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xi08v-0002zt-BB for qemu-devel@nongnu.org; Sat, 25 Oct 2014 08:08:31 -0400 Received: from mout.web.de ([212.227.15.4]:62685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xi08v-0002zp-1W for qemu-devel@nongnu.org; Sat, 25 Oct 2014 08:08:25 -0400 Message-ID: <544B92B3.3060203@web.de> Date: Sat, 25 Oct 2014 14:08:19 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1411660269-11081-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LL09wfQ124cDV1PS4pGAI6N2giduITPlH" Subject: Re: [Qemu-devel] [PATCH] main-loop.c: Handle SIGINT, SIGHUP and SIGTERM synchronously List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gonglei , 'Peter Maydell' , qemu-devel@nongnu.org Cc: 'Paolo Bonzini' , =?UTF-8?B?J0FsZXggQmVubsOpZSc=?= , 'Stefan Hajnoczi' , patches@linaro.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --LL09wfQ124cDV1PS4pGAI6N2giduITPlH Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2014-10-25 13:34, Gonglei wrote: > Hi, >=20 >> Subject: [Qemu-devel] [PATCH] main-loop.c: Handle SIGINT, SIGHUP and >> SIGTERM synchronously >> >> Add the termination signals SIGINT, SIGHUP and SIGTERM to the >> list of signals which we handle synchronously via a signalfd. >> This avoids a race condition where if we took the SIGTERM >> in the middle of qemu_shutdown_requested: >> int r =3D shutdown_requested; >> [SIGTERM here...] >> shutdown_requested =3D 0; >> >> then the setting of the shutdown_requested flag by >> termsig_handler() would be lost and QEMU would fail to >> shut down. This was causing 'make check' to hang occasionally. >> >> Signed-off-by: Peter Maydell >=20 > I met a really upset thing after this patch, which I can't using gdb de= bug > Qemu process well. I use gdb attaching a Qemu process, and press 'c' to= continue > executing. When I want to set a breakpoint for debugging, then press 'c= trl + c', > the Qemu will exit, because the SIGINT signal is captured by Qemu now. = :( >=20 > What's your opinion? Thanks. Confirmed, you cannot interrupt a running qemu from gdb anymore. I think this patch has to be reverted and the original issue fixed by making qemu_shutdown_requested signal-safe. Should be simple, just convert shutdown_requested into a counter. Need not be atomic, all happens over the main thread anyway. Jan --LL09wfQ124cDV1PS4pGAI6N2giduITPlH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iEYEARECAAYFAlRLkrUACgkQitSsb3rl5xRjRQCgt32AaJwx6IeOirDufPUi0WDf uXYAoLHOhsOCzvOFMXFh8VvwsA0fawWe =2txw -----END PGP SIGNATURE----- --LL09wfQ124cDV1PS4pGAI6N2giduITPlH--