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

Fix crashes on Wayland by not loading the HotkeyManager #804

Merged
merged 2 commits into from
Nov 3, 2020

Conversation

johanhelsing
Copy link
Contributor

On Wayland, global hotkeys are often handled by the compositor instead. On sway
for instance, a config file is edited to launch specific commands when a hotkey
is entered.

On such compositors, it should be enough to show Albert by configuring the
compositor to launch "albert show" or "albert toggle" a hotkey manager in
Albert itself is redundant.

Johan Klokkhammer Helsing added 2 commits May 8, 2019 12:59
On Wayland, global hotkeys are often handled by the compositor instead. On sway
for instance, a config file is edited to launch specific commands when a hotkey
is entered.

On such compositors, it should be enough to show Albert by configuring the
compositor to launch "albert show" or "albert toggle" a hotkey manager in
Albert itself is redundant.
@edrex
Copy link

edrex commented Nov 25, 2019

Confirming problem, I just installed albert and it's crashing at startup:

❯ coredumpctl info  
           PID: 554655 (albert)
           UID: 1000 (eric)
           GID: 1000 (eric)
        Signal: 11 (SEGV)
     Timestamp: Sun 2019-11-24 20:57:27 PST (2min 50s ago)
  Command Line: albert
    Executable: /usr/bin/albert
 Control Group: /user.slice/user-1000.slice/session-1.scope
          Unit: session-1.scope
         Slice: user-1000.slice
       Session: 1
     Owner UID: 1000 (eric)
       Boot ID: 493ef9910b7f4ce9afa96ea6265916d6
    Machine ID: a48fe9a7ff994789a35fe7ad090cd8d7
      Hostname: chip
       Storage: /var/lib/systemd/coredump/core.albert.1000.493ef9910b7f4ce9afa96ea62659>
       Message: Process 554655 (albert) of user 1000 dumped core.
                
                Stack trace of thread 554655:
                #0  0x00007fc367ec66fa XGetModifierMapping (libX11.so.6)
                #1  0x0000557d20b84992 _ZN14GlobalShortcut20HotkeyManagerPrivateC2EP7QO>
                #2  0x0000557d20b843a7 _ZN14GlobalShortcut13HotkeyManagerC2EP7QObject (>
                #3  0x0000557d20b5535b main (albert)
                #4  0x00007fc367459153 __libc_start_main (libc.so.6)
                #5  0x0000557d20b5eaae _start (albert)
                
                Stack trace of thread 554658:
                #0  0x00007fc36752be9d syscall (libc.so.6)
                #1  0x00007fc3663b111b g_cond_wait_until (libglib-2.0.so.0)
                #2  0x00007fc36642ef43 n/a (libglib-2.0.so.0)
                #3  0x00007fc36642f134 g_async_queue_timeout_pop (libglib-2.0.so.0)
                #4  0x00007fc3663d608a n/a (libglib-2.0.so.0)
                #5  0x00007fc3663dcc11 n/a (libglib-2.0.so.0)
                #6  0x00007fc3674194cf start_thread (libpthread.so.0)
                #7  0x00007fc3675312d3 __clone (libc.so.6)
                
                Stack trace of thread 554657:
                #0  0x00007fc3675269ef __poll (libc.so.6)

@edrex
Copy link

edrex commented Nov 25, 2019

I built Albert with this patch and it fixes the crash at startup under Sway.

Copy link

@edrex edrex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think letting wayland compositors handle hotkeys is the way to go for now, +1

If a future wayland protocol enables clients to map global hotkeys it can be added then.

if ( !hotkeyManager->registerHotkey(hotkey) )
qFatal("Failed to set hotkey to %s.", hotkey.toLocal8Bit().constData());

if ( !QGuiApplication::platformName().contains("wayland") )
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about whether this is the right thing in all wayland environments, and I think it is. I'm not aware of a wayland protocol for requesting a hotkey from the compositor, and if there is it can be supported in a later patch.

@edrex
Copy link

edrex commented Nov 25, 2019

@ManuelSchneid3r this LGTM.

@stratosgear
Copy link

stratosgear commented Feb 17, 2020

Is something holding this back? I also get albert failing to start on my sway env and I would appreciate ii if this was merged! Thanks!

