! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Segfault in XInternAtom when clicking or typing when using wayland
Status:
RESOLVED: FIXED

Comments

Description Richard Schwab 2018-06-17 20:51:01 CEST
Created attachment 7793 
gdb backtrace

Clicking into the window or pressing keys on my keyboard results in a segfault.

I have tested this behavior with arrow keys and letters. Space does not trigger the bug, it just opens the quick search box. Inside the quick search box I can type other characters too, after closing it however it'll crash on the next input.

Thunar 1.6.15 works fine, 1.8.1 doesn't.

This is running on Arch Linux with Gnome on Wayland.
Comment 1 alexxcons editbugs 2018-06-18 10:11:31 CEST
Thanks for reporting, I'll have a look at "thunarx_menu_provider_get_file_menu_items" when I have time.

Possibly a thunarx incompartibility ( thunar plugins need to use the new API )
Could you please take a try to uninstall and/or update all thunar plugins you have installed.
Comment 2 Richard Schwab 2018-06-18 11:37:14 CEST
Is there an easy way to see which plugins are interacting with thunar?
Comment 3 alexxcons editbugs 2018-06-18 12:56:05 CEST
Sorry, last time I did not read the stacktrace carefully enough:
/usr/lib/thunarx-3/thunar-wallpaper-plugin.so
^^ so this seems to be the problematic plugin

thunar-wallpaper-plugin is a thunar internal plugin, it is packaged together with thunar.
You installed thunar from source ?
My quess would be, that you tried to run thunar from the source-directory while having the old plugins installed, or you only installed thunar itself, but not the plugins. When compiling from source you only can make use of the new plugins by doing "make install" on the main thunar folder.

Try to first remove all the old thunar packages of your distro and than build & install thunar like that, while beeing on the main thunar folder:
./autogen.sh
make
sudo make install

( Hope I was right and you installed from source ? )

Here a list of thunar plugins (besides the thunar-internal plugins) maintained by xfce:
https://docs.xfce.org/xfce/thunar/start
The according package-names usually are something like "thunar-****-plugin"
Comment 4 Richard Schwab 2018-06-18 19:31:46 CEST
I didn't install thunar from source, it's installed from the arch packages: https://www.archlinux.org/packages/extra/x86_64/thunar/
Build script: https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/thunar

I'll try removing some other plugins I'm using later when I have time.
Comment 5 Andrea M. 2018-06-18 23:27:49 CEST
Richard do you have some custom actions without icon (look in .config/thunar/uca.xml) ?
Comment 6 Andre Miranda editbugs 2018-06-19 03:28:38 CEST
Richard, I'm running 1.8.1 from Arch packages, but it doesn't crash on Gnome Xorg, I'm not able to make the Wayland session work (no time to investigate). Can you check if it also crashes for you on Xorg or when running a Xfce session?
Comment 7 Richard Schwab 2018-06-19 20:19:28 CEST
~/.config/thunar/uca.xml doesn't exist on my system.

Ie tried removing thunar-archive-plugin thunar-media-tags-plugin thunar-volman tumbler ffmpegthumbnailer, that didn't make a difference (I didn't reboot after removal, so there may still have been things running in background). I won't be able to reboot and test gnome/x11 until the weekend, I'll have to see if I can do xfce.
Comment 8 Richard Schwab 2018-06-19 20:26:06 CEST
Actually ~/.config/Thunar/uca.xml does exist though:

<?xml encoding="UTF-8" version="1.0"?>
<actions>
<action>
        <icon>utilities-terminal</icon>
        <name>Open Terminal Here</name>
        <unique-id>1505138029589936-1</unique-id>
        <command>exo-open --working-directory %f --launch TerminalEmulator</command>
        <description>Example for a custom action</description>
        <patterns>*</patterns>
        <startup-notify/>
        <directories/>
</action>
</actions>

Where would that icon have to be? It does exist in /usr/share/icons/<gnome-theme-name>/<various-sizes>/utilities-terminal.png
Comment 9 Andre Miranda editbugs 2018-06-19 20:33:16 CEST
Those plugins does seem to have any relation, the backtrace tell us the "culprit" is /usr/lib/thunarx-3/thunar-wallpaper-plugin.so.
Your uca.xml is fine, it's the default.
Comment 10 Richard Schwab 2018-06-19 20:43:24 CEST
Created attachment 7801 
unstripped gdb backtrace

I've added an unstripped gdb backtrace now.
Comment 11 alexxcons editbugs 2018-06-19 21:00:29 CEST
Ah, much better .. think now it is more or less clear what's the Problem:

plugins/thunar-wallpaper/twp-provider.c:183:
....  
xfce_selection_atom = XInternAtom (gdk_x11_get_default_xdisplay(), selection_name, False);
...


gdk_x11_get_default_xdisplay() does not work for wayland.

Wonder if it can be replaced by "gdk_display_get_default (void)" .. probably not.  I dont run wayland, so I cannot test that.

A solution could be to check if it is set:
if (!GDK_IS_X11_DISPLAY(display)) return;
Comment 12 Andre Miranda editbugs 2018-06-19 21:04:04 CEST
Alex's rationale makes sense, it seems wallpaper-plugin needs to be "ported" to wayland, but we cannot promise anything since Thunar itself is not tested on wayland, actually Xfce as whole is far from ready for wayland.
What we can do, as a compromise, is to make this plugin kinda disable itself when not running under Xorg.
Comment 13 Richard Schwab 2018-06-19 21:07:20 CEST
According to https://goodies.xfce.org/projects/thunar-plugins/start#thunar-wallpaper-plugin the purpose of this plugin is providing an interface to thunar which allows you to set the wallpaper on the xfce desktop.

Since I don't use xfce I'd be perfectly fine with that, it wouldn't affect me anyways.

I'm curious though why this worked fine with thunar 1.6 though.
Comment 14 alexxcons editbugs 2018-06-19 21:14:53 CEST
Another approach could be to use some gdbus magic to replace the current logic to figure out if desktop_type = DESKTOP_TYPE_XFCE or DESKTOP_TYPE_NAUTILUS ( but I realy have no idea if/how that could be done)

.. wonder if the  nautilus part works at all ;)

Ok, let me just provide a small patch to take a try.
Comment 15 alexxcons editbugs 2018-06-19 22:01:58 CEST
Created attachment 7802 
patch to check for wayland

The previously suggested check did not work out, so now I try to read an environment variable.
Could you please check if $XDG_SESSION_TYPE is really set to "wayland" for you ? ( Or ideally build thunar from source )
Comment 16 Richard Schwab 2018-06-19 22:10:48 CEST
XDG_SESSION_TYPE is indeed wayland.

After applying that patch (modified the arch repo build script to also apply the patch) it works fine.
Comment 17 alexxcons editbugs 2018-06-19 22:44:38 CEST
Great !  I pushed it to master, will be released in 1.8.2

.. since our git-bot is lazy/down: https://git.xfce.org/xfce/thunar/commit/?id=4fa24d42f83180fd5012527eb4ed77b04e8d88a6
Comment 18 alexxcons editbugs 2018-06-19 23:03:11 CEST
By the way, thanks for reporting this and thanks for the unstripped backtrace ! 
Nice to see that thunar already runs on wayland !
Comment 19 Git Bot editbugs 2018-06-21 21:01:13 CEST
Alexander Schwinn referenced this bugreport in commit 660d9ceb8509ef82fe3a4a0287014010286bf12c

Segfault in XInternAtom when clicking or typing when using wayland ( Part II ) (Bug #14461)

https://git.xfce.org/xfce/thunar/commit?id=660d9ceb8509ef82fe3a4a0287014010286bf12c

Bug #14461

Reported by:
Richard Schwab
Reported on: 2018-06-17
Last modified on: 2018-06-21

People

Assignee:
alexxcons
CC List:
5 users

Version

Attachments

gdb backtrace (4.37 KB, text/plain)
2018-06-17 20:51 CEST , Richard Schwab
no flags
unstripped gdb backtrace (4.74 KB, text/plain)
2018-06-19 20:43 CEST , Richard Schwab
no flags
patch to check for wayland (1.15 KB, patch)
2018-06-19 22:01 CEST , alexxcons
no flags

Additional information