After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 789141 - Segmentation fault when adding Google online account
Segmentation fault when adding Google online account
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-10-18 10:20 UTC by Andrea Azzarone
Modified: 2017-10-26 10:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
stacktrace (15.68 KB, text/plain)
2017-10-18 10:20 UTC, Andrea Azzarone
  Details
Clears the current GdkGLContext if the GdkWindow used by the context was unmapped (1.31 KB, patch)
2017-10-18 10:35 UTC, Andrea Azzarone
none Details | Review
Clears the current GdkGLContext if the GdkWindow used by the context was unmapped (1.11 KB, patch)
2017-10-18 14:18 UTC, Andrea Azzarone
reviewed Details | Review
gdk: Clear GL context when window is withdrawn (1.34 KB, patch)
2017-10-20 08:19 UTC, Andrea Azzarone
accepted-commit_now Details | Review

Description Andrea Azzarone 2017-10-18 10:20:05 UTC
Created attachment 361795 [details]
stacktrace

Downstream bug: https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/1720400

Steps to reproduce:
1) login in wayland session
2) open gnome control center
3) go to "Online Accounts" panel
4) click on Google account
5) close the dialog window
6) click anywhere on the list

g-c-c should crash.
Comment 1 Andrea Azzarone 2017-10-18 10:35:50 UTC
Created attachment 361797 [details] [review]
Clears the current GdkGLContext if the GdkWindow used by the context was unmapped
Comment 2 Emmanuele Bassi (:ebassi) 2017-10-18 10:41:27 UTC
Review of attachment 361797 [details] [review]:

Thanks for the patch

::: gdk/wayland/gdkwindow-wayland.c
@@ +2530,3 @@
         }
 
+      current_context = gdk_gl_context_get_current();

Coding style: missing space between function and parenthesis.

@@ +2531,3 @@
 
+      current_context = gdk_gl_context_get_current();
+      if (current_context && gdk_gl_context_get_window(current_context) == window)

Coding style:

 - pointer comparisons should be explicit against NULL
 - missing space between function name and parenthesis
Comment 3 Debarshi Ray 2017-10-18 11:00:40 UTC
Backtrace doesn't look specific to the Online Accounts panel; even more so after looking at the patch.

Reassigning to gtk+.
Comment 4 Andrea Azzarone 2017-10-18 14:18:13 UTC
Created attachment 361806 [details] [review]
Clears the current GdkGLContext if the GdkWindow used by the context was unmapped
Comment 5 Andrea Azzarone 2017-10-18 14:19:30 UTC
Ok I fixed the style and as suggested by Emanuele I made the logic generic and moved the code inside GdkWindow (gdk_window_withdraw).
Comment 6 Marco Trevisan (Treviño) 2017-10-18 23:26:44 UTC
Review of attachment 361806 [details] [review]:

Looks sane to me
Comment 7 Jonas Ådahl 2017-10-20 03:41:18 UTC
Review of attachment 361806 [details] [review]:

Commit message nits:
1) Format should be something like "gdk: Action" thus probably something like "gdk: Clear GL context when window is withdrawn"
2) The commit message body should describe what this fixes.

The change looks sane to me though.
Comment 8 Andrea Azzarone 2017-10-20 08:19:46 UTC
Created attachment 361918 [details] [review]
gdk: Clear GL context when window is withdrawn

Some clients (e.g. gnome-online-accounts) quickly unmap and map
a window. With some backends the backend surface will be replaced
causing the application to crash because the GL context is still
using the old surface. Clearing the GL context when a window is
withdrawn fixes this.
Comment 9 Marco Trevisan (Treviño) 2017-10-24 22:19:17 UTC
Review of attachment 361918 [details] [review]:

Not really good in wording here, so I'm ok with this :)
Comment 10 Debarshi Ray 2017-10-25 14:49:45 UTC
Review of attachment 361918 [details] [review]:

::: gdk/gdkwindow.c
@@ +3926,1 @@
 	    _gdk_make_event (window, GDK_UNMAP, NULL, FALSE);

Fly-by comment: this line makes me think that this patch was spun against master while gnome-control-center is using gtk-3-22. Did you actually check whether this fixes the crash?
Comment 11 Andrea Azzarone 2017-10-25 15:06:02 UTC
(In reply to Debarshi Ray from comment #10)
> Review of attachment 361918 [details] [review] [review]:
> 
> ::: gdk/gdkwindow.c
> @@ +3926,1 @@
>  	    _gdk_make_event (window, GDK_UNMAP, NULL, FALSE);
> 
> Fly-by comment: this line makes me think that this patch was spun against
> master while gnome-control-center is using gtk-3-22. Did you actually check
> whether this fixes the crash?

Indeed we tried.
Comment 12 Debarshi Ray 2017-10-25 15:14:02 UTC
(In reply to Andrea Azzarone from comment #11)
> (In reply to Debarshi Ray from comment #10)
> > Review of attachment 361918 [details] [review] [review] [review]:
> > 
> > ::: gdk/gdkwindow.c
> > @@ +3926,1 @@
> >  	    _gdk_make_event (window, GDK_UNMAP, NULL, FALSE);
> > 
> > Fly-by comment: this line makes me think that this patch was spun against
> > master while gnome-control-center is using gtk-3-22. Did you actually check
> > whether this fixes the crash?
> 
> Indeed we tried.

Ok, thanks. It seemed to me that the crash wasn't 100% reliable - it readily crashed on the first attempt, then it didn't, so I wasn't sure.