jlindgren90 / qmpanel

A Minimal Qt-Based Desktop Panel
GNU Lesser General Public License v2.1
13 stars 6 forks source link

segfault on wayland #1

Closed stefonarch closed 1 year ago

stefonarch commented 1 year ago

Stumpled upon this only now, but it doesn't start on wayland at all here:

 Message: Process 70133 (qmpanel) of user 1000 dumped core.

                Stack trace of thread 70133:
                #0  0x00007f6fccf88dcf n/a (libX11.so.6 + 0x2cdcf)
                #1  0x00007f6fccf8931e XInternAtom (libX11.so.6 + 0x2d31e)
                #2  0x000055e46dd6ffe8 _ZN7SysTrayC2EP7QWidget (qmpanel + 0x1cfe8)
                #3  0x000055e46dd6ca30 _ZN9MainPanelC2ER9Resources (qmpanel + 0x19a30)
                #4  0x000055e46dd68bb6 main (qmpanel + 0x15bb6)
                #5  0x00007f6fcb03c790 n/a (libc.so.6 + 0x23790)
                #6  0x00007f6fcb03c84a __libc_start_main (libc.so.6 + 0x2384a)
                #7  0x000055e46dd68c85 _start (qmpanel + 0x15c85)

                Stack trace of thread 70134:
                #0  0x00007f6fcb1139df __poll (libc.so.6 + 0xfa9df)
                #1  0x00007f6fccc6dc2f n/a (libglib-2.0.so.0 + 0xacc2f)
                #2  0x00007f6fccc150e2 g_main_context_iteration (libglib-2.0.so.0 + 0x540e2)
                #3  0x00007f6fcb8d8c6c _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2d8c6c)
                #4  0x00007f6fcb8866ec _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2866ec)
                #5  0x00007f6fcb6e725f _ZN7QThread4execEv (libQt5Core.so.5 + 0xe725f)
                #6  0x00007f6fc8253cba n/a (libQt5DBus.so.5 + 0x23cba)
                #7  0x00007f6fcb6e432a n/a (libQt5Core.so.5 + 0xe432a)
                #8  0x00007f6fcb09ebb5 n/a (libc.so.6 + 0x85bb5)
                #9  0x00007f6fcb120d90 n/a (libc.so.6 + 0x107d90)

                Stack trace of thread 70140:
                #0  0x00007f6fcb09b766 n/a (libc.so.6 + 0x82766)
                #1  0x00007f6fcb09e294 pthread_cond_timedwait (libc.so.6 + 0x85294)
                #2  0x00007f6fcb6eb754 _ZN14QWaitCondition4waitEP6QMutex14QDeadlineTimer (libQt5Core.so.5 + 0xeb754)
                #3  0x00007f6fcb6e82f7 n/a (libQt5Core.so.5 + 0xe82f7)
                #4  0x00007f6fcb6e432a n/a (libQt5Core.so.5 + 0xe432a)
                #5  0x00007f6fcb09ebb5 n/a (libc.so.6 + 0x85bb5)
                #6  0x00007f6fcb120d90 n/a (libc.so.6 + 0x107d90)

                Stack trace of thread 70137:
                #0  0x00007f6fcb052c0a __sigtimedwait (libc.so.6 + 0x39c0a)
                #1  0x00007f6fcb0522dc sigwait (libc.so.6 + 0x392dc)
                #2  0x000055e46dd6a9ae n/a (qmpanel + 0x179ae)
                #3  0x00007f6fcb2d72c3 execute_native_thread_routine (libstdc++.so.6 + 0xd72c3)
                #4  0x00007f6fcb09ebb5 n/a (libc.so.6 + 0x85bb5)
                #5  0x00007f6fcb120d90 n/a (libc.so.6 + 0x107d90)

                Stack trace of thread 70136:
                #0  0x00007f6fcb1139df __poll (libc.so.6 + 0xfa9df)
                #1  0x00007f6fc8322d1d n/a (libQt5WaylandClient.so.5 + 0x72d1d)
                #2  0x00007f6fcb6e432a n/a (libQt5Core.so.5 + 0xe432a)
                #3  0x00007f6fcb09ebb5 n/a (libc.so.6 + 0x85bb5)
                #4  0x00007f6fcb120d90 n/a (libc.so.6 + 0x107d90)

                Stack trace of thread 70135:
                #0  0x00007f6fcb09b766 n/a (libc.so.6 + 0x82766)
                #1  0x00007f6fcb09df90 pthread_cond_wait (libc.so.6 + 0x84f90)
                #2  0x00007f6fcb6eb7c4 _ZN14QWaitCondition4waitEP6QMutex14QDeadlineTimer (libQt5Core.so.5 + 0xeb7c4)
                #3  0x00007f6fc8322cc4 n/a (libQt5WaylandClient.so.5 + 0x72cc4)
                #4  0x00007f6fcb6e432a n/a (libQt5Core.so.5 + 0xe432a)
                #5  0x00007f6fcb09ebb5 n/a (libc.so.6 + 0x85bb5)
                #6  0x00007f6fcb120d90 n/a (libc.so.6 + 0x107d90)

                Stack trace of thread 70138:
                #0  0x00007f6fcb1139df __poll (libc.so.6 + 0xfa9df)
                #1  0x00007f6fccc6dc2f n/a (libglib-2.0.so.0 + 0xacc2f)
                #2  0x00007f6fccc150e2 g_main_context_iteration (libglib-2.0.so.0 + 0x540e2)
                #3  0x00007f6fccc15132 n/a (libglib-2.0.so.0 + 0x54132)
                #4  0x00007f6fccc43db5 n/a (libglib-2.0.so.0 + 0x82db5)
                #5  0x00007f6fcb09ebb5 n/a (libc.so.6 + 0x85bb5)
                #6  0x00007f6fcb120d90 n/a (libc.so.6 + 0x107d90)

                Stack trace of thread 70141:
                #0  0x00007f6fcb09b766 n/a (libc.so.6 + 0x82766)
                #1  0x00007f6fcb09e294 pthread_cond_timedwait (libc.so.6 + 0x85294)
                #2  0x00007f6fcb6eb754 _ZN14QWaitCondition4waitEP6QMutex14QDeadlineTimer (libQt5Core.so.5 + 0xeb754)
                #3  0x00007f6fcb6e82f7 n/a (libQt5Core.so.5 + 0xe82f7)
                #4  0x00007f6fcb6e432a n/a (libQt5Core.so.5 + 0xe432a)
                #5  0x00007f6fcb09ebb5 n/a (libc.so.6 + 0x85bb5)
                #6  0x00007f6fcb120d90 n/a (libc.so.6 + 0x107d90)

                Stack trace of thread 70139:
                #0  0x00007f6fcb1139df __poll (libc.so.6 + 0xfa9df)
                #1  0x00007f6fccc6dc2f n/a (libglib-2.0.so.0 + 0xacc2f)
                #2  0x00007f6fccc15d8f g_main_loop_run (libglib-2.0.so.0 + 0x54d8f)
                #3  0x00007f6fcce6baec n/a (libgio-2.0.so.0 + 0x10aaec)
                #4  0x00007f6fccc43db5 n/a (libglib-2.0.so.0 + 0x82db5)
                #5  0x00007f6fcb09ebb5 n/a (libc.so.6 + 0x85bb5)
                #6  0x00007f6fcb120d90 n/a (libc.so.6 + 0x107d90)

                Stack trace of thread 70143:
                #0  0x00007f6fcb09b766 n/a (libc.so.6 + 0x82766)
                #1  0x00007f6fcb09e294 pthread_cond_timedwait (libc.so.6 + 0x85294)
                #2  0x00007f6fcb6eb754 _ZN14QWaitCondition4waitEP6QMutex14QDeadlineTimer (libQt5Core.so.5 + 0xeb754)
                #3  0x00007f6fcb6e82f7 n/a (libQt5Core.so.5 + 0xe82f7)
                #4  0x00007f6fcb6e432a n/a (libQt5Core.so.5 + 0xe432a)
                #5  0x00007f6fcb09ebb5 n/a (libc.so.6 + 0x85bb5)
                #6  0x00007f6fcb120d90 n/a (libc.so.6 + 0x107d90)

                Stack trace of thread 70142:
                #0  0x00007f6fcb09b766 n/a (libc.so.6 + 0x82766)
                #1  0x00007f6fcb09e294 pthread_cond_timedwait (libc.so.6 + 0x85294)
                #2  0x00007f6fcb6eb754 _ZN14QWaitCondition4waitEP6QMutex14QDeadlineTimer (libQt5Core.so.5 + 0xeb754)
                #3  0x00007f6fcb6e82f7 n/a (libQt5Core.so.5 + 0xe82f7)
                #4  0x00007f6fcb6e432a n/a (libQt5Core.so.5 + 0xe432a)
                #5  0x00007f6fcb09ebb5 n/a (libc.so.6 + 0x85bb5)
                #6  0x00007f6fcb120d90 n/a (libc.so.6 + 0x107d90)
                ELF object binary architecture: AMD x86-64

