From 6e4579b32be125cab74d4ad2014fda201d6531c1 Mon Sep 17 00:00:00 2001 From: Jeff Dike Date: Wed, 23 Jun 2010 17:29:54 +0100 Subject: qemu: Work around the crash seen on Ubuntu. Due to different stack contents in sdl_display_init on Ubuntu vs other distros, an uninitialized structure is causing a crash. Zeroing the structure makes the behavior uniform across distros, avoiding the Ubuntu crash, but doesn't fix the underlying bugs, notably: the return value of SDL_GetWMInfo needs to be checked, as it's currently failing silently the underlying reason for the failure of SDL_GetWMInfo needs to be found - there is a GetWMINfo method in the internal SDL structure which is NULL, and the reason for this needs to be found. Signed-off-by: Jeff Dike --- meta/packages/qemu/qemu-0.12.4/init-info.patch | 16 ++++++++++++++++ meta/packages/qemu/qemu_0.12.4.bb | 1 + 2 files changed, 17 insertions(+) create mode 100644 meta/packages/qemu/qemu-0.12.4/init-info.patch diff --git a/meta/packages/qemu/qemu-0.12.4/init-info.patch b/meta/packages/qemu/qemu-0.12.4/init-info.patch new file mode 100644 index 0000000000..8ba7d8ff4c --- /dev/null +++ b/meta/packages/qemu/qemu-0.12.4/init-info.patch @@ -0,0 +1,16 @@ +# This is a workaround to the crashes seen on Ubuntu. Setting info to zero +# makes info.info.x11.display zero and avoids the calls to +# opengl_exec_set_parent_window, one of which is crashing. + +Index: qemu-0.12.4/sdl.c +=================================================================== +--- qemu-0.12.4.orig/sdl.c ++++ qemu-0.12.4/sdl.c +@@ -871,6 +871,7 @@ void sdl_display_init(DisplayState *ds, + vi = SDL_GetVideoInfo(); + host_format = *(vi->vfmt); + ++ bzero(&info, sizeof(info)); + SDL_GetWMInfo(&info); + if (info.subsystem == SDL_SYSWM_X11 && info.info.x11.display) + opengl_exec_set_parent_window(info.info.x11.display, diff --git a/meta/packages/qemu/qemu_0.12.4.bb b/meta/packages/qemu/qemu_0.12.4.bb index 79b73d38ad..f1ecf3c067 100644 --- a/meta/packages/qemu/qemu_0.12.4.bb +++ b/meta/packages/qemu/qemu_0.12.4.bb @@ -14,5 +14,6 @@ SRC_URI = "\ file://fix-nogl.patch \ file://qemugl-allow-glxcontext-release.patch \ file://linker-flags.patch" + file://init-info.patch;patch=1" S = "${WORKDIR}/qemu-${PV}" -- cgit v1.2.3-54-g00ecf