qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Michal Novotny <minovotn@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] vl.c: Implement SIGILL signal handler for triggering SIGSEGV
Date: Thu, 05 Sep 2013 15:26:46 +0200	[thread overview]
Message-ID: <52288696.1010007@redhat.com> (raw)
In-Reply-To: <5824aebefdadb9beb24cda3fab0398931bedbfb1.1378383549.git.minovotn@redhat.com>

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

  reply	other threads:[~2013-09-05 13:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-05 12:19 [Qemu-devel] [PATCH] vl.c: Implement SIGILL signal handler for triggering SIGSEGV Michal Novotny
2013-09-05 13:26 ` Paolo Bonzini [this message]
2013-09-05 22:37   ` Laszlo Ersek
2013-09-05 22:50 ` Anthony Liguori
2013-09-05 23:06   ` Eric Blake
2013-09-06 13:24   ` Michal Novotny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52288696.1010007@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=minovotn@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).