qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Stefan Priebe - Profihost AG <s.priebe@profihost.ag>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	"pve-devel@pve.proxmox.com" <pve-devel@pve.proxmox.com>
Subject: Re: [Qemu-devel] kvm process disappears
Date: Fri, 10 May 2013 13:09:43 +0200	[thread overview]
Message-ID: <CAJSP0QVcmySJSwcXLLTPdiwFUYR-OLjTJan+V0M3QSn9AAV5iQ@mail.gmail.com> (raw)
In-Reply-To: <518CB8E4.5090305@profihost.ag>

On Fri, May 10, 2013 at 11:07 AM, Stefan Priebe - Profihost AG
<s.priebe@profihost.ag> wrote:
> Am 10.05.2013 09:42, schrieb Stefan Hajnoczi:
>> On Fri, May 10, 2013 at 08:12:39AM +0200, Stefan Priebe - Profihost AG wrote:
>> 3. Either use gdb or an LD_PRELOAD library that catches exit(3) and
>>    _exit(2) and dumps core using abort(3).  Make sure core dumps are
>>    enabled.
>
> LD_PRELOAD sounds good can you point me to such a lib?

$ cat /tmp/catchexit.c
#include <unistd.h>
#include <stdlib.h>

void exit(int status)
{
    const char msg[] = "*** CAUGHT EXIT, DUMPING CORE ***\n";
    write(2, msg, sizeof msg);
    abort();
}

void _exit(int status) __attribute__((alias("exit")));

$ gcc -o catchexit.so -shared -fPIC -std=gnu99 catchexit.c

$ LD_PRELOAD=/tmp/catchexit.so x86_64-softmmu/qemu-system-x86_64 -m
1024 -enable-kvm -cpu host -vga asdf
Unknown vga type: asdf
*** CAUGHT EXIT, DUMPING CORE ***
Aborted (core dumped)

Make sure to give the absolute path to catchexit.so.  Also keep in
mind that this does not catch a normal return from main() or possibly
other ways of terminating the process.

You can hook more library functions, if necessary.

Stefan

  reply	other threads:[~2013-05-10 11:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-10  6:12 [Qemu-devel] kvm process disappears Stefan Priebe - Profihost AG
2013-05-10  7:15 ` [Qemu-devel] [pve-devel] " Alexandre DERUMIER
2013-05-10  7:20 ` Alexandre DERUMIER
2013-05-10  7:22   ` Stefan Priebe - Profihost AG
2013-05-10  7:28     ` Alexandre DERUMIER
2013-05-10  9:06       ` Stefan Priebe - Profihost AG
2013-05-10  7:42 ` [Qemu-devel] " Stefan Hajnoczi
2013-05-10  9:07   ` Stefan Priebe - Profihost AG
2013-05-10 11:09     ` Stefan Hajnoczi [this message]
2013-05-14 14:29       ` [Qemu-devel] segfault in aio_bh_poll async.c:80 WAS: " Stefan Priebe - Profihost AG
2013-05-14 15:05         ` Stefan Hajnoczi
2013-05-14 15:11           ` Stefan Priebe - Profihost AG
2013-05-22  6:26             ` Stefan Priebe - Profihost AG
2013-05-22  8:41               ` Paolo Bonzini
2013-05-22 12:24                 ` Stefan Priebe - Profihost AG
2013-05-23 10:09                   ` Paolo Bonzini
2013-05-23 19:22                     ` Stefan Priebe
2013-05-27 21:09       ` [Qemu-devel] " Stefan Priebe
2013-05-28  8:06         ` Stefan Hajnoczi

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=CAJSP0QVcmySJSwcXLLTPdiwFUYR-OLjTJan+V0M3QSn9AAV5iQ@mail.gmail.com \
    --to=stefanha@gmail.com \
    --cc=pve-devel@pve.proxmox.com \
    --cc=qemu-devel@nongnu.org \
    --cc=s.priebe@profihost.ag \
    /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).