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 729044 - Native session crashes
Native session crashes
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
unspecified
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2014-04-27 08:47 UTC by drago01
Modified: 2014-04-27 18:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
grabs: Prevent x11 code to get called when not running the x11 backend (2.12 KB, patch)
2014-04-27 13:38 UTC, drago01
reviewed Details | Review
display: Don't call x11 backend code when running native (1.33 KB, patch)
2014-04-27 18:23 UTC, drago01
committed Details | Review

Description drago01 2014-04-27 08:47:18 UTC
Current master does not run as native session here:

Apr 27 10:40:33 u904 gnome-session[1714]: Window manager warning: Log level 16: invalid cast from 'MetaBackendNative' to 'MetaBackendX11'
Apr 27 10:40:33 u904 kernel: gnome-shell[1733]: segfault at 25 ip 00007f3ee4732ea9 sp 00007fffb5a5c9a0 error 4 in libX11.so.6.3.0[7f3ee46fa000+138000]

BT:

(gdb) bt
  • #0 XQueryExtension
    from /lib64/libX11.so.6
  • #1 XInput_find_display
    from /lib64/libXi.so.6
  • #2 _XIPassiveGrabDevice
    from /lib64/libXi.so.6
  • #3 XIGrabKeycode
    from /lib64/libXi.so.6
  • #4 meta_change_keygrab
    at core/keybindings.c line 1066
  • #5 meta_display_grab_accelerator
    at core/keybindings.c line 1290
  • #6 ffi_call_unix64
    from /lib64/libffi.so.6
  • #7 ffi_call
    from /lib64/libffi.so.6
  • #8 gjs_invoke_c_function
    at gi/function.cpp line 949
  • #9 function_call
    at gi/function.cpp line 1271
  • #10 CallJSNative
    at ./jscntxtinlines.h line 321
  • #11 js::Invoke
    at /home/linux/gnome/source/js24-24.2.0/js/src/vm/Interpreter.cpp line 474
  • #12 Interpret
    at /home/linux/gnome/source/js24-24.2.0/js/src/vm/Interpreter.cpp line 2298
  • #13 js::RunScript
    at /home/linux/gnome/source/js24-24.2.0/js/src/vm/Interpreter.cpp line 438
  • #14 js::Invoke
    at /home/linux/gnome/source/js24-24.2.0/js/src/vm/Interpreter.cpp line 500
  • #15 js_fun_apply
    at /home/linux/gnome/source/js24-24.2.0/js/src/jsfun.cpp line 982
  • #16 CallJSNative
    at ./jscntxtinlines.h line 321
  • #17 js::Invoke
    at /home/linux/gnome/source/js24-24.2.0/js/src/vm/Interpreter.cpp line 481
  • #18 js::Invoke
    at /home/linux/gnome/source/js24-24.2.0/js/src/vm/Interpreter.cpp line 531
  • #19 js::jit::DoCallFallback
    at /home/linux/gnome/source/js24-24.2.0/js/src/jit/BaselineIC.cpp line 7007

Why do we try to cast the native backend to x11 when running on wayland?
Comment 1 drago01 2014-04-27 08:59:36 UTC
This commit https://git.gnome.org/browse/mutter/commit/?id=8c5da24401b281f6c302d5c4e8b2dd2906ea332f seems to add the casts ... is that code supposed to run on a native session?
Comment 2 Jasper St. Pierre (not reading bugmail) 2014-04-27 13:27:57 UTC
No.

I added some if (!META_IS_BACKEND_X11 (backend)) return;s around to prevent meta_change_keygrab from being called. It seems I forgot a few.
Comment 3 drago01 2014-04-27 13:38:17 UTC
Created attachment 275259 [details] [review]
grabs: Prevent x11 code to get called when not running the x11 backend
Comment 4 Jasper St. Pierre (not reading bugmail) 2014-04-27 13:45:49 UTC
Review of attachment 275259 [details] [review]:

::: src/core/display.c
@@ +1998,3 @@
 
+  if (!META_IS_BACKEND_X11 (backend))
+    return;

meta_change_button_grab is called by four functions: meta_display_grab_window_buttons, meta_display_ungrab_window_buttons, meta_display_grab_focus_window_button, meta_display_ungrab_focus_window_button.

I fixed the first two callers, but forgot the other two.
Comment 5 drago01 2014-04-27 18:23:39 UTC
Created attachment 275273 [details] [review]
display: Don't call x11 backend code when running native
Comment 6 drago01 2014-04-27 18:24:33 UTC
Attachment 275273 [details] pushed as 4e584c2 - display: Don't call x11 backend code when running native