(gdb) where
#0  0x00007f6fccf88dcf in  () at /usr/lib/libX11.so.6
#1  0x00007f6fccf8931e in XInternAtom () at /usr/lib/libX11.so.6
#2  0x000055e46dd6ffe8 in SysTray::SysTray(QWidget*) ()
#3  0x000055e46dd6ca30 in MainPanel::MainPanel(Resources&) ()
#4  0x000055e46dd68bb6 in main ()
(gdb) 
jlindgren90 commented 1 year ago

Yes, qmpanel is X11 (or XWayland) only for now. I have not ruled out porting it to Wayland later, but do not have time at this point.

jlindgren90 commented 1 year ago

I've made a little bit of progress on this, and version 0.2 starts and runs okay for me under labwc with QT_QPA_PLATFORM=wayland. It's not very useful yet, however:

stefonarch commented 1 year ago

Confirming that it works fine now, for the position and exclusive zone layer-shell-qt could be used but in it's actual state every popup or config window will be fullscreen and at 0 0, at least with our trials for lxqt-panel it was like that. Things should change with qt6.6.

Work are those rules for lxqt-panel:


 <margin top="38"/>
  <windowRules>
    <windowRule identifier="qmpanel" skipTaskBar="yes" skipWindowSwitcher="yes" matchOnce="true">
      <action name="ToggleAlwaysOnBottom"/>
      <action name="MoveTo" x="0" y="0"/>
      <action name="ToggleKeyBinds" />
    </windowRule>
  </windowRules>

