? sdl.c.diff
Index: sdl.c
===================================================================
RCS file: /sources/qemu/qemu/sdl.c,v
retrieving revision 1.37
diff -u -r1.37 sdl.c
--- sdl.c	2 Apr 2007 01:10:46 -0000	1.37
+++ sdl.c	24 Apr 2007 06:15:19 -0000
@@ -563,10 +563,17 @@
     SDL_Quit();
 }
 
+static void segv_exit(void)
+{
+	sdl_cleanup();
+	exit(255);
+}
+
 void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
 {
     int flags;
     uint8_t data = 0;
+    struct sigaction act;
 
 #if defined(__APPLE__)
     /* always use generic keymaps */
@@ -582,6 +589,11 @@
     if (no_frame)
         gui_noframe = 1;
 
+    act.sa_flags = 0;
+    act.sa_handler = segv_exit;
+
+    sigaction(SIGSEGV, &act, NULL);
+
     flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE;
     if (SDL_Init (flags)) {
         fprintf(stderr, "Could not initialize SDL - exiting\n");
