metacity crashed with signal 5 in _XEventsQueued() ; forcing gnome session to logout

Bug #1507764 reported by Stephane Lapie
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
metacity (Ubuntu)
Expired
Medium
Unassigned

Bug Description

This bug seemed to occur already since earlier versions of Ubuntu, and usually would just end up leaving me with undecorated windows, from which recovery was as easy as restarting metacity by hand, but in this release of Ubuntu (15.04), it seems gnome-session tries to restart it too many times in a too short span, and then decides arbitrarily that it failed so bad it has to kill the whole session.

So, while the metacity bug is really a thing, my real problem actually might be a gnome-session-bin bug.
I expect metacity crashing would not bring down the whole session, as is the case currently.

At any rate, this is extremely annoying, I am hitting this bug about every two days, and because of it and the regression in crash handling, I end up losing all my windows and running programs. (In all fairness, I am suspecting a hardware issue, but the problem remains that a sub process dying should not cause the parent process to die like this)

ProblemType: Crash
DistroRelease: Ubuntu 15.04
Package: metacity 1:3.14.3-1ubuntu7
ProcVersionSignature: Ubuntu 3.19.0-31.36-generic 3.19.8-ckt7
Uname: Linux 3.19.0-31-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.17.2-0ubuntu1.5
Architecture: amd64
CrashCounter: 1
CurrentDesktop: GNOME-Flashback:Unity
Date: Tue Oct 20 05:19:37 2015
ExecutablePath: /usr/bin/metacity
InstallationDate: Installed on 2010-01-30 (2088 days ago)
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027.1)
ProcCmdline: metacity
ProcEnviron:
 LANGUAGE=en_US:en
 PATH=(custom, user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/zsh
Signal: 5
SourcePackage: metacity
StacktraceTop:
 ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
 ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
 _XEventsQueued () from /usr/lib/x86_64-linux-gnu/libX11.so.6
 _XGetRequest () from /usr/lib/x86_64-linux-gnu/libX11.so.6
 XFixesCopyRegion () from /usr/lib/x86_64-linux-gnu/libXfixes.so.3
Title: metacity crashed with signal 5 in _XEventsQueued()
UpgradeStatus: Upgraded to vivid on 2015-09-05 (44 days ago)
UserGroups: adm admin audio cdrom dialout libvirtd lpadmin plugdev pulse pulse-access sambashare vboxusers video

Revision history for this message
Stephane Lapie (stephane-lapie) wrote :
Revision history for this message
Apport retracing service (apport) wrote :

StacktraceTop:
 XFixesCopyRegion (dpy=0x18f3cf0, dst=17110851, src=17110861) at ../../src/Region.c:174
 xrender_set_active_window (compositor=<optimized out>, screen=0x1a25410, window=<optimized out>) at compositor/compositor-xrender.c:2985
 meta_window_notify_focus (window=0x1e3d600, event=0x7ffdeab44ac0) at core/window.c:5502
 event_callback (event=0x7ffdeab44ac0, data=0x1a0c800) at core/display.c:2013
 filter_func (xevent=0x7ffdeab44ac0, event=<optimized out>, data=<optimized out>) at ui/ui.c:229

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 metacity (Ubuntu):
importance: Undecided → Medium
tags: removed: need-amd64-retrace
information type: Private → Public
Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Does it crash randomly? Or maybe crash occurs when you launch use specific applications?

From your description it looks like you launch something that crashes metacity. Then gnome-session tries to restart metacity, but metacity crash again and again (because of launched application?).

Revision history for this message
Stephane Lapie (stephane-lapie) wrote :

It seems to crash when I switch windows (alt+tab ; even falling back to the static application switcher does not alleviate the bug).

For reference, I do a lot of translation work, which requires me to have gedit, mplayer, evince running at the same time and heavily switching between these. (Especially mplayer/evince probably take a lot of memory).

When metacity crashes, everything freezes while apport runs and writes its files, during which only the audio players and non graphical stuff keep running (if I am lucky I can SSH and force gedit to save my work), and once apport finishes, in a split second, every window just loses its decorations, and I am forced back to the login screen. Logs indeed indicate this :
/var/log/syslog.1:Oct 20 05:22:14 archer gnome-session[29421]: WARNING: App 'metacity.desktop' respawning too quickly
/var/log/syslog.1:Oct 20 05:22:14 archer gnome-session[29421]: gnome-session[29421]: WARNING: App 'metacity.desktop' respawning too quickly

But I can't confirm with the bare eye that it tries to reload anything, or what the respawn threshold is.

Revision history for this message
Stephane Lapie (stephane-lapie) wrote :

Sorry, forgot to specify this : the Alt+Tab crash is indeed seemingly random.
At one point after one day or two of running, Alt+Tab will start leaving refresh artifacts (parts of another window that I was browsing while switching) and eventually just outright freeze and crash.

Revision history for this message
Stephane Lapie (stephane-lapie) wrote :

The crash is still happening no matter what I update.
The fact it comes after somewhat intensive use (one week, two weeks of not rebooting) and when doing Alt+Tab repeatedly in succession hints maybe at memory leaks? Again, right before the crashes, artifacts of the application switcher windows remain, and application windows redraw gets flaky.

Also, this looks strangely alike to : https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/1455916

Revision history for this message
Stephane Lapie (stephane-lapie) wrote :

I just had again the same crash. :
Dec 30 23:49:59 archer gnome-session[28277]: Window manager warning: Log level 6: The program 'metacity' received an X Window System error.
Dec 30 23:49:59 archer gnome-session[28277]: This probably reflects a bug in the program.
Dec 30 23:49:59 archer gnome-session[28277]: The error was 'BadRegion (invalid Region parameter)'.
Dec 30 23:49:59 archer gnome-session[28277]: (Details: serial 1686054464 error_code 140 request_code 138 (XFIXES) minor_code 12)
Dec 30 23:49:59 archer gnome-session[28277]: (Note to programmers: normally, X errors are reported asynchronously;
Dec 30 23:49:59 archer gnome-session[28277]: that is, you will receive the error a while after causing it.
Dec 30 23:49:59 archer gnome-session[28277]: To debug your program, run it with the GDK_SYNCHRONIZE environment
Dec 30 23:49:59 archer gnome-session[28277]: variable to change this behavior. You can then get a meaningful
Dec 30 23:49:59 archer gnome-session[28277]: backtrace from your debugger if you break on the gdk_x_error() function.)

which led once apport was done writing the crash report :
Dec 30 23:54:51 archer gnome-session[28277]: gnome-session[28277]: WARNING: Application 'metacity.desktop' killed by signal 5
Dec 30 23:54:51 archer gnome-session[28277]: WARNING: Application 'metacity.desktop' killed by signal 5
Dec 30 23:54:51 archer gnome-session[28277]: gnome-session[28277]: WARNING: App 'metacity.desktop' respawning too quickly
Dec 30 23:54:51 archer gnome-session[28277]: WARNING: App 'metacity.desktop' respawning too quickly
Dec 30 23:54:51 archer gnome-session[28277]: Unrecoverable failure in required component metacity.desktop
Dec 30 23:54:51 archer gnome-session[28277]: gnome-session[28277]: CRITICAL: We failed, but the fail whale is dead. Sorry....
Dec 30 23:54:51 archer gnome-session[28277]: CRITICAL: We failed, but the fail whale is dead. Sorry....

From what I tried, it seems like trying to run "metacity --replace" before apport finishes killing the old instance does not work : once it freezes and apport is writing its stuff, the whole session will go down.

Seriously, this regression is infuriating and makes Ubuntu barely usable for me.
I nearly stopped using Alt+Tab out of fear of losing work when switching between gedit and evince.

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

"It seems to crash when I switch windows (alt+tab ; even falling back to the static application switcher does not alleviate the bug)."

What do you mean with falling back to the static application switcher?

Can you try to download and install metacity 3.18.1 packages:
https://launchpad.net/ubuntu/xenial/+source/metacity

At least to know if this problem is fixed in 3.18? Without steps how to reproduce crashes I wont be able to help you... :(

Revision history for this message
Stephane Lapie (stephane-lapie) wrote :

Initially, I thought the crash was linked to what was implementing the window switching (with the Compiz configuration tool, one can select several ways to switch windows, including the Static Application Switcher, which only shows icons of the application instead of the contents of the window ; which I thought might take a toll on graphics function).

As for the steps, I am sorry I can't provide any better information : the only thing I can say is, it looks like something is accumulating like a leak. At one point I will start seeing artifacts when switching windows, seeing window redraw problems, and ultimately the last straw will make stuff blow up. Thanks for the packages, I will try that right away.

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

Metacity does not use compiz configuration...

Do you use metacity alt+tab popup with icons only or with window thumbnails? What output is from this command:
gsettings get org.gnome.metacity alt-tab-thumbnails

Ok, let me know if metacity still crashes with 3.18.1 packages from ubuntu 16.04.

Revision history for this message
Stephane Lapie (stephane-lapie) wrote :

About the packages, I am still using 15.04 Vivid (which means metacity 3.14), and it seems metacity and gtk+-3.0 will require a ton of dependencies (glib, pango, atk, etc...), so I can't test these right away.

Here is what I get :
$ gsettings get org.gnome.metacity alt-tab-thumbnails
No such key 'alt-tab-thumbnails'

As for configuration, it seems I am still relying on CCSM (CompizConfig Settings Manager), which offers :
- Application Switcher
- Static Application Switcher (the one I use, which pops up with only icons)

Also, I don't think this is related but it feels like at times the application switch is not instant (meaning, I need to wait a little bit to be sure that it did switch, otherwise the keys I hit right after Alt+Tab get processed by the previous application, which is kind of annoying)

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

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

Changed in metacity (Ubuntu):
status: New → Confirmed
Revision history for this message
John Drinkwater (johndrinkwater) wrote :

Subbing to this bug even though the direct cause is not the same; with metacity crashing now, my entire session is being lost!
I’ve been able to trigger it while alt-tabbing like the OP, closing windows, and generally interacting with the window manager while a 3d game is open or VLC has been in use has caused it.
https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/1535906

It was occuring on 15.04 and updating to 15.10 did not resolve the issue.

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

Please try to come up with steps how to reproduce crash.

Revision history for this message
xavi (xaviersarrate) wrote :

Same issue here. I've been also able to trigger it while doing alt+tab. I also lose my entire session when this happens. It doesn't happen always but after some hours of work. I don't detect anything special when system crashes... sorry =(

Running Metacity under Ubuntu 15.10

Revision history for this message
Stephane Lapie (stephane-lapie) wrote :

It's hard to reproduce "at will". I personally run Firefox, Thunderbird, Chrome, gedit, gjiten, skype, pidgin, Gnome Terminal, and always have something like 20 windows open at a time on my main workspace.

Of note :
- When alt tabbing between windows, sometimes surfaces flash to black for one instant before redraw happens.
This might indicate that the core problem with metacity crashing in the first place is linked to Xorg or the nvidia driver ?
- Also, with previous versions of Ubuntu, I did have metacity crash on me at times, but the session would keep on running, so I could relaunch metacity from an open terminal (or via console using : DISPLAY=:0.0 metacity ) ; The crash itself is not a problem, gnome-sessions's extremely poor handling of it is.

The easiest way for me to produce this crash is to edit text in gedit, open a PDF in evince, and spend my time alt tabbing between them (which happens quite a lot as I am doing translation work). At one point, I'll start seeing redrawing artifacts (to explain : even though I switched applications, the display still shows a black surface, or the application which was on top of gedit at that time, and I have to interact with the application for redraw to occur.

When I see this symptom, I know that within the next 50~100 window switchings, I will crash.

The crash can even be triggered by clicking the window tab on the application bar.

Revision history for this message
AZ (m-dev) wrote :

After upgrading to xenial, by laptop is crashing every few hours or so. dmesg says metacity crashed, and then I get logged off with all applications closed.

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

AZ, https://bugs.launchpad.net/ubuntu/+source/metacity/+bug/1573478

Should be fixed in 3.18.4 and it is already in upload queue.

Revision history for this message
Stephane Lapie (stephane-lapie) wrote :

I upgraded to older version 3.18.1-1ubuntu3, and relaunched metacity using "metacity --replace", and now I have metacity crashes, but they don't log me out.

Just wondering if the fact I "replaced" metacity while logged in untied it from gnome-session.

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

1) `metacity --replace` "disconnects" it from gnome-session. So next time it crash, gnome-session does not see it as crash in required component. It only logs out if required components crashes.

2) Is this still problem in 16.04 with metacity 1:3.18.4-0ubuntu0.1? Please try to get new stacktrace.

Changed in metacity (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for metacity (Ubuntu) because there has been no activity for 60 days.]

Changed in metacity (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Stephane Lapie (stephane-lapie) wrote :

I was just hit again with it today, with metacity 1:3.18.7-0ubuntu0.3 on 16.04.

Here is the crash dump.

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

Stephane, you should file a new bug using “ubuntu-bug /var/crash/_usr_bin_metacity.1000.crash” command (or whatever path to .crash file is), attaching the crash file to existing bug does not help.

Also, we do not always have resources for supporting old Ubuntu versions. Please upgrade to 18.04 LTS.

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

3.18.7 is way too old at this point. Please upgrade if you can.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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