Summary: | Plasma crashes when dragging task from taskmanager to a different virtual desktop | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | Franz Trischberger <franz.trischberger> |
Component: | Task Manager and Icons-Only Task Manager | Assignee: | Eike Hein <hein> |
Status: | RESOLVED DUPLICATE | ||
Severity: | crash | CC: | bugseforuns, franz.trischberger, kde, plasma-bugs |
Priority: | NOR | Keywords: | drkonqi |
Version: | 5.15.3 | ||
Target Milestone: | 1.0 | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
New crash information added by DrKonqi
New crash information added by DrKonqi |
Description
Franz Trischberger
2019-03-27 06:24:16 UTC
I can't reproduce this unortunately, does it still happen to you with 5.16.x? Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone! This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging Thank you for helping us make KDE software even better for everyone! Created attachment 122776 [details]
New crash information added by DrKonqi
plasmashell (5.16.5) using Qt 5.12.3
- What I was doing when the application crashed:
As in the OP moving a task from VT1 to VT2.
This is with most recent plasma-5.16.5.
-- Backtrace (Reduced):
#7 0x00007f50c0c3a766 in qNumVariantToHelper<int> (handlerManager=..., val=<error reading variable>, ok=0x7ffed5cc567f, d=...) at kernel/qvariant.cpp:3140
#8 0x00007f50c0c3a766 in QVariant::toInt(bool*) const (this=0x6e6f, ok=0x7ffed5cc567f) at kernel/qvariant.cpp:3140
#9 0x00007f50b808a1a7 in TaskManager::VirtualDesktopInfo::XWindowPrivate::requestActivate(QVariant const&) (this=<optimized out>, desktop=...) at /var/tmp/portage/kde-plasma/plasma-workspace-5.16.5/work/plasma-workspace-5.16.5/libtaskmanager/virtualdesktopinfo.cpp:172
#10 0x00007f50a8208987 in PagerModel::changePage(int) (this=<optimized out>, page=2) at /var/tmp/portage/kde-plasma/plasma-desktop-5.16.5/work/plasma-desktop-5.16.5/applets/pager/plugin/pagermodel.cpp:562
#11 0x00007f50a8209994 in PagerModel::qt_metacall(QMetaObject::Call, int, void**) (this=0x5184c30, _c=QMetaObject::InvokeMetaMethod, _id=12, _a=0x7ffed5cc5870) at applets/pager/pagerplugin_autogen/include/moc_pagermodel.cpp:353
Created attachment 124856 [details]
New crash information added by DrKonqi
plasmashell (5.17.4) using Qt 5.13.2
I am now at 5.17.4, this still happens
- What I was doing when the application crashed:
As before I tried to move a task to a different VT.
If you can't reproduce just hesitate before dropping.
It also crashes when you just hover the VT widget and slowly move the mouse, keeping the left mouse button pressed.
-- Backtrace (Reduced):
#7 0x00007fdc7cc8d416 in qNumVariantToHelper<int> (handlerManager=..., val=<error reading variable>, ok=0x7ffdeb7d82df, d=...) at kernel/qvariant.cpp:3140
#8 0x00007fdc7cc8d416 in QVariant::toInt(bool*) const (this=0x6e6f, ok=0x7ffdeb7d82df) at kernel/qvariant.cpp:3140
#9 0x00007fdc7516f2a7 in TaskManager::VirtualDesktopInfo::XWindowPrivate::requestActivate(QVariant const&) (this=<optimized out>, desktop=...) at /var/tmp/portage/kde-plasma/plasma-workspace-5.17.4-r1/work/plasma-workspace-5.17.4/libtaskmanager/virtualdesktopinfo.cpp:172
#10 0x00007fdc5e72cc17 in PagerModel::changePage(int) (this=<optimized out>, page=2) at /var/tmp/portage/kde-plasma/plasma-desktop-5.17.4-r1/work/plasma-desktop-5.17.4/applets/pager/plugin/pagermodel.cpp:566
#11 0x00007fdc5e72dc24 in PagerModel::qt_metacall(QMetaObject::Call, int, void**) (this=0x2a47d50, _c=QMetaObject::InvokeMetaMethod, _id=12, _a=0x7ffdeb7d84c0) at applets/pager/pagerplugin_autogen/include/moc_pagermodel.cpp:354
I finally looked at the source code, and found the issue! The root lies in the indexing of QList vs. virtual desktops. lists get indexed starting from 0 while workspaces start from 1 (I am on X11). The crash also doesn't happen in drag/dropping code but when the pager switches to the VD you hover with the LMB still pressed (which happens after a certain timeout). I have 2 VDs configured. Then look at this function: void PagerModel::changePage(int page) { if (currentPage() == page) { if (d->showDesktop) { QDBusConnection::sessionBus().asyncCall(QDBusMessage::createMethodCall(QLatin1String("org.kde.plasmashell"), QLatin1String("/PlasmaShell"), QLatin1String("org.kde.PlasmaShell"), QLatin1String("toggleDashboard"))); } } else { if (d->pagerType == VirtualDesktops) { d->virtualDesktopInfo->requestActivate(d->virtualDesktopInfo->desktopIds().at(page)); /// here it crashes } else { const QStringList &runningActivities = d->activityInfo->runningActivities(); if (page < runningActivities.length()) { KActivities::Controller activitiesController; activitiesController.setCurrentActivity(runningActivities.at(page)); } } } } That function gets a page and directly hands it down to QVariantList in the marked line. From the callstack you can see that this function gets called with page == 2. desktopIds().at(2) is one off the end resulting in an invalid QVariant object. I created a quick proof patch: - d->virtualDesktopInfo->requestActivate(d->virtualDesktopInfo->desktopIds().at(page)); + d->virtualDesktopInfo->requestActivate(d->virtualDesktopInfo->desktopIds().at(page-1)); which fixes the crash when moving a task to a different desktop, the task lands on the selected VD and the pager switches to it. Apperently changing VDs with a click on the pager is broken with this patch. I do not know the codebase where all those dragging and clicking events get handled. But at least now the devs know how/where to fix it. A quite tricky thing to handle is wayland. Here it looks like indices are 0-based (From the code handling is done with strings). With the patch applied dragging from VD1 to VD2 now doesn't switch but call showDesktop on VD1 (which is the active desktop)... If I understand comment 6 correctly, the issue is in the pager, not in the task manager, right? Christoph, it looks like it's the Pager. I just found out that the dragEnter event (and starting of the timer + changePage invocation with the bad index) is handled in a QML file "hidden" under the package structure. Likely the cause is there. Looks like Bug 415423 then, see https://cgit.kde.org/plasma-desktop.git/commit/?id=f5d1675a0dc1a1a0098eb5b1c727b5fe197e9930 Yes, that fixes the issue. Please also close this issue: https://bugs.kde.org/show_bug.cgi?id=404909 *** This bug has been marked as a duplicate of bug 415423 *** |