qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu


From: Paolo Bonzini
Subject: Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort()
Date: Wed, 17 Mar 2010 10:10:10 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.3

On 03/16/2010 06:55 PM, Jamie Lokier wrote:
A guest program is also allowed to trap SIGABRT with a signal handler,
and that does have some uses.  E.g. cleaning up temporary files and
shmem segments following a crash when calling 3rd party code.

Whatever the guest does with SIGABRT, it should not result in_QEMU_
crashing - whether due to abort() returning, or QEMU's control flow
jumping to the guest's signal handler from an unexpected location.

That's very hard to ensure however if QEMU was already in unstable state, as witnessed by its call to abort(). Things can only go downhill.

Maybe there should be a qemu_abort wrapper (and a QEMU_ASSERT companion) that does simply abort/assert under system emulation, but under user-mode emulation does

  signal (SIGABRT, SIG_DFL);
  abort ();

Paolo




reply via email to

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