Summary: | Plasma crashes in PopupProxy::parent() after the opening of the Klipper (Meta+V) | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | Anton K <KVAnton.WEB> |
Component: | Clipboard | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | kde-bugs, kdedev, kinofhek, lukas, mds_foss, nate, plasma-bugs, till2.schaefer |
Priority: | NOR | Keywords: | drkonqi |
Version: | 5.22.1 | ||
Target Milestone: | 1.0 | ||
Platform: | Neon | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/plasma-workspace/commit/71e465210d5491a5805a26a855232bc103ab0215 | Version Fixed In: | 5.22.3 |
Sentry Crash Report: | |||
Attachments: | Configuration of screens |
Description
Anton K
2021-06-08 17:25:03 UTC
Cannot reproduce. Looks like it's failing to get the parent, though. The line it's crashing on is: return static_cast<KlipperPopup *>(QObject::parent()); I have the same issue. Plasma crashes every time I use the Clipboard popup shortcut. Application: plasmashell (5.22.0) Qt Version: 5.15.2 Frameworks Version: 5.82.0 Operating System: Linux 5.12.9-arch1-1 x86_64 Windowing System: X11 Drkonqi Version: 5.22.0 Distribution: "Arch Linux" Backtrace: Application: Plasma (plasmashell), signal: Segmentation fault [KCrash Handler] #4 0x00007f79e727b752 in () at /usr/lib/qt/plugins/plasma/dataengine/plasma_engine_clipboard.so #5 0x00007f79e7279d2b in () at /usr/lib/qt/plugins/plasma/dataengine/plasma_engine_clipboard.so #6 0x00007f79e727a033 in () at /usr/lib/qt/plugins/plasma/dataengine/plasma_engine_clipboard.so #7 0x00007f79e725f523 in () at /usr/lib/qt/plugins/plasma/dataengine/plasma_engine_clipboard.so #8 0x00007f7a2174e3bb in () at /usr/lib/libQt5Core.so.5 #9 0x00007f7a223c7203 in QAction::triggered(bool) () at /usr/lib/libQt5Widgets.so.5 #10 0x00007f7a223c9f18 in QAction::activate(QAction::ActionEvent) () at /usr/lib/libQt5Widgets.so.5 #11 0x00007f7a234356ea in () at /usr/lib/libKF5GlobalAccel.so.5 #12 0x00007f7a2174e3bb in () at /usr/lib/libQt5Core.so.5 #13 0x00007f7a2343ffa5 in () at /usr/lib/libKF5GlobalAccel.so.5 #14 0x00007f7a234401c3 in () at /usr/lib/libKF5GlobalAccel.so.5 #15 0x00007f7a220b9300 in () at /usr/lib/libQt5DBus.so.5 #16 0x00007f7a2174415f in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5 #17 0x00007f7a223cdd62 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5 #18 0x00007f7a2171700a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5 #19 0x00007f7a2171a109 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/libQt5Core.so.5 #20 0x00007f7a21770604 in () at /usr/lib/libQt5Core.so.5 #21 0x00007f7a1fa3802c in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0 #22 0x00007f7a1fa8bb59 in () at /usr/lib/libglib-2.0.so.0 #23 0x00007f7a1fa35781 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0 #24 0x00007f7a2176fc36 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5 #25 0x00007f7a2171597c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5 #26 0x00007f7a2171dee4 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5 #27 0x00005654bd2dd20f in () #28 0x00007f7a210a1b25 in __libc_start_main () at /usr/lib/libc.so.6 #29 0x00005654bd2dd34e in () [Inferior 1 (process 1498) detached] Probably only happens with multiple displays. Workaround: * Disable secondary display (or all except one). * Invoke shortcut. Plasma will crash once, but then it will work. Just restarting Plasma would probably do the job, too. * Re-enable other displays. * Will work until reboot (or probably until Plasma is restarted). Also, my secondary left display is smaller than my primary right display and aligned to the bottom. When I align the left screen to the top, it works, too. I can reproduce this issue too. My left screen is smaller than my right one and aligned further down. I can confirm Sebastian's workaround to work as well. And replacing step one with "Align both screens at the top" does the job also. (In reply to Sebastian E. from comment #3 and comment #4) Yes, I also have 2 monitor (second in vertical orientation). And this Sebastian's-"solution" works. 5.22.1 Not fixed On that note, I can also say that this issue does not affect 5.21.X versions. The issue was introduced with the release of 5.22.0. Between those two versions, the most significant change in Klipper seems to be the implementation of QScreen in `klipperpopup.cpp`. I assume that __could__ be the source of trouble, since this crash seems to happen on setups with two screens. The change occurred in 6befb657dd9fd811160e0369913d769cfff7f02d. Cannot reproduce on master (using two monitors aligned at the bottom). Created attachment 139485 [details]
Configuration of screens
Alignment at bottom is not sufficient to reproduce the issue. There also must be no screen at the top left of the virtual geometry. https://invent.kde.org/plasma/plasma-workspace/-/blob/9d2051b0ec2d4857a61d17d9d3f766614c0f42d7/klipper/klipperpopup.cpp So, the constructor gets the window info of a QMenu that's just been initialized and then calls QGuiApplication::screenAt to query the screen at its center. I don't know what's the initial size of a QMenu, but I assume the coordinates of its center are not much more than (50, 50). So because there is no screen in our case, the constructor returns early, leaving m_popupProxy uninitialized. Because m_dirty is initially true, rebuild() will be called on the aboutToShow signal, where m_popupProxy is dereferenced while being null. Boom. Aside from that, the intent of the code seems to be to determine the maximum width and height of the popup. Uhm, well, the code could as well just take a random screen from QGuiApplication::screens(). The correct thing to do would be to iterate QGuiApplication::screens() and collect the minimum width and height. Wondering why it crashes in PopupProxy::parent(), and not in KlipperPopup::rebuild()... Calling methods on null objects may work until "this" is actually accessed, which doesn't happen before PopupProxy::parent() or QObject::parent(). 5.22.2 Not fixed @Felipe Kinoshita Could you please revert or fix your commit that broke it? https://invent.kde.org/plasma/plasma-workspace/-/commit/6befb657dd9fd811160e0369913d769cfff7f02d Your commit reintroduced a change that has been reverted before: https://invent.kde.org/plasma/plasma-workspace/-/commit/885c4abe7b5343caa7407c4b441b2cfcd78828c3 Fixing that warning along with the change did not really help, it just crashes differently. Alternatively replace if (screen == nullptr) { return; } with if (screen == nullptr) screen = QGuiApplication::screens()[0] Thank you. Sure, also why you don't make this change, seems like you have been studying this code a lot recently, just create a merge request and I can take a loot at it. (In reply to Felipe Kinoshita from comment #15) > Sure, also why you don't make this change, seems like you have been studying > this code a lot recently, just create a merge request and I can take a loot > at it. I've already read parts of the "Get involved" guide, and successfully installed kdesrc-build and built/run Dolphin. But I still need to figure out more stuff, like setting up CLion, code style, git-pulling the latest changes, properly run it on my existing system, testing, Gitlab account, how to make a merge request, etc... If I've had enough time, I would have done it myself. But yeah, I'll probably contribute in the future. If you want any help you can call me at @fhek789:kde.org on matrix. A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/947 Git commit 60ab32584b3322b384342e1bb784c07123d4ad7b by Felipe Kinoshita. Committed on 25/06/2021 at 03:56. Pushed by fhek into branch 'master'. Assing first screen if `screen` is null M +1 -1 klipper/klipperpopup.cpp https://invent.kde.org/plasma/plasma-workspace/commit/60ab32584b3322b384342e1bb784c07123d4ad7b Git commit 71e465210d5491a5805a26a855232bc103ab0215 by Nate Graham, on behalf of Felipe Kinoshita. Committed on 26/06/2021 at 00:45. Pushed by ngraham into branch 'Plasma/5.22'. Assing first screen if `screen` is null (cherry picked from commit 60ab32584b3322b384342e1bb784c07123d4ad7b) M +1 -1 klipper/klipperpopup.cpp https://invent.kde.org/plasma/plasma-workspace/commit/71e465210d5491a5805a26a855232bc103ab0215 *** Bug 438926 has been marked as a duplicate of this bug. *** *** Bug 439642 has been marked as a duplicate of this bug. *** |