Bug 779538 - SIGSEGV in __GI___pthread_mutex_lock() with mutter 3.23.91
SIGSEGV in __GI___pthread_mutex_lock() with mutter 3.23.91
Status: RESOLVED NOTGNOME
Product: mutter
Classification: Core
Component: general
3.23.x
Other Linux
: Normal critical
: ---
Assigned To: mutter-maint
mutter-maint
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2017-03-03 14:23 UTC by foss.freedom
Modified: 2017-05-25 09:23 UTC (History)
5 users (show)

See Also:
GNOME target: ---
GNOME version: 3.23/3.24


Attachments
apport dependencies (7.97 KB, text/plain)
2017-03-03 14:23 UTC, foss.freedom
Details
apport disassembly (1.13 KB, text/plain)
2017-03-03 14:23 UTC, foss.freedom
Details
apport journal errors (19.99 KB, text/plain)
2017-03-03 14:24 UTC, foss.freedom
Details
apport procenviron (305 bytes, text/plain)
2017-03-03 14:24 UTC, foss.freedom
Details
apport procmaps (80.04 KB, text/plain)
2017-03-03 14:24 UTC, foss.freedom
Details
apport procstatus (1.28 KB, text/plain)
2017-03-03 14:25 UTC, foss.freedom
Details
apport registers (853 bytes, text/plain)
2017-03-03 14:25 UTC, foss.freedom
Details
apport segvanalysis (209 bytes, text/plain)
2017-03-03 14:25 UTC, foss.freedom
Details
apport stacktrace (5.44 KB, text/plain)
2017-03-03 14:25 UTC, foss.freedom
Details
apport threadstacktrace (10.86 KB, text/plain)
2017-03-03 14:26 UTC, foss.freedom
Details

Description foss.freedom 2017-03-03 14:23:04 UTC
Created attachment 347132 [details]
apport dependencies

budgie-wm is (my understanding) basically a plugin for mutter.

It works just fine for v2.23.90 of mutter but for v2.23.91 the window-manager crashes on opening most applications.

Linked launchpad report:

StacktraceTop:
 __GI___pthread_mutex_lock (mutex=0x6c75646f6d5f6b74) at ../nptl/pthread_mutex_lock.c:67
 XrmQGetResource (db=0x5608f21aff90, names=names@entry=0x7ffccb88ba40, classes=classes@entry=0x7ffccb88ba50, pType=pType@entry=0x7ffccb88ba2c, pValue=pValue@entry=0x7ffccb88ba30) at ../../src/Xrm.c:2549
 XGetDefault (dpy=dpy@entry=0x5608f20df9a0, prog=prog@entry=0x7fcb9a93e081 "Xft", name=name@entry=0x7fcb9a93f854 "antialias") at ../../src/GetDflt.c:231
 get_boolean_default (value=<synthetic pointer>, option=0x7fcb9a93f854 "antialias", dpy=0x5608f20df9a0) at ../../../../src/cairo-xlib-screen.c:98
 _cairo_xlib_init_screen_font_options (info=0x5608f24e99b0, dpy=0x5608f20df9a0) at ../../../../src/cairo-xlib-screen.c:146

I have traced the issue to this commit:

 - https://github.com/GNOME/mutter/commit/383ba566bd7c2a76d0856015a66e47caedef06b6

Reverting this commit fixes the crash - however obviously there associated bug-report for that commit needs to be considered. As an aside the last comment in that thread indicates there is potentially still a NVIDIA issue to resolve.

