Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault when sending key command on Wayland #65

Open
mcclurgm opened this issue Jun 2, 2020 · 1 comment
Open

Segfault when sending key command on Wayland #65

mcclurgm opened this issue Jun 2, 2020 · 1 comment

Comments

@mcclurgm
Copy link

mcclurgm commented Jun 2, 2020

I'm not sure if this is within your scope (since elementary doesn't use Wayland...yet), but I've found a reliable segfault when I run the app on Wayland. This only happens on GNOME Wayland, not Pantheon or GNOME X11. When it tries to execute the paste command manager.paste () (Application.vala, line 48) it fails and exits. It seems like this is an issue with trying to perform the X11 key command, which makes sense since there isn't an X11 session. So I'm not sure if there's anything you can do about this, but it's a fairly silent-seeming crash (since I expect the window to exit anyway when I select something!) which is confusing.
Here's the Valgrind stack trace:

==31409== Process terminating with default action of signal 11 (SIGSEGV)
==31409==  Access not within mapped region at address 0x40
==31409==    at 0x6B5602D: _XSend (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==31409==    by 0x6B564BF: _XFlush (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==31409==    by 0x6B58FC4: _XGetRequest (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==31409==    by 0x6BA3CAA: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==31409==    by 0x6BA4AF2: XkbGetUpdatedMap (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==31409==    by 0x6BA4BBC: XkbGetMap (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==31409==    by 0x6BA0C98: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==31409==    by 0x6BA1537: XKeysymToKeycode (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==31409==    by 0x11588C: clipped_clipboard_manager_perform_key_event (ClipboardManager.vala:65)
==31409==    by 0x11579D: clipped_clipboard_manager_paste (ClipboardManager.vala:56)
==31409==    by 0x114EAD: _clipped_application___lambda19_ (Application.vala:48)
==31409==    by 0x114F0F: __clipped_application___lambda19__gtk_application_window_removed (Application.vala:45)
==31409==  If you believe this happened as a result of a stack
==31409==  overflow in your program's main thread (unlikely but
==31409==  possible), you can try to increase the size of the
==31409==  main thread stack using the --main-stacksize= flag.
==31409==  The main thread stack size used in this run was 8388608.

If you can't access keys on Wayland, here's a suggestion of how you could maybe deal with it:
Perhaps together with #6 / #52 there could be a more elegant failure that just saves the clipboard contents and doesn't attempt to send a key command? I don't have much knowledge in the mechanics of clipboard things, so I don't know if that's possible, but it would be nice.

@davidmhewitt
Copy link
Owner

Sorry for the super slow response.

Yes, it's unsurprising that this doesn't work on Wayland. Since I support elementary OS, I haven't put much thought into how this would work in Wayland yet.

I'll leave this open as a reminder to myself that I should make some improvements here. At the very least, it should not perform these emulated paste commands on Wayland.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants