workbench crashes metacity on ubuntu 16.04

Bug #1582687 reported by Dantali0n
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
metacity (Ubuntu)
Fix Released
High
Dmitry Shachnev
Xenial
Fix Released
High
Dmitry Shachnev
Yakkety
Fix Released
High
Dmitry Shachnev

Bug Description

[Impact]
Metacity can crash with XError (BadRegion) sometimes when closing windows.

This, in turn, can lead gnome-session to forcefully stop the session.

[Test Case 1]
Described in comment #3.

[Test Case 2]
* Launch LibreOffice Writer.
* Add a table to a document.
* Open "Border Style" popup window from the table toolbar.
* Wait for the window to appear and then quickly close it.
* If Metacity does not crash, repeat the process several times.

[Regression Potential]
The fix is small (just adding an error trap) and will not cause any regressions.

-----------------------------------------------------------------------------

I installed mysql-workbench and gnome-session-flashback on ubuntu 16.04 and whenever I start mysql-workbench metacity or X11 but I think metacity crashes and I am returned to the login screen after a few seconds.

I am uncertain if mysql-workbench works in the default unity configuration as after installing gnome-session-flashback I can no longer login to the default unity experience.

My mysql-workbench logs where not really helpfull but if you would really like them I could include them.

I also tried to compile mysql-workbench from source but the gtk2 version included with ubuntu 16.04 seems to be incompatible due to the deprecation of a data type: GdkPixBuf

ubuntu version - 16.04
package - mysql-workbench 6.3.6 amd64
what i expected - open mysql workbench
what happened - black screen and returned to login

Dantali0n (dantalion)
description: updated
Dantali0n (dantalion)
description: updated
Dantali0n (dantalion)
description: updated
Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Just installed mysql-workbench and I can not reproduce crash. Is you metacity upgraded to 1:3.18.4-0ubuntu0.1?

Revision history for this message
Dantali0n (dantalion) wrote :

Yes my metacity version is: 1:3.18.4-0ubuntu0.1
I will do a fresh install of ubuntu 16.04 to see if I can reproduce these crashes.
(I have a backup of logs and configs etc)

Revision history for this message
Dantali0n (dantalion) wrote :

Just did a complete fresh install of ubuntu 16.04 X64.

performed sudo apt-get update & upgrade.
installed gnome-session-flashback apache2 mysql-server mysql-workbench (in that order).
launched mysql-workbench.
opened the default connection and entered mysql root password.
crash and returned to login screen (some message about 'priv hub0' appeared very shortly).

This are some lines from kern.log which stood out to me:
May 19 19:50:04 c2c gnome-session-binary[23888]: Entering running state
May 19 19:50:24 c2c kernel: [ 903.012513] traps: metacity[23936] trap int3 ip:7f133f9809eb sp:7fff8b63aaf0 error:0
May 19 19:50:26 c2c gnome-session-binary[23888]: Unrecoverable failure in required component metacity.desktop
May 19 19:50:27 c2c kernel: [ 905.649222] nouveau 0000:01:00.0: DRM: resuming kernel object tree...
May 19 19:50:27 c2c kernel: [ 905.649222] nouveau 0000:01:00.0: DRM: resuming kernel object tree...
May 19 19:50:27 c2c kernel: [ 905.752448] nouveau 0000:01:00.0: priv: HUB0: 10ecc0 ffffffff (1b40822c)
May 19 19:50:27 c2c kernel: [ 905.797314] nouveau 0000:01:00.0: DRM: resuming client object trees...
May 19 19:50:32 c2c kernel: [ 910.796784] ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
May 19 19:50:32 c2c kernel: [ 910.796914] ACPI: \_SB_.PCI0.PEG0.PEGP: failed to evaluate _DSM
May 19 19:50:32 c2c kernel: [ 910.796919] ACPI Warning: \_SB_.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
May 19 19:50:32 c2c kernel: [ 910.797104] nouveau 0000:01:00.0: DRM: evicting buffers...
May 19 19:50:32 c2c kernel: [ 910.797107] nouveau 0000:01:00.0: DRM: waiting for kernel channels to go idle...
May 19 19:50:32 c2c kernel: [ 910.797125] nouveau 0000:01:00.0: DRM: suspending client object trees...
May 19 19:50:32 c2c kernel: [ 910.798520] nouveau 0000:01:00.0: DRM: suspending kernel object tree...
May 19 19:50:41 c2c gnome-session-binary[24633]: Entering running state

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Can you get stacktrace?

Revision history for this message
Dantali0n (dantalion) wrote :

Stacktrace:
 #0 0x00007fef720639eb in g_logv () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
 No symbol table info available.
 #1 0x00007fef72063b5f in g_log () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
 No symbol table info available.
 #2 0x00007fef74348f68 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
 No symbol table info available.
 #3 0x00007fef743541c9 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
 No symbol table info available.
 #4 0x00007fef71b0dc4d in _XError () from /usr/lib/x86_64-linux-gnu/libX11.so.6
 No symbol table info available.
 #5 0x00007fef71b0aad7 in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
 No symbol table info available.
 #6 0x00007fef71b0ab95 in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
 No symbol table info available.
 #7 0x00007fef71b0b6ed in _XReadEvents () from /usr/lib/x86_64-linux-gnu/libX11.so.6
 No symbol table info available.
 #8 0x00007fef71b09b60 in XWindowEvent () from /usr/lib/x86_64-linux-gnu/libX11.so.6
 No symbol table info available.
 #9 0x000000000041ed27 in ?? ()
 No symbol table info available.
 #10 0x0000000000423509 in ?? ()
 No symbol table info available.
 #11 0x00000000004671e5 in ?? ()
 No symbol table info available.
 #12 0x00007fef7434eb11 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
 No symbol table info available.
 #13 0x00007fef7434edd0 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
 No symbol table info available.
 #14 0x00007fef74320ff9 in gdk_display_get_event () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
 No symbol table info available.
 #15 0x00007fef7434eb92 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
 No symbol table info available.
 #16 0x00007fef7205d127 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
 No symbol table info available.
 #17 0x00007fef7205d380 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
 No symbol table info available.
 #18 0x00007fef7205d6a2 in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
 No symbol table info available.
 #19 0x00000000004111f1 in ?? ()
 No symbol table info available.
 #20 0x00007fef70dea830 in __libc_start_main (main=0x4109b0, argc=1, argv=0x7ffec1ce1268, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffec1ce1258) at ../csu/libc-start.c:291
         result = <optimized out>
         unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, -6683134118778485444, 4265328, 140732149928544, 0, 0, 6682567775156323644, 6673874902473917756}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x468320, 0x7fef757468e0 <_dl_fini>}, data = {prev = 0x0, cleanup = 0x0, canceltype = 4621088}}}
         not_first_call = <optimized out>
 #21 0x0000000000411599 in ?? ()
 No symbol table info available.

Revision history for this message
Dantali0n (dantalion) wrote :

That one was made by apport but I realise now it may be pretty useless so I installed all dbg packages I could find and made gdb write the stack to a output file with the following results:

Thread 1 "metacity" received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff47049eb in _g_log_abort (breakpoint=1)
    at /build/glib2.0-t9oPgV/glib2.0-2.48.0/./glib/gmessages.c:325
325 /build/glib2.0-t9oPgV/glib2.0-2.48.0/./glib/gmessages.c: No such file or directory.

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

"opened the default connection and entered mysql root password."

This should have been in bug report. Now I can reproduce crash... I found were it crashes, but right now I don't know how to correctly fix it...

You can use this to fix crash:
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c
index a9e1de4..364b6cd 100644
--- a/src/compositor/compositor-xrender.c
+++ b/src/compositor/compositor-xrender.c
@@ -1956,7 +1956,10 @@ free_win (MetaCompWindow *cw,

   if (cw->picture)
     {
+ meta_error_trap_push (display);
       XRenderFreePicture (xdisplay, cw->picture);
+ meta_error_trap_pop (display, FALSE);
+
       cw->picture = None;
     }

affects: mysql-workbench (Ubuntu) → metacity (Ubuntu)
Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Dmitry, this is fixed now upstream with this commit:
https://git.gnome.org/browse/metacity/commit/?h=gnome-3-18&id=1243d34816398ec9014115d4582a83ec5b84d5d0

Can you add this to 16.10 and 16.04?

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Will do when I have time.

Changed in metacity (Ubuntu Xenial):
assignee: nobody → Dmitry Shachnev (mitya57)
Changed in metacity (Ubuntu Yakkety):
assignee: nobody → Dmitry Shachnev (mitya57)
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Funny enough, I just lost some unsaved work in Libreoffice because of this Metacity crash. Also I can reliably reproduce it by opening and quickly closing the "table cell border style" popup window in LibreOffice Writer.

Looks like I should find time for this upload sooner :)

Changed in metacity (Ubuntu Xenial):
importance: Undecided → High
Changed in metacity (Ubuntu Yakkety):
importance: Undecided → High
Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Can you get stacktrace when you use metacity with --sync? Just to know if this is same bug/crash...

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

The same. It's XError in free_win function and your commit fixes it.

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Ok. I guess you will add that patch in debian too, right? Do you need new release? There was few other fixes in gnome-3-18 branch.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

I will add it to Debian too unless you plan to release 3.20.0 soon.

Do you want me to cherry-pick the other fixes too? That will be 16.10 and Debian only unless they are important (and have a test case).

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Metacity 3.20 release depends on how fast I can make all needed changes in compiz, but I hope I can release 3.20 soon.

For debian and 16.10 you can definitely add other fixes. :) Other fixes might be good to add also in 16.04, but they might not be very important. Upstream bugs have steps how to reproduce.

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

This bug was fixed in the package metacity - 1:3.18.4-2ubuntu1

---------------
metacity (1:3.18.4-2ubuntu1) yakkety; urgency=medium

  * Merge with Debian unstable, remaining changes:
    - debian/metacity-common.links: Show keybindings in Unity control center.
    - debian/metacity-common.gsettings-override: Change the default theme to
      Ambiance.

 -- Dmitry Shachnev <email address hidden> Thu, 26 May 2016 17:10:54 +0300

Changed in metacity (Ubuntu Yakkety):
status: New → Fix Released
description: updated
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Dantali0n, or anyone else affected,

Accepted metacity into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/metacity/1:3.18.4-0ubuntu0.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 metacity (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed
Dantali0n (dantalion)
tags: added: verification-done-xenial
removed: verification-needed
Revision history for this message
Dantali0n (dantalion) wrote :

I installed Metacity 1:3.18.4-0ubuntu0.2 and mysql-workbench now fully works again.

I would like to be able to help more when encountering bugs and even help fixing them.
As you can see from my stacktrace I am not really up to skill yet and was hoping one of you could supply me with information about: getting all the packages with debug symbols and properly making gdb write stacktraces to log files. But please feel free to ignore this if you find it will take to much of your time.

Thanks for repairing this package which I use in my daily live.

tags: added: verification-done
removed: verification-done-xenial
Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

For metacity you need install metacity-dbg package.

If you again have reproducible crashes with metacity it might be good idea to reproduce crash when running metacity with --sync commandline option:
metacity --sync --replace

sync option will ensure that stacktrace shows correct functon where it crashes:
ftp://www.x.org/pub/current/doc/libX11/libX11/libX11.html#Enabling_or_Disabling_Synchronization

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Oops, I just got my LibreOffice crash again with the new Metacity :(

So maybe my bug was actually different (though similar). Attaching the full stacktrace (with --sync enabled).

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Can you reproduce your crash? Try to add error trap around XFixesDestroyRegion (xdisplay, cw->window_region); line.

Anyway I am starting to think that it is better to add error trap for whole free_win function.

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

I have pushed change to use only one error trap in free_win. It should fix your crash.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Thanks! With your latest commit I can no longer reproduce the crash.

I will upload the new version to yakkety and xenial-proposed shortly.

Revision history for this message
Chris J Arges (arges) wrote :

Hello Dantali0n, or anyone else affected,

Accepted metacity into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/metacity/1:3.18.4-0ubuntu0.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!

tags: removed: verification-done
tags: added: verification-needed
Dantali0n (dantalion)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Dantali0n (dantalion) wrote :

I tested the new version about 6 days ago and my issue is still resolved, sorry if you already got notified I am unaware if changing tags notifies watchers.

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

This bug was fixed in the package metacity - 1:3.18.4-0ubuntu0.3

---------------
metacity (1:3.18.4-0ubuntu0.3) xenial; urgency=medium

  * Use one error trap for the whole free_win function (taken from upstream
    gnome-3-18 branch). This fixes the other part of LP: #1582687.

 -- Dmitry Shachnev <email address hidden> Tue, 31 May 2016 17:26:05 +0300

Changed in metacity (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for metacity 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.

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.