~But systray doesn't show all items, maybe statusnotifier missing?~ Edit: the missing icons are just invisible but present.

It might show something under KWin, not sure.

Tested in my kwin-wayland-lxqt session, unfortunately no. Atm kwin-wayland is unusable with LXQt as there is no way to have any taskbar.

What lxqt-panel is missing (besides positioning, layers and exclusive zone) is mostly a wayland-taskbar plugin based on wlr-foreign-toplevel-management protocol. I don't think the actual taskbar plugin could be ported to wayland, as it handles also workspaces.

stefonarch commented 1 year ago

Just discovered that the taskbar actually is present but buttons are only on mouseover somehow visible (and working):

screen_area_lun_12:25:39_

EDIT: it's waybar below...

jlindgren90 commented 1 year ago

But systray doesn't show all items, maybe statusnotifier missing? Edit: the missing icons are just invisible but present.

It could be they are using IconPixmap rather than icon names. Do you mind opening a new issue for this, and let me know which apps are showing invisible icons? All the ones I tested so far are working.

lidgnulinux commented 10 months ago

Rather than make new issue, Allow me to report that qmpanel seems still get segfault on wayland (x11 is fine). I'm trying it on some wayland compositors and get same result. It suspicious since the compilation.

WARNING: CMake: Dependency Qt5::X11Extras for KF5WindowSystem was not found
Run-time dependency kf5windowsystem found: YES 5.112.0

But the compilation is done successfully.

When I run the qmpanel I got this :

[qmpanel]$ QT_QPA_PLATFORM=wayland b/qmpanel
kf.windowsystem: Could not find any platform plugin
Segmentation fault

Any clue to fix it ? Thanks

stefonarch commented 10 months ago

Confirmed, the installed version I had worked, updating from ea2946c2 > 06719aff it segfaults with

#0  0x00007fd8331f5a9a in xcb_flush () at /usr/lib/libxcb.so.1
#1  0x0000558a474d4101 in MainPanel::updateGeometry() (this=0x7ffe201dab30)
    at ../panel/mainpanel.cpp:135
#2  0x0000558a474cdc1c in MainPanel::showEvent(QShowEvent*)
    (this=0x7ffe201dab30, event=0x7ffe201da8f0) at ../panel/mainpanel.h:47
#3  0x00007fd831daf1fd in QWidget::event(QEvent*) ()
    at /usr/lib/libQt5Widgets.so.5
#4  0x00007fd831d788ff in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#5  0x00007fd832e9bef8 in QCoreApplication::notifyInternal2(QObject*, QEvent*)
    () at /usr/lib/libQt5Core.so.5
#6  0x00007fd831daddb0 in QWidgetPrivate::show_helper() ()
    at /usr/lib/libQt5Widgets.so.5
#7  0x00007fd831dae3cd in QWidgetPrivate::setVisible(bool) ()
    at /usr/lib/libQt5Widgets.so.5
#8  0x0000558a474d3846 in MainPanel::MainPanel(Resources&)
    (this=0x7ffe201dab30, res=...) at ../panel/mainpanel.cpp:64
#9  0x0000558a474cd831 in main(int, char**) (argc=1, argv=0x7ffe201dace8)
    at ../panel/main.cpp:68
(gdb)