[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] vl.c: Implement SIGILL signal handler for trigg

From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] vl.c: Implement SIGILL signal handler for triggering SIGSEGV
Date: Thu, 05 Sep 2013 15:26:46 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8

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.


(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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]