Changing external screen resolution with dual monitors

Bug #1351890 reported by Guy Stone
52
This bug affects 6 people
Affects Status Importance Assigned to Milestone
GTK+
Fix Released
Medium
Ubuntu MATE
Fix Released
Medium
Martin Wimpress 
gtk+2.0 (Debian)
Fix Released
Unknown
gtk+2.0 (Ubuntu)
Fix Released
Medium
Unassigned
Precise
Fix Released
Medium
Vlad Orlov
Trusty
Fix Released
Medium
Vlad Orlov
mate-control-center (Ubuntu)
Fix Released
Medium
Martin Wimpress 

Bug Description

[Impact]

Due to a bug in GTK+2, mate-display-properties crashes when the screen resolution is changed *outside* of it (e.g. by changing the resolution not via that app, but somewhere else).

The attached patches fix the issue in GTK+2 and prevent crashing of m-d-p.

Since this issue caused much inconvenience for users, the fix should be backported to all current stable releases of Ubuntu.

[Test Case]

The easiest way to reproduce it is via Virtualbox:

1. Run mate-display-properties in the VM.
2. Make the VM go full-screen.
3. See m-d-p crash.

[Regression Potential]

After several months of testing the patched version of GTK+2 in Debian Jessie, I found no regressions.
I consider the regression risk very low here.

There were originally some bugs with a few applications (notably Spotify) crashing. We think we've backported patches to fix that - some refcounting issues - but please check a few apps to see they still work.

[ Original report ]

Changing extrnal screen resolution with dual mon

ProblemType: Crash
DistroRelease: Ubuntu 14.10
Package: mate-control-center 1.8.1+dfsg1-4
ProcVersionSignature: Ubuntu 3.16.0-6.11-generic 3.16.0-rc7
Uname: Linux 3.16.0-6-generic i686
ApportVersion: 2.14.5-0ubuntu3
Architecture: i386
CrashCounter: 1
Date: Sun Aug 3 07:09:21 2014
ExecutablePath: /usr/bin/mate-display-properties
InstallationDate: Installed on 2014-08-03 (0 days ago)
InstallationMedia: Ubuntu MATE 14.10 "Utopic Unicorn" - Alpha i386 (20140731)
ProcCmdline: mate-display-properties
SegvAnalysis: Skipped: missing required field "Disassembly"
Signal: 11
SourcePackage: mate-control-center
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo

Revision history for this message
Guy Stone (stoneguy3) wrote :
information type: Private → Public
Revision history for this message
Apport retracing service (apport) wrote :

StacktraceTop:
 ?? ()
 gdk_event_apply_filters (filters=<optimized out>, event=0x90aa720, xevent=0xbfb1f34c) at /build/buildd/gtk+2.0-2.24.24/gdk/x11/gdkevents-x11.c:356
 gdk_event_translate (display=display@entry=0x8f040a0, event=event@entry=0x90aa720, xevent=xevent@entry=0xbfb1f34c, return_exposes=return_exposes@entry=0) at /build/buildd/gtk+2.0-2.24.24/gdk/x11/gdkevents-x11.c:1052
 _gdk_events_queue (display=display@entry=0x8f040a0) at /build/buildd/gtk+2.0-2.24.24/gdk/x11/gdkevents-x11.c:2336
 gdk_event_dispatch (source=source@entry=0x8f0a1c8, callback=0x0, user_data=0x0) at /build/buildd/gtk+2.0-2.24.24/gdk/x11/gdkevents-x11.c:2397

Revision history for this message
Apport retracing service (apport) wrote : Stacktrace.txt
Revision history for this message
Apport retracing service (apport) wrote : StacktraceSource.txt
Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
Changed in mate-control-center (Ubuntu):
importance: Undecided → Medium
tags: removed: need-i386-retrace
Revision history for this message
Martin Wimpress  (flexiondotorg) wrote : Re: Changing extrnal screen resolution with dual mon