this, &SettingsWidget::changeHotkey);
} else {
ui.grabKeyButton_hotkey->setVisible(false);
ui.label_hotkey->setVisible(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Design choice:

  1. Just hide it
  2. Tell the user that it can't be done this way and that they should consult the compositor

I personally would go with option 2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean like a dialog when you push the button, or a tooltip on a disabled button?

Maybe it can be done separately in another merge request? I'm not sure when I have the time to continue work on this, and in the meantime it would be nice to at least solve the crashes :)

@austb
Copy link

austb commented Feb 26, 2020

I'm not sure if this fix is missing something, but I'm running on Fedora 31 and the fix doesn't seem to work for me, I'm still seeing a core dump

$ git show
commit 2f80ebface17758a0d5d0374ff27e37e8b028372 (HEAD -> wayland-crash-fix)
Author: Johan Klokkhammer Helsing <johan.helsing@qt.io>
...
$ cd albert-build/
$ cmake ../ -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug
-- pybind11 v2.2.4
-- Configuring done
-- Generating done
-- Build files have been written to: /home/austb/src/albert
$ cd ..
$ make
...
$ ./bin/albert
10:35:06 [WARN:default] QSocketNotifier: Can only be used with threads started with QThread
10:35:06 [INFO:default] Systems icon theme is: "Adwaita"
10:35:06 [WARN:default] Application has not been terminated graciously.
10:35:06 [INFO:default] Loading extension "org.albert.extension.applications"
10:35:06 [INFO:applications] Start indexing applications.
10:35:06 [INFO:default] Loading extension "org.albert.extension.calculator"
10:35:06 [INFO:default] Loading extension "org.albert.extension.files"
10:35:07 [INFO:default] Start indexing files.
10:35:07 [INFO:default] Loading extension "org.albert.extension.python"
10:35:07 [WARN:default] QFileSystemWatcher::removePaths: list is empty
10:35:07 [INFO:default] Loading extension "org.albert.extension.snippets"
10:35:07 [INFO:default] Loading extension "org.albert.extension.system"
10:35:07 [INFO:default] Loading extension "org.albert.extension.terminal"
10:35:07 [INFO:default] Loading extension "org.albert.extension.websearch"
10:35:07 [WARN:default] QObject::connect: No such signal QPlatformNativeInterface::systemTrayWindowChanged(QScreen*)
10:35:07 [WARN:default] QObject::connect(GlobalShortcut::HotkeyManager, WidgetBoxModel::FrontendPlugin): invalid null parameter
10:35:08 [INFO:applications] Indexed 60 applications.
xkbcommon: ERROR: Key "<CAPS>" added to modifier map for multiple modifiers; Using Control, ignoring Lock
xkbcommon: ERROR: Key "<CAPS>" added to modifier map for multiple modifiers; Using Control, ignoring Lock
10:35:08 [INFO:default] Indexed 32437 files in 7343 directories.

<run './bin/albert show'> in another window>

Segmentation fault (core dumped)
$ coredumpctl info
           PID: 645508 (albert)
           UID: 1000 (austb)
           GID: 1000 (austb)
        Signal: 11 (SEGV)
     Timestamp: Wed 2020-02-26 10:38:31 PST (2min 13s ago)
  Command Line: ./bin/albert
    Executable: /home/austb/src/albert/bin/albert
 Control Group: /user.slice/user-1000.slice/user@1000.service/gnome-terminal-server.service
          Unit: user@1000.service
     User Unit: gnome-terminal-server.service
         Slice: user-1000.slice
     Owner UID: 1000 (austb)
       Boot ID: c0ce04a8e603497c924c418abc667512
    Machine ID: df4129a5dba64a9496840de5c5263990
      Hostname: localhost.localdomain
       Storage: /var/lib/systemd/coredump/core.albert.1000.c0ce04a8e603497c924c418abc667512.645508.1582742311000000000000.lz4
       Message: Process 645508 (albert) of user 1000 dumped core.

                Stack trace of thread 645508:
                #0  0x00007f848b4af941 _XSend (libX11.so.6)
                #1  0x00007f848b4afdc4 _XFlush (libX11.so.6)
                #2  0x00007f848b4b2b0d _XGetRequest (libX11.so.6)
                #3  0x00007f848b4a5e21 XQueryExtension (libX11.so.6)
                #4  0x00007f848b499477 XInitExtension (libX11.so.6)
                #5  0x00007f8489b9e581 XextAddDisplay (libXext.so.6)
                #6  0x00007f8489b98875 XShapeQueryExtension (libXext.so.6)
                #7  0x00007f846aca5c79 _ZN14WidgetBoxModel14FrontendWidget11resizeEventEP12QResizeEvent (libwidgetboxmodel.so)
                #8  0x00007f848af724ae _ZN7QWidget5eventEP6QEvent (libQt5Widgets.so.5)
                #9  0x00007f848af2eab6 _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt5Widgets.so.5)
                #10 0x00007f848af38150 _ZN12QApplication6notifyEP7QObjectP6QEvent (libQt5Widgets.so.5)
                #11 0x00007f848b81f3e8 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt5Core.so.5)
                #12 0x00007f848af6a87e _ZN14QWidgetPrivate30sendPendingMoveAndResizeEventsEbb (libQt5Widgets.so.5)
                #13 0x00007f848af6e617 _ZN14QWidgetPrivate11show_helperEv (libQt5Widgets.so.5)
                #14 0x00007f848af7176b _ZN14QWidgetPrivate10setVisibleEb (libQt5Widgets.so.5)
                #15 0x00007f846aca444c _ZN14WidgetBoxModel14FrontendWidget10setVisibleEb (libwidgetboxmodel.so)
                #16 0x00007f846aca17be _ZN14WidgetBoxModel14FrontendPlugin10setVisibleEb (libwidgetboxmodel.so)
                #17 0x0000000000476960 n/a (/home/austb/src/albert/bin/albert)
                #18 0x000000000047c30c n/a (/home/austb/src/albert/bin/albert)
                #19 0x000000000047c048 n/a (/home/austb/src/albert/bin/albert)
                #20 0x000000000047ba5e n/a (/home/austb/src/albert/bin/albert)
                #21 0x00007f848b849a60 _ZN11QMetaObject8activateEP7QObjectiiPPv (libQt5Core.so.5)
                #22 0x00007f848c3d7203 _ZN19QLocalServerPrivate18_q_onNewConnectionEv (libQt5Network.so.5)
                #23 0x00007f848b84991b _ZN11QMetaObject8activateEP7QObjectiiPPv (libQt5Core.so.5)
                #24 0x00007f848b855c5c _ZN15QSocketNotifier9activatedEiNS_14QPrivateSignalE (libQt5Core.so.5)
                #25 0x00007f848b855fc1 _ZN15QSocketNotifier5eventEP6QEvent (libQt5Core.so.5)
                #26 0x00007f848af2eab6 _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt5Widgets.so.5)
                #27 0x00007f848af38150 _ZN12QApplication6notifyEP7QObjectP6QEvent (libQt5Widgets.so.5)
                #28 0x00007f848b81f3e8 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt5Core.so.5)
                #29 0x00007f848b8751d7 _ZL28socketNotifierSourceDispatchP8_GSourcePFiPvES1_ (libQt5Core.so.5)
                #30 0x00007f8489c57520 g_main_context_dispatch (libglib-2.0.so.0)
                #31 0x00007f8489c578b0 g_main_context_iterate.isra.0 (libglib-2.0.so.0)
                #32 0x00007f8489c57953 g_main_context_iteration (libglib-2.0.so.0)
                #33 0x00007f848b874825 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5)
                #34 0x00007f848b81e1db _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5)
                #35 0x00007f848b8260b6 _ZN16QCoreApplication4execEv (libQt5Core.so.5)
                #36 0x0000000000474cd1 n/a (/home/austb/src/albert/bin/albert)
                #37 0x00007f848a8c11a3 __libc_start_main (libc.so.6)
                #38 0x00000000004631fe n/a (/home/austb/src/albert/bin/albert)

Let me know if I can provide any other testing or information.

@bwoodruff
Copy link

Running into this on a fresh Fedora 31 system. Is there something holding this back from being merged?

debug info
$ albert -v
albert 0.16.1
$ albert
15:46:56 [WARN:default] QSocketNotifier: Can only be used with threads started with QThread
15:46:56 [INFO:default] Systems icon theme is: "Adwaita"
Segmentation fault (core dumped)
$ coredumpctl info
           PID: 4174 (albert)
           UID: 1000 (bdw)
           GID: 1000 (bdw)
        Signal: 11 (SEGV)
     Timestamp: Sat 2020-03-07 15:46:57 EST (4min 53s ago)
  Command Line: albert
    Executable: /usr/bin/albert
 Control Group: /user.slice/user-1000.slice/user@1000.service/gnome-terminal-se>
          Unit: user@1000.service
     User Unit: gnome-terminal-server.service
         Slice: user-1000.slice
     Owner UID: 1000 (bdw)
       Boot ID: e231ed03350f441da8d6d83d8b39ae3f
    Machine ID: 425fe6c0cdb540fd8ae56cd03bd9cf01
      Hostname: bwx1l
       Storage: /var/lib/systemd/coredump/core.albert.1000.e231ed03350f441da8d6>
       Message: Process 4174 (albert) of user 1000 dumped core.
                
                Stack trace of thread 4174:
                #0  0x00007fc02741f941 _XSend (libX11.so.6)
                #1  0x00007fc02741fdc4 _XFlush (libX11.so.6)
                #2  0x00007fc027422b0d _XGetRequest (libX11.so.6)
                #3  0x00007fc02740e442 XGetModifierMapping (libX11.so.6)
                #4  0x0000558fcbd4e332 _ZN14GlobalShortcut20HotkeyManagerPrivat>
                #5  0x0000558fcbd4dd28 _ZN14GlobalShortcut13HotkeyManagerC2EP7Q>
                #6  0x0000558fcbd1de6f main (albert)
                #7  0x00007fc0269771a3 __libc_start_main (libc.so.6)
                #8  0x0000558fcbd27c0e _start (albert)
                
                Stack trace of thread 4180:
                #0  0x00007fc026a46a6f __poll (libc.so.6)
                #1  0x00007fc025bc781e g_main_context_iterate.isra.0 (libglib-2>
                #2  0x00007fc025bc7ba3 g_main_loop_run (libglib-2.0.so.0)
                #3  0x00007fc01587bfca gdbus_shared_thread_func (libgio-2.0.so.>
                #4  0x00007fc025bf0fd2 g_thread_proxy (libglib-2.0.so.0)
                #5  0x00007fc0269374e2 start_thread (libpthread.so.0)
                #6  0x00007fc026a516d3 __clone (libc.so.6)
                
                Stack trace of thread 4175:
                #0  0x00007fc026a46a6f __poll (libc.so.6)
                #1  0x00007fc025bc781e g_main_context_iterate.isra.0 (libglib-2>
                #2  0x00007fc025bc7953 g_main_context_iteration (libglib-2.0.so>
                #3  0x00007fc0277e4825 _ZN20QEventDispatcherGlib13processEvents>
                #4  0x00007fc02778e1db _ZN10QEventLoop4execE6QFlagsINS_17Proces>
                #5  0x00007fc0275dec45 _ZN7QThread4execEv (libQt5Core.so.5)
                #6  0x00007fc016b17f6a _ZN22QDBusConnectionManager3runEv (libQt>
                #7  0x00007fc0275dfd96 _ZN14QThreadPrivate5startEPv (libQt5Core>
                #8  0x00007fc0269374e2 start_thread (libpthread.so.0)
                #9  0x00007fc026a516d3 __clone (libc.so.6)
                
                Stack trace of thread 4178:
                #0  0x00007fc026a46a6f __poll (libc.so.6)
                #1  0x00007fc025bc781e g_main_context_iterate.isra.0 (libglib-2>
                #2  0x00007fc025bc7953 g_main_context_iteration (libglib-2.0.so>
                #3  0x00007fc016d4f93d dconf_gdbus_worker_thread (libdconfsetti>
                #4  0x00007fc025bf0fd2 g_thread_proxy (libglib-2.0.so.0)
                #5  0x00007fc0269374e2 start_thread (libpthread.so.0)
                #6  0x00007fc026a516d3 __clone (libc.so.6)
                
                Stack trace of thread 4179:
                #0  0x00007fc026a4c1ed syscall (libc.so.6)
                #1  0x00007fc025c13ce6 g_cond_wait_until (libglib-2.0.so.0)
                #2  0x00007fc025b98411 g_async_queue_pop_intern_unlocked (libgl>
                #3  0x00007fc025bf186a g_thread_pool_thread_proxy (libglib-2.0.>
                #4  0x00007fc025bf0fd2 g_thread_proxy (libglib-2.0.so.0)
                #5  0x00007fc0269374e2 start_thread (libpthread.so.0)
                #6  0x00007fc026a516d3 __clone (libc.so.6)
                
                Stack trace of thread 4177:
                #0  0x00007fc026a46a6f __poll (libc.so.6)
                #1  0x00007fc025bc781e g_main_context_iterate.isra.0 (libglib-2>
                #2  0x00007fc025bc7953 g_main_context_iteration (libglib-2.0.so>
                #3  0x00007fc025bc79a1 glib_worker_main (libglib-2.0.so.0)
                #4  0x00007fc025bf0fd2 g_thread_proxy (libglib-2.0.so.0)
                #5  0x00007fc0269374e2 start_thread (libpthread.so.0)
                #6  0x00007fc026a516d3 __clone (libc.so.6)

@bwoodruff
Copy link

bwoodruff commented Mar 8, 2020

UPDATE 2:

Building from the right branch allows albert to go through first run, but when actually trying to use it...

$ albert -r
        Albert version: 0.16.1
            Build date: Mar  8 2020 17:48:21
            Qt version: 5.13.2
  QT_QPA_PLATFORMTHEME: 
       Binary location: /usr/bin/albert
                   PWD: /home/bdw/Applications/albert-build
                 SHELL: /usr/bin/zsh
                  LANG: en_US.UTF-8
      XDG_SESSION_TYPE: wayland
   XDG_CURRENT_DESKTOP: GNOME
       DESKTOP_SESSION: gnome
   XDG_SESSION_DESKTOP: gnome
                    OS: Fedora 31 (Workstation Edition)
     OS (type/version): fedora/31
             Build ABI: x86_64-little_endian-lp64
  Arch (build/current): x86_64/x86_64
 Kernel (type/version): linux/5.5.7-200.fc31.x86_64
$ albert
17:54:50 [WARN:default] QSocketNotifier: Can only be used with threads started with QThread
17:54:50 [INFO:default] Systems icon theme is: "Adwaita"
17:54:50 [WARN:default] Application has not been terminated graciously.
17:54:50 [INFO:default] Loading extension "org.albert.extension.applications"
17:54:50 [INFO:applications] Start indexing applications.
17:54:50 [INFO:default] Loading extension "org.albert.extension.calculator"
17:54:50 [INFO:default] Loading extension "org.albert.extension.snippets"
17:54:50 [INFO:default] Loading extension "org.albert.extension.system"
17:54:50 [INFO:default] Loading extension "org.albert.extension.terminal"
17:54:50 [WARN:default] QObject::connect: No such signal QPlatformNativeInterface::systemTrayWindowChanged(QScreen*)
17:54:50 [WARN:default] QObject::connect(GlobalShortcut::HotkeyManager, WidgetBoxModel::FrontendPlugin): invalid null parameter
17:54:50 [INFO:applications] Indexed 50 applications.
zsh: segmentation fault (core dumped)  albert
$ coredumpctl info
           PID: 30986 (albert)
           UID: 1000 (bdw)
           GID: 1000 (bdw)
        Signal: 11 (SEGV)
     Timestamp: Sun 2020-03-08 17:54:57 EDT (2min 43s ago)
  Command Line: albert
    Executable: /usr/bin/albert
 Control Group: /user.slice/user-1000.slice/user@1000.service/gnome-terminal-server.service
          Unit: user@1000.service
     User Unit: gnome-terminal-server.service
         Slice: user-1000.slice
     Owner UID: 1000 (bdw)
       Boot ID: a6a8d60a9dea45f0b84330f3155377a8
    Machine ID: 425fe6c0cdb540fd8ae56cd03bd9cf01
      Hostname: bwx1l
       Storage: /var/lib/systemd/coredump/core.albert.1000.a6a8d60a9dea45f0b84330f3155377a8.30986.1583704497000000000000.lz4
       Message: Process 30986 (albert) of user 1000 dumped core.
                
                Stack trace of thread 30986:
                #0  0x00007f5321ae7e0d XQueryExtension (libX11.so.6)
                #1  0x00007f5321adb477 XInitExtension (libX11.so.6)
                #2  0x00007f53201e0581 XextAddDisplay (libXext.so.6)
                #3  0x00007f53201da875 XShapeQueryExtension (libXext.so.6)
                #4  0x00007f5309b01c79 _ZN14WidgetBoxModel14FrontendWidget11resizeEventEP12QResizeEvent (libwidgetboxmodel.so)
                #5  0x00007f53215b44ae _ZN7QWidget5eventEP6QEvent (libQt5Widgets.so.5)
                #6  0x00007f5321570ab6 _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt5Widgets.so.5)
                #7  0x00007f532157a150 _ZN12QApplication6notifyEP7QObjectP6QEvent (libQt5Widgets.so.5)
                #8  0x00007f5321e613e8 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt5Core.so.5)
                #9  0x00007f53215ac87e _ZN14QWidgetPrivate30sendPendingMoveAndResizeEventsEbb (libQt5Widgets.so.5)
                #10 0x00007f53215b0617 _ZN14QWidgetPrivate11show_helperEv (libQt5Widgets.so.5)
                #11 0x00007f53215b376b _ZN14QWidgetPrivate10setVisibleEb (libQt5Widgets.so.5)
                #12 0x00007f5309b0044c _ZN14WidgetBoxModel14FrontendWidget10setVisibleEb (libwidgetboxmodel.so)
                #13 0x00007f5309afd7be _ZN14WidgetBoxModel14FrontendPlugin10setVisibleEb (libwidgetboxmodel.so)
                #14 0x000000000047a839 _ZN4Core8Frontend16toggleVisibilityEv (albert)
                #15 0x00000000004769f5 dispatchMessage (albert)
                #16 0x000000000047c30c _ZN9QtPrivate11FunctorCallINS_11IndexesListIJEEENS_4ListIJEEEvPFvvEE4callERS6_PPv (albert)
                #17 0x000000000047c048 _ZN9QtPrivate15FunctionPointerIPFvvEE4callINS_4ListIJEEEvEEvS2_PvPS7_ (albert)
                #18 0x000000000047ba5e _ZN9QtPrivate17QStaticSlotObjectIPFvvENS_4ListIJEEEvE4implEiPNS_15QSlotObjectBaseEP7QObjectPPvPb (al>
                #19 0x00007f5321e8ba60 _ZN11QMetaObject8activateEP7QObjectiiPPv (libQt5Core.so.5)
                #20 0x00007f5322a19203 _ZN19QLocalServerPrivate18_q_onNewConnectionEv (libQt5Network.so.5)
                #21 0x00007f5321e8b91b _ZN11QMetaObject8activateEP7QObjectiiPPv (libQt5Core.so.5)
                #22 0x00007f5321e97c5c _ZN15QSocketNotifier9activatedEiNS_14QPrivateSignalE (libQt5Core.so.5)
                #23 0x00007f5321e97fc1 _ZN15QSocketNotifier5eventEP6QEvent (libQt5Core.so.5)
                #24 0x00007f5321570ab6 _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt5Widgets.so.5)
                #25 0x00007f532157a150 _ZN12QApplication6notifyEP7QObjectP6QEvent (libQt5Widgets.so.5)
                #26 0x00007f5321e613e8 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt5Core.so.5)
                #27 0x00007f5321eb71d7 _ZL28socketNotifierSourceDispatchP8_GSourcePFiPvES1_ (libQt5Core.so.5)
                #28 0x00007f5320299520 g_main_context_dispatch (libglib-2.0.so.0)
                #29 0x00007f53202998b0 g_main_context_iterate.isra.0 (libglib-2.0.so.0)
                #30 0x00007f5320299953 g_main_context_iteration (libglib-2.0.so.0)
                #31 0x00007f5321eb6825 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5)
                #32 0x00007f5321e601db _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5)
                #33 0x00007f5321e680b6 _ZN16QCoreApplication4execEv (libQt5Core.so.5)
                #34 0x0000000000474cd1 main (albert)
                #35 0x00007f5320f031a3 __libc_start_main (libc.so.6)
                #36 0x00000000004631fe _start (albert)
                
                Stack trace of thread 30989:
                #0  0x00007f5320fd2a6f __poll (libc.so.6)
                #1  0x00007f532029981e g_main_context_iterate.isra.0 (libglib-2.0.so.0)
                #2  0x00007f5320299953 g_main_context_iteration (libglib-2.0.so.0)
                #3  0x00007f53202999a1 glib_worker_main (libglib-2.0.so.0)
                #4  0x00007f53202c2fd2 g_thread_proxy (libglib-2.0.so.0)
                #5  0x00007f5320ec34e2 start_thread (libpthread.so.0)
                #6  0x00007f5320fdd6d3 __clone (libc.so.6)
                
                Stack trace of thread 30994:
                #0  0x00007f5320eca07a pthread_cond_timedwait@@GLIBC_2.3.2 (libpthread.so.0)
                #1  0x00007f5321cb77e9 _ZN14QWaitCondition4waitEP6QMutex14QDeadlineTimer (libQt5Core.so.5)
                #2  0x00007f5321cb790b _ZN14QWaitCondition4waitEP6QMutexm (libQt5Core.so.5)
                #3  0x00007f5321cb5623 _ZN17QThreadPoolThread3runEv (libQt5Core.so.5)
                #4  0x00007f5321cb1d96 _ZN14QThreadPrivate5startEPv (libQt5Core.so.5)
                #5  0x00007f5320ec34e2 start_thread (libpthread.so.0)
                #6  0x00007f5320fdd6d3 __clone (libc.so.6)
                
                Stack trace of thread 30993:
                #0  0x00007f5320eca07a pthread_cond_timedwait@@GLIBC_2.3.2 (libpthread.so.0)
                #1  0x00007f5321cb77e9 _ZN14QWaitCondition4waitEP6QMutex14QDeadlineTimer (libQt5Core.so.5)
                #2  0x00007f5321cb790b _ZN14QWaitCondition4waitEP6QMutexm (libQt5Core.so.5)
                #3  0x00007f5321cb5623 _ZN17QThreadPoolThread3runEv (libQt5Core.so.5)
                #4  0x00007f5321cb1d96 _ZN14QThreadPrivate5startEPv (libQt5Core.so.5)
                #5  0x00007f5320ec34e2 start_thread (libpthread.so.0)
                #6  0x00007f5320fdd6d3 __clone (libc.so.6)
                
                Stack trace of thread 30992:
                #0  0x00007f5320fd2a6f __poll (libc.so.6)
                #1  0x00007f532029981e g_main_context_iterate.isra.0 (libglib-2.0.so.0)
                #2  0x00007f5320299ba3 g_main_loop_run (libglib-2.0.so.0)
                #3  0x00007f530bf40fca gdbus_shared_thread_func (libgio-2.0.so.0)
                #4  0x00007f53202c2fd2 g_thread_proxy (libglib-2.0.so.0)
                #5  0x00007f5320ec34e2 start_thread (libpthread.so.0)
                #6  0x00007f5320fdd6d3 __clone (libc.so.6)
                
                Stack trace of thread 30987:
                #0  0x00007f5320fd2a6f __poll (libc.so.6)
                #1  0x00007f532029981e g_main_context_iterate.isra.0 (libglib-2.0.so.0)
                #2  0x00007f5320299953 g_main_context_iteration (libglib-2.0.so.0)
                #3  0x00007f5321eb6825 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5)
                #4  0x00007f5321e601db _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5)
                #5  0x00007f5321cb0c45 _ZN7QThread4execEv (libQt5Core.so.5)
                #6  0x00007f53111e3f6a _ZN22QDBusConnectionManager3runEv (libQt5DBus.so.5)
                #7  0x00007f5321cb1d96 _ZN14QThreadPrivate5startEPv (libQt5Core.so.5)
                #8  0x00007f5320ec34e2 start_thread (libpthread.so.0)
                #9  0x00007f5320fdd6d3 __clone (libc.so.6)
                
                Stack trace of thread 31023:
                #0  0x00007f5320ec9d45 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
                #1  0x00007f5302fda19b util_queue_thread_func (i965_dri.so)
                #2  0x00007f5302fd9dab impl_thrd_routine (i965_dri.so)
                #3  0x00007f5320ec34e2 start_thread (libpthread.so.0)
                #4  0x00007f5320fdd6d3 __clone (libc.so.6)
                
                Stack trace of thread 30991:
                #0  0x00007f5320fd81ed syscall (libc.so.6)
                #1  0x00007f53202e5ce6 g_cond_wait_until (libglib-2.0.so.0)
                #2  0x00007f532026a411 g_async_queue_pop_intern_unlocked (libglib-2.0.so.0)
                #3  0x00007f532026aa36 g_async_queue_timeout_pop (libglib-2.0.so.0)
                #4  0x00007f53202c37b9 g_thread_pool_thread_proxy (libglib-2.0.so.0)
                #5  0x00007f53202c2fd2 g_thread_proxy (libglib-2.0.so.0)
                #6  0x00007f5320ec34e2 start_thread (libpthread.so.0)
                #7  0x00007f5320fdd6d3 __clone (libc.so.6)
                
                Stack trace of thread 30990:
                #0  0x00007f5320fd2a6f __poll (libc.so.6)
                #1  0x00007f532029981e g_main_context_iterate.isra.0 (libglib-2.0.so.0)
                #2  0x00007f5320299953 g_main_context_iteration (libglib-2.0.so.0)
                #3  0x00007f531142193d dconf_gdbus_worker_thread (libdconfsettings.so)
                #4  0x00007f53202c2fd2 g_thread_proxy (libglib-2.0.so.0)
                #5  0x00007f5320ec34e2 start_thread (libpthread.so.0)
                #6  0x00007f5320fdd6d3 __clone (libc.so.6)

UPDATE: I'm an idiot. I was in master. Had to pull the right branch.

$ git pull origin wayland-crash-fix was the answer

Disregard the below.


Hmm. Built albert from $ git clone --recursive https://github.com/johanhelsing/albert.git

Still segfaults.

$ albert -v

albert 0.16.1

$ albert
17:32:02 [WARN:default] QSocketNotifier: Can only be used with threads started with QThread
17:32:02 [INFO:default] Systems icon theme is: "Adwaita"
17:32:02 [WARN:default] Application has not been terminated graciously.
zsh: segmentation fault (core dumped)  albert
$ coredumpctl info
           PID: 29626 (albert)
           UID: 1000 (bdw)
           GID: 1000 (bdw)
        Signal: 11 (SEGV)
     Timestamp: Sun 2020-03-08 17:32:02 EDT (49s ago)
  Command Line: albert
    Executable: /usr/bin/albert
 Control Group: /user.slice/user-1000.slice/user@1000.service/gnome-terminal-server.service
          Unit: user@1000.service
     User Unit: gnome-terminal-server.service
         Slice: user-1000.slice
     Owner UID: 1000 (bdw)
       Boot ID: a6a8d60a9dea45f0b84330f3155377a8
    Machine ID: 425fe6c0cdb540fd8ae56cd03bd9cf01
      Hostname: bwx1l
       Storage: /var/lib/systemd/coredump/core.albert.1000.a6a8d60a9dea45f0b84330f3155377a8.29626.1583703122000000000000.lz4
       Message: Process 29626 (albert) of user 1000 dumped core.
                
                Stack trace of thread 29626:
                #0  0x00007f623bc97941 _XSend (libX11.so.6)
                #1  0x00007f623bc97dc4 _XFlush (libX11.so.6)
                #2  0x00007f623bc9ab0d _XGetRequest (libX11.so.6)
                #3  0x00007f623bc86442 XGetModifierMapping (libX11.so.6)
                #4  0x00000000004a4a29 _ZN14GlobalShortcut20HotkeyManagerPrivateC2EP7QObject (albert)
                #5  0x00000000004a395f _ZN14GlobalShortcut13HotkeyManagerC2EP7QObject (albert)
                #6  0x0000000000473a9b main (albert)
                #7  0x00007f623b0a91a3 __libc_start_main (libc.so.6)
                #8  0x00000000004631de _start (albert)
                
                Stack trace of thread 29629:
                #0  0x00007f623b178a6f __poll (libc.so.6)
                #1  0x00007f623a43f81e g_main_context_iterate.isra.0 (libglib-2.0.so.0)
                #2  0x00007f623a43f953 g_main_context_iteration (libglib-2.0.so.0)
                #3  0x00007f623a43f9a1 glib_worker_main (libglib-2.0.so.0)
                #4  0x00007f623a468fd2 g_thread_proxy (libglib-2.0.so.0)
                #5  0x00007f623b0694e2 start_thread (libpthread.so.0)
                #6  0x00007f623b1836d3 __clone (libc.so.6)
                
                Stack trace of thread 29630:
                #0  0x00007f623b178a6f __poll (libc.so.6)
                #1  0x00007f623a43f81e g_main_context_iterate.isra.0 (libglib-2.0.so.0)
                #2  0x00007f623a43f953 g_main_context_iteration (libglib-2.0.so.0)
                #3  0x00007f622b5c793d dconf_gdbus_worker_thread (libdconfsettings.so)
                #4  0x00007f623a468fd2 g_thread_proxy (libglib-2.0.so.0)
                #5  0x00007f623b0694e2 start_thread (libpthread.so.0)
                #6  0x00007f623b1836d3 __clone (libc.so.6)
                
                Stack trace of thread 29631:
                #0  0x00007f623b17e1ed syscall (libc.so.6)
                #1  0x00007f623a48bce6 g_cond_wait_until (libglib-2.0.so.0)
                #2  0x00007f623a410411 g_async_queue_pop_intern_unlocked (libglib-2.0.so.0)
                #3  0x00007f623a46986a g_thread_pool_thread_proxy (libglib-2.0.so.0)
                #4  0x00007f623a468fd2 g_thread_proxy (libglib-2.0.so.0)
                #5  0x00007f623b0694e2 start_thread (libpthread.so.0)
                #6  0x00007f623b1836d3 __clone (libc.so.6)
                
                Stack trace of thread 29627:
                #0  0x00007f623b178a6f __poll (libc.so.6)
                #1  0x00007f623a43f81e g_main_context_iterate.isra.0 (libglib-2.0.so.0)
                #2  0x00007f623a43f953 g_main_context_iteration (libglib-2.0.so.0)
                #3  0x00007f623c05c825 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5)
                #4  0x00007f623c0061db _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5)
                #5  0x00007f623be56c45 _ZN7QThread4execEv (libQt5Core.so.5)
                #6  0x00007f622b389f6a _ZN22QDBusConnectionManager3runEv (libQt5DBus.so.5)
                #7  0x00007f623be57d96 _ZN14QThreadPrivate5startEPv (libQt5Core.so.5)
                #8  0x00007f623b0694e2 start_thread (libpthread.so.0)
                #9  0x00007f623b1836d3 __clone (libc.so.6)
                
                Stack trace of thread 29632:
                #0  0x00007f623b178a6f __poll (libc.so.6)
                #1  0x00007f623a43f81e g_main_context_iterate.isra.0 (libglib-2.0.so.0)
                #2  0x00007f623a43fba3 g_main_loop_run (libglib-2.0.so.0)
                #3  0x00007f622a0f8fca gdbus_shared_thread_func (libgio-2.0.so.0)
                #4  0x00007f623a468fd2 g_thread_proxy (libglib-2.0.so.0)
                #5  0x00007f623b0694e2 start_thread (libpthread.so.0)
                #6  0x00007f623b1836d3 __clone (libc.so.6)

I'm not smart enough to know if it is the same crash you were trying to fix or something different.

@coquer
Copy link

coquer commented Jun 29, 2020

Any news when this will merge?

@kiloreven
Copy link

BUMP. Also having this issue on sway, installed from the OBS repo.

@tophattom
Copy link

Any idea when this will be merged?

@Flakebi
Copy link

Flakebi commented Oct 14, 2020

I also needed albertlauncher/plugins#21 to fix the widgetboxmodel plugin (otherwise it crashed on albert show). It works good with these patches.

@ManuelSchneid3r ManuelSchneid3r merged commit b979b03 into albertlauncher:dev Nov 3, 2020
ManuelSchneid3r pushed a commit that referenced this pull request Nov 22, 2020
* Fix crashes on Wayland by not loading the HotkeyManager

On Wayland, global hotkeys are often handled by the compositor instead. On sway
for instance, a config file is edited to launch specific commands when a hotkey
is entered.

On such compositors, it should be enough to show Albert by configuring the
compositor to launch "albert show" or "albert toggle" a hotkey manager in
Albert itself is redundant.

* Fix crash when exiting settings

Co-authored-by: Johan Klokkhammer Helsing <johan.helsing@qt.io>
@johanhelsing johanhelsing mentioned this pull request Dec 7, 2020
@ManuelSchneid3r ManuelSchneid3r mentioned this pull request Jan 12, 2024
90 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet