From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHZaK-0001ox-0P for qemu-devel@nongnu.org; Thu, 05 Sep 2013 09:27:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHZaB-0002QG-Jg for qemu-devel@nongnu.org; Thu, 05 Sep 2013 09:26:55 -0400 Received: from mail-ea0-x233.google.com ([2a00:1450:4013:c01::233]:53786) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHZaB-0002Q6-Cc for qemu-devel@nongnu.org; Thu, 05 Sep 2013 09:26:47 -0400 Received: by mail-ea0-f179.google.com with SMTP id b10so890175eae.24 for ; Thu, 05 Sep 2013 06:26:46 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <52288696.1010007@redhat.com> Date: Thu, 05 Sep 2013 15:26:46 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <5824aebefdadb9beb24cda3fab0398931bedbfb1.1378383549.git.minovotn@redhat.com> In-Reply-To: <5824aebefdadb9beb24cda3fab0398931bedbfb1.1378383549.git.minovotn@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] vl.c: Implement SIGILL signal handler for triggering SIGSEGV List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michal Novotny Cc: qemu-devel@nongnu.org Il 05/09/2013 14:19, Michal Novotny ha scritto: > This is the patch to introduce SIGILL handler to be able to trigger > SIGSEGV signal in qemu. This has been written to help debugging > state when qemu crashes by SIGSEGV as a simple reproducer to > emulate such situation in case of need. What's wrong with "kill -11" or, within gdb, "j *0x1234"? Why do you need a SIGILL handler for this? In fact, SIGILL is a pretty bad choice: QEMU includes a JIT compiler, so a SIGILL is a relatively common thing to happen while debugging it. Also: (1) there is a known bug in qemu-thread-posix.c, which should not block SIGILL, SIGBUS, SIGSEGV, SIGFPE and SIGSYS. Without fixing that, this trick will only work for the iothread and not for the VCPU threads. If you can produce a patch for this, it would be very nice. > > + int *p = NULL; > + > + *p = 0xDEADBEEF; (2) This is undefined behavior. You probably want something like "volatile int *p = (volatile int *)(intptr_t)4;" instead. Paolo