GNOME Bugzilla – Bug 623235
BadDamage error from XSubtractDamage
Last modified: 2010-09-15 21:05:23 UTC
Created attachment 164990 [details] bt * Laptop (closed) undocked * Suspends * Hours later is resumed * Screen is not locked but keyboard and pointer are grabbed * Screen is not updating (time is still hours earlier) * gnome-screensaver-gl-helper is stuck (https://bugzilla.gnome.org/show_bug.cgi?id=621053) * Killing gnome-screensaver-gl-helper causes the screen to lock * Unlock the screen * Shell crashes - bt attached -- Owen says: It's a BadDamage error from XSubtractDamage, so probably means we need: if (priv->received_damage) { + meta_error_trap_push (display); XDamageSubtract (xdisplay, priv->damage, None, None); + meta_error_trap_pop (display, FALSE); priv->received_damage = FALSE; } In mutter-window.c. (I'm thinking that X must destroy the damage object when the window is destroyed? A bit annoying to have to add a round-trip like the above.)
*** Bug 623245 has been marked as a duplicate of this bug. ***
Created attachment 166235 [details] [review] Silently drop BadDamage errors The call to XDamageSubtract in mutter_window_pre_paint might end create a BadDamage in when the window goes away. Set up a custom error handler to catch BadDamage errors and silently ignore them to avoid having to take a roundtrip here.
Created attachment 166236 [details] [review] Silently drop BadDamage errors The call to XDamageSubtract in mutter_window_pre_paint might end up create a BadDamage in when the window goes away. Set up a custom error handler to catch BadDamage errors and silently ignore them to avoid having to take a roundtrip here.
Review of attachment 166236 [details] [review]: Sorry about the slow response on this one - the patch looks like it should work fine. *But* Metacity and Mutter are full of things that might possibly generate X errors, and we don't use this approach anywhere else - we don't blanket ignore any other type of errors. This was an explicit design choice compared to some other window managers (Enlightenment in particular) that just globally trapped and ignored all errors. Blanket ignoring X errors was considered to be a good way of having code that was just entirely wrong and never noticing. So, I think I'd rather just eat the round-trip here and do the same thing as the rest of Mutter with errors traps. If profiling/testing showed that to be a problem, then luminocity (git://git.gnome.org/archive/luminocity) has an "async error trap" implementation that we could borrow for Metacity - the way it works is that it keeps track of when errors were trapped and compares received errors against that historical record.
Created attachment 168589 [details] [review] Trap xerrors in mutter_window_pre_paint XDamageSubstract can create a BadDamage (when the window goes away before XDamageSubstract is called) and thus resulting into a crash. Fix it by protecting the call with an error trap.
Comment on attachment 168589 [details] [review] Trap xerrors in mutter_window_pre_paint Attachment 168589 [details] pushed as 2a54baf - Trap xerrors in mutter_window_pre_paint --- For the record we went with the straight forward approuch here to fix the crash if the roundtrip really hurts we can revisit it later.