For completeness I have attached each of the attachments contained on the launchpad bug-report
Comment 1 foss.freedom 2017-03-03 14:23:41 UTC
Created attachment 347133 [details]
apport disassembly
Comment 2 foss.freedom 2017-03-03 14:24:01 UTC
Created attachment 347134 [details]
apport journal errors
Comment 3 foss.freedom 2017-03-03 14:24:23 UTC
Created attachment 347136 [details]
apport procenviron
Comment 4 foss.freedom 2017-03-03 14:24:43 UTC
Created attachment 347137 [details]
apport procmaps
Comment 5 foss.freedom 2017-03-03 14:25:02 UTC
Created attachment 347138 [details]
apport procstatus
Comment 6 foss.freedom 2017-03-03 14:25:20 UTC
Created attachment 347139 [details]
apport registers
Comment 7 foss.freedom 2017-03-03 14:25:40 UTC
Created attachment 347140 [details]
apport segvanalysis
Comment 8 foss.freedom 2017-03-03 14:25:58 UTC
Created attachment 347141 [details]
apport stacktrace
Comment 9 foss.freedom 2017-03-03 14:26:18 UTC
Created attachment 347142 [details]
apport threadstacktrace
Comment 10 foss.freedom 2017-03-03 14:29:56 UTC
This is Ubuntu Budgie 17.04 with budgie-desktop, GTK+3.22.7 and mutter 2.23.91
Comment 11 foss.freedom 2017-03-03 14:30:40 UTC
stet - mutter 3.23.91 sorry
Comment 12 André Klapper 2017-03-03 18:40:12 UTC
(In reply to foss.freedom from comment #0)
> I have traced the issue to this commit:
> https://github.com/GNOME/mutter/commit/
> 383ba566bd7c2a76d0856015a66e47caedef06b6
> 
> Reverting this commit fixes the crash

Thanks for the investigation! That was a fix for 779039 hence CC'ing Owen.
Comment 13 foss.freedom 2017-03-09 22:56:55 UTC
had a quick conversation on IRC with jbicha.  Was asked whether the XInitThreads() was at fault or the cogl_xlib_renderer_set_threaded_swap_wait_enabled (cogl_renderer, TRUE); part. 

from my testing - and I think confirmed by the stacktrace, it is something called within cogl_xlib_renderer_set_threaded_swap_wait_enabled (cogl_renderer, TRUE) that is causing this.

Just to reiterate - the majority of applications crash the whole gnome-session (budgie-wm), but not all.  For example, terminix works fine but opening chromium crashes the desktop.
Comment 14 Hussam Al-Tayeb 2017-03-24 17:32:34 UTC
In addition, on Gnome-Shell with nvidia driver, running glxgears makes Gnome-shell stuck at 20% CPU on a corei5 which raises CPU temperature by 5 degrees.
Reverting that patch brings CPU usage back down to 3% even if I have a opengl game and glxgears running.
Comment 15 Hussam Al-Tayeb 2017-03-27 05:03:21 UTC
I asked Nvidia developer. He said "XInitThreads() enables locking calls in Xlib that affect every call into the library. If the app makes a lot of Xlib calls, that can add up to significant overhead."
In our case, the app is Mutter.
I hope this is revised since the commit message https://git.gnome.org/browse/mutter/commit/?id=383ba566bd7c2a76d0856015a66e47caedef06b6
says the second part requires the first one (the first part  XInitThreads() and the second being the cogl_xlib_renderer_set_threaded_swap_wait_enabled() call).
Comment 16 Ikey Doherty 2017-04-09 15:56:27 UTC
Hi.

This should be seen as Budgie specific issue and not upstream to Mutter itself.
Budgie has been using GTK+ code in the Mutter process space which resulted in the segfault (sync issues between gtk + mutter)

This is now removed from Budgie: https://github.com/budgie-desktop/budgie-desktop/commit/0e8e93799b65e04ebd5fecfedacbd194edd838d7
Comment 17 Ikey Doherty 2017-04-09 15:58:04 UTC
Or rather, throwing the X11 syncs. Either way, downstream bug now resolved, as GTK+ has been not recommended within Mutter for quite some time.
Comment 18 Emmanuele Bassi (:ebassi) 2017-05-25 09:23:22 UTC
Closing, as per comment 17.

The high CPU usage mentioned in comment 14 is tracked in bug 781835.

Note You need to log in before you can comment on or make changes to this bug.