Added to the upstream issue tracker.

  * https://github.com/mate-desktop/mate-control-center/issues/48

Changed in ubuntu-mate:
status: New → Confirmed
Changed in mate-control-center (Ubuntu):
status: New → Confirmed
Changed in ubuntu-mate:
assignee: nobody → Stefano Karapetsas (stefano-karapetsas)
importance: Undecided → Medium
summary: - Changing extrnal screen resolution with dual mon
+ Changing external screen resolution with dual monitors
Revision history for this message
Vlad Orlov (monsta) wrote :

I suspect this is a bug in GTK+2, which is still not fixed upstream.
They've fixed it in GTK+3 only, that's why in MATE GTK+3 mate-display-properties doesn't crash.

I've linked the upstream bug report here.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gtk+2.0 (Ubuntu):
status: New → Confirmed
Changed in gtk:
importance: Unknown → Medium
status: Unknown → Fix Released
Vlad Orlov (monsta)
tags: added: precise trusty
Changed in gtk+2.0 (Ubuntu):
importance: Undecided → Medium
Vlad Orlov (monsta)
tags: added: vivid
Revision history for this message
Vlad Orlov (monsta) wrote :

Attached the patch for GTK+2 which makes gdk_event_apply_filters function safe against changes in filter list. This patch is cherry-picked from GTK+3 and adapted to GTK+2.

I've tested it in Precise, Trusty and Utopic. It applies cleanly in all three Ubuntu releases, and mate-display-properties doesn't crash anymore after GTK+2 is patched.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "This patch makes gdk_event_apply_filters function safe against changes in filter list." seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in gtk+2.0 (Debian):
status: Unknown → Confirmed
Revision history for this message
Martin Wimpress  (flexiondotorg) wrote :

This issue was fixed by the following upstream commit.

  * https://git.gnome.org/browse/gtk+/commit/?h=gtk-2-24&id=ee95f3d7259c0859ce41189b781b4339b4cd64aa

GTK 2.24.26 has since been released and incorporates the fix.

Changed in ubuntu-mate:
status: Confirmed → Triaged
assignee: Stefano Karapetsas (stefano-karapetsas) → Martin Wimpress (flexiondotorg)
Changed in mate-control-center (Ubuntu):
assignee: nobody → Martin Wimpress (flexiondotorg)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gtk+2.0 - 2.24.26-0ubuntu1

---------------
gtk+2.0 (2.24.26-0ubuntu1) vivid; urgency=medium

  * New upstream release.
    + Protect gdk_event_apply_filters_safe from changes in the filter list
    (LP: #1351890)
  * Now need to build with --enable-man to build the manpages, and build-dep
    on libxml2-utils to get xmlcatalog which configure uses to decide whether
    to build them.
 -- Iain Lane <email address hidden> Fri, 20 Feb 2015 17:48:37 +0000

Changed in gtk+2.0 (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Vlad Orlov (monsta) wrote :

Thanks.
Please apply the patch in Precise, Trusty and Utopic.

tags: removed: vivid
Revision history for this message
Vlad Orlov (monsta) wrote :
Revision history for this message
Vlad Orlov (monsta) wrote :
Revision history for this message
Vlad Orlov (monsta) wrote :
Changed in ubuntu-mate:
status: Triaged → Fix Released
Changed in mate-control-center (Ubuntu):
status: Confirmed → Fix Released
Changed in gtk+2.0 (Debian):
status: Confirmed → Fix Released
Revision history for this message
Sebastien Bacher (seb128) wrote :

That commit creates issues, for example the spotify linux client segfaults with it, see https://bugzilla.gnome.org/show_bug.cgi?id=745536

Revision history for this message
Iain Lane (laney) wrote :

I'm going to backport those extra commits now. If you want the SRU, please update those diffs too.

Revision history for this message
Vlad Orlov (monsta) wrote :

Update what?
The debdiffs are fine.

Revision history for this message
Vlad Orlov (monsta) wrote :
Revision history for this message
Vlad Orlov (monsta) wrote :

Iain, did you mean I need to include the new fix in the debdiffs as well?

Revision history for this message
Vlad Orlov (monsta) wrote :

Whoops, looks like there are two fixes actually, the second one is in https://git.gnome.org/browse/gtk%2B/commit/?id=22eb70adab72a5c14f063ea15f8195087ff1dcd8

Revision history for this message
Vlad Orlov (monsta) wrote :

Iain, I've seen you've added them in Debian Jessie and Ubuntu 15.04, thanks :)

Revision history for this message
Vlad Orlov (monsta) wrote :
Revision history for this message
Vlad Orlov (monsta) wrote :
Revision history for this message
Vlad Orlov (monsta) wrote :
Revision history for this message
Vlad Orlov (monsta) wrote :

[Impact]

Due to a bug in GTK+2, mate-display-properties crashes when the screen resolution is changed *outside* of it (e.g. by changing the resolution not via that app, but somewhere else).

The attached patches fix the issue in GTK+2 and prevent crashing of m-d-p.

Since this issue caused much inconvenience for users, the fix should be backported to all current stable releases of Ubuntu.

[Test Case]

The easiest way to reproduce it is via Virtualbox:

1. Run mate-display-properties in the VM.
2. Make the VM go full-screen.
3. See m-d-p crash.

[Regression Potential]

After several months of testing the patched version of GTK+2 in Debian Jessie, I found no regressions.
I consider the regression risk very low here.

Revision history for this message
Vlad Orlov (monsta) wrote :

There we go. All three debdiffs have been updated to include two more patches mentioned in the comments above (thanks to Sebastien Bacher and Iain Lane).

Revision history for this message
Vlad Orlov (monsta) wrote :

Hmm, not sure why Ubuntu Sponsors Team wasn't auto-subscribed after my debdiffs. Ok, fixed that manually.

Revision history for this message
Vlad Orlov (monsta) wrote :

Any progress on reviewing the debdiffs?

Revision history for this message
Iain Lane (laney) wrote :

sorry, I forgot to subscribe so I wasn't getting emails from this bug. Seb just pointed me to it again.

I'm going to look at your diffs now.

Iain Lane (laney)
Changed in mate-control-center (Ubuntu Precise):
status: New → Invalid
Changed in mate-control-center (Ubuntu Trusty):
status: New → Invalid
Iain Lane (laney)
description: updated
Revision history for this message
Iain Lane (laney) wrote :

uploaded, thanks!

Changed in gtk+2.0 (Ubuntu Precise):
status: New → In Progress
Changed in gtk+2.0 (Ubuntu Trusty):
status: New → In Progress
Changed in gtk+2.0 (Ubuntu Precise):
assignee: nobody → Monsta (monsta-mint)
Changed in gtk+2.0 (Ubuntu Trusty):
assignee: nobody → Monsta (monsta-mint)
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Guy, or anyone else affected,

Accepted gtk+2.0 into precise-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gtk+2.0/2.24.10-0ubuntu6.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in gtk+2.0 (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Vlad Orlov (monsta) wrote :

Looks good in Precise, waiting for Trusty package so I could tag it as verification-done.

Revision history for this message
Sebastien Bacher (seb128) wrote :

the trusty SRU is waiting for review from the SRU team
https://launchpad.net/ubuntu/trusty/+queue?queue_state=1&queue_text=gtk

Mathew Hodson (mhodson)
no longer affects: mate-control-center (Ubuntu Precise)
no longer affects: mate-control-center (Ubuntu Trusty)
Changed in gtk+2.0 (Ubuntu Precise):
importance: Undecided → Medium
Changed in gtk+2.0 (Ubuntu Trusty):
importance: Undecided → Medium
Revision history for this message
xiaoyiwu (xiaoyiwu) wrote :

this bug is exist in gtk+2.0-2.24.25

Revision history for this message
xiaoyiwu (xiaoyiwu) wrote :

(gdb) bt
#0 0x00000000007c8030 in ?? ()
#1 0x00007ffff652c073 in gdk_event_apply_filters (filters=0x8dcf80,
    event=<optimized out>, xevent=<optimized out>)
    at /build/buildd/gtk+2.0-2.24.25/gdk/x11/gdkevents-x11.c:356
#2 gdk_event_translate (display=0x669020, event=0x8c9c80,
    xevent=0x7fffffffdc20, return_exposes=9324560, return_exposes@entry=0)
    at /build/buildd/gtk+2.0-2.24.25/gdk/x11/gdkevents-x11.c:1052
#3 0x00007ffff652d696 in _gdk_events_queue (display=display@entry=0x669020)
    at /build/buildd/gtk+2.0-2.24.25/gdk/x11/gdkevents-x11.c:2336
#4 0x00007ffff652d73e in gdk_event_dispatch (source=<optimized out>,
    callback=<optimized out>, user_data=<optimized out>)
    at /build/buildd/gtk+2.0-2.24.25/gdk/x11/gdkevents-x11.c:2397
#5 0x00007ffff507ec5d in g_main_context_dispatch ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6 0x00007ffff507ef48 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7 0x00007ffff507f272 in g_main_loop_run ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8 0x00007ffff68b8747 in IA__gtk_main ()
    at /build/buildd/gtk+2.0-2.24.25/gtk/gtkmain.c:1271

Revision history for this message
Vlad Orlov (monsta) wrote :

The fix for Trusty is still in that queue - did something wrong happened?

Revision history for this message
xiaoyiwu (xiaoyiwu) wrote :

add a monitor in utopic!

Revision history for this message
Vlad Orlov (monsta) wrote :
Revision history for this message
Vlad Orlov (monsta) wrote :

Guys, please do something for Trusty...

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello Guy, or anyone else affected,

Accepted gtk+2.0 into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gtk+2.0/2.24.23-0ubuntu1.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in gtk+2.0 (Ubuntu Trusty):
status: In Progress → Fix Committed
Revision history for this message
Vlad Orlov (monsta) wrote :

Looks good in Trusty. Since Precise has the fix in -proposed already as well, tagging it as verification-done.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gtk+2.0 - 2.24.10-0ubuntu6.2

---------------
gtk+2.0 (2.24.10-0ubuntu6.2) precise; urgency=low

  * fix_gdk_event_apply_filters.patch: new patch. Makes gdk_event_apply_filters
    function safe against changes in the filter list, prevents weird crashes in
    various apps. (LP: #1351890)
  * gdk-Fix-GdkWindowFilter-internal-refcounting.patch,
    gdkwindow-Fix-event-unref-iteration.patch: new patches. Fix refcounting
    errors after fix_gdk_event_apply_filters.patch, prevent crashes in some
    applications like Spotify.

 -- Vlad Orlov <email address hidden> Tue, 28 Jul 2015 10:11:37 +0100

Changed in gtk+2.0 (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for gtk+2.0 has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gtk+2.0 - 2.24.23-0ubuntu1.3

---------------
gtk+2.0 (2.24.23-0ubuntu1.3) trusty; urgency=medium

  * fix_gdk_event_apply_filters.patch: new patch. Makes gdk_event_apply_filters
    function safe against changes in the filter list, prevents weird crashes in
    various apps. (LP: #1351890)
  * gdk-Fix-GdkWindowFilter-internal-refcounting.patch,
    gdkwindow-Fix-event-unref-iteration.patch: new patches. Fix refcounting
    errors after fix_gdk_event_apply_filters.patch, prevent crashes in some
    applications like Spotify.

 -- Vlad Orlov <email address hidden> Tue, 28 Jul 2015 10:17:14 +0100

Changed in gtk+2.0 (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Vlad Orlov (monsta) wrote :

Thanks! :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.