Bug 4417 - Notification plugin load triggers segfault on wayland if global hotkey is enabled
Summary: Notification plugin load triggers segfault on wayland if global hotkey is ena...
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail
Classification: Unclassified
Component: Plugins/Notification (show other bugs)
Version: 4.0.0
Hardware: PC Windows 10
: P3 normal
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2020-12-03 20:22 UTC by Duncan
Modified: 2020-12-22 13:22 UTC (History)
1 user (show)

See Also:


Attachments
BT.full (4.67 KB, text/plain)
2020-12-07 19:53 UTC, andyrtr
Details
disable hotkey preference on wayland (808 bytes, patch)
2020-12-18 11:32 UTC, andyrtr
Details | Diff
disable hotkey preference on wayland (813 bytes, patch)
2020-12-18 12:13 UTC, andyrtr
Details | Diff

Description Duncan 2020-12-03 20:22:58 UTC
At commit 4752d6922.  Running on wayland.  Upgrade issue with the notification plugin on a switch from claws/gtk2 3.17.8 on X.

My old gtk2/X claws installation had long had the notification plugin global hotkey enabled.  When I switched to live-git-gtk3-native-wayland claws, all the loaded plugins unregistered and I had to load plugins again.  While my other previous plugins loaded fine, attempting to load the notification plugin was segfaulting claws and sometimes (not always) taking kde/plasma/wayland (which like claws isn't entirely stable on wayland yet) with it.  Syslog said the segfault was in libX11.

After a bit of googling (on duckduck, FWIW) I found the GDK_BACKEND=x11 method to force claws/gtk3 to run in X mode on wayland, which allowed a successful load of the notification plugin.  After loading the plugin in X mode I was able to disable the global hotkeys in the notification plugin config and quit.

I could then run claws in wayland mode with the notification plugin enabled.


So the notification plugin, global-hotkeys module, needs to check that it's running in X mode before attempting to register the hotkey on X.  Because if it's in wayland mode it's at best not going to work, and could well trigger a segfault, as it was doing for me.

Unfortunately I'm not a dev so I can't provide a proper patch, but I can at least hope with that level of specificity it's reproducible and will be an easy fix for those who do have that skill.
Comment 1 Paul 2020-12-07 12:11:47 UTC
Can you run through gdb and get a bt full?
Comment 2 andyrtr 2020-12-07 19:53:51 UTC
Created attachment 2153 [details]
BT.full

BT frmo segfault when I apply a new global setting.
Comment 3 andyrtr 2020-12-18 11:30:56 UTC
The hotkey is setup using Xmodmap calls that are not supported on wayland in any way. From what I've found all gtk applications should move away from xmodmap to xkb.

So it's best for now to fully disable the hotkey preference setting when using native wayland. It can still be used when starting CM in x11 mode using "GDK_BACKEND=x11 claws-mail".
Comment 4 andyrtr 2020-12-18 11:32:16 UTC
Created attachment 2162 [details]
disable hotkey preference on wayland
Comment 5 andyrtr 2020-12-18 12:13:53 UTC
Created attachment 2163 [details]
disable hotkey preference on wayland

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