]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
linux-user: remove signal handler before calling abort()
authorRiku Voipio <riku.voipio@nokia.com>
Mon, 25 Jan 2010 12:30:49 +0000 (14:30 +0200)
committerRiku Voipio <riku.voipio@nokia.com>
Fri, 5 Feb 2010 12:50:58 +0000 (14:50 +0200)
Qemu may hang in host_signal_handler after qemu has done a
seppuku with cpu_abort(). But at this stage we are not really
interested in target process coredump anymore, so unregister
host_signal_handler to die grafefully.

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
exec.c

diff --git a/exec.c b/exec.c
index 431e104a1c7c5b16c47a84790f693a716ede66dc..eeb17d09fbd9fb34b046e6bacda368c755a8d0ff 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -40,6 +40,7 @@
 #include "kvm.h"
 #if defined(CONFIG_USER_ONLY)
 #include <qemu.h>
+#include <signal.h>
 #endif
 
 //#define DEBUG_TB_INVALIDATE
@@ -1692,6 +1693,14 @@ void cpu_abort(CPUState *env, const char *fmt, ...)
     }
     va_end(ap2);
     va_end(ap);
+#if defined(CONFIG_USER_ONLY)
+    {
+        struct sigaction act;
+        sigfillset(&act.sa_mask);
+        act.sa_handler = SIG_DFL;
+        sigaction(SIGABRT, &act, NULL);
+    }
+#endif
     abort();
 }