Bug 387190 - plasmoidviewer doesn't work with kicker (kickoff is fine) [segfaults]
Summary: plasmoidviewer doesn't work with kicker (kickoff is fine) [segfaults]
Status: RESOLVED DUPLICATE of bug 386439
Alias: None
Product: plasmashell
Classification: Plasma
Component: Application Menu (Kicker) (show other bugs)
Version: 5.11.3
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-21 19:29 UTC by Chris Holland
Modified: 2017-11-22 01:43 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Holland 2017-11-21 19:29:55 UTC
Obviously, it works fine in plasmashell, but plasmoidviewer doesn't.

~
$ plasmoidviewer -a org.kde.plasma.kicker
QML debugging is enabled. Only use this in a safe environment.
qml: View QML loaded
Toolbox not loading, toolbox package is either invalid or disabled.
qml: New Containment: ContainmentInterface(0x17df6e0)
[KASTATSFAVS]  0x1aae100 0x0 "no client ID yet"   initForClient "org.kde.plasma.kicker.favorites.instance-2"
[KASTATSFAVS]  0x1aae100 0x1abd520 "org.kde.plasma.kicker.favorites.instance-2"   Loading the ordering  ()
[KASTATSFAVS]  0x1aae100 0x1abd520 "org.kde.plasma.kicker.favorites.instance-2"   Query is Query { Select: LinkedResources, Type: (":any"), Agent: ("org.kde.plasma.favorites.applications", "org.kde.plasma.favorites.contacts", "org.kde.plasma.favorites.documents"), Activity: (":current", ":global"), Url: ("*"), Order: HighScore, Limit: 0 }
KActivities: Database connection:  "kactivities_db_resources_139821113190592_readonly" 
    query_only:          QVariant(qlonglong, 1) 
    journal_mode:        QVariant(QString, "wal") 
    wal_autocheckpoint:  QVariant(qlonglong, 100) 
    synchronous:         QVariant(qlonglong, 0)
[KASTATSFAVS]  0x1aae100 0x0 "no client ID yet"   Activity just got changed to "e266b17a-e588-48f4-a505-f092f59ad171"
Segmentation fault (core dumped)



Confirmed in IRC:

<Zren> Does "plasmoidviewer -a org.kde.plasma.kicker" segfault for anyone else?
<fvogt> Yup.
<Zren> Hmmm, ty.
<Zren> Looks like kickerdash fails too (same project so makes sense), but kickoff works.
<fvogt> It's applets/kicker/plugin/kastatsfavoritesmodel.cpp
<fvogt> , d(nullptr) // we have no client id yet
<fvogt> But in a slot then:                 auto clientId = d->m_clientId;
<fvogt> Oh, the code is actually undefined behaviour
<fvogt> auto clientId = d->m_clientId; initForClient(clientId);
<fvogt> initForClient then does delete d; before using m_clientId
<fvogt> A guaranteed use-after-free...


https://github.com/KDE/plasma-desktop/blob/master/applets/kicker/plugin/kastatsfavoritesmodel.cpp#L458
Comment 1 Chris Holland 2017-11-21 19:56:02 UTC
It's possible that this commit in master might have fixed it, but I haven't confirmed it yet.
https://github.com/KDE/plasma-desktop/commit/6e1ae0539c4eb62979ae0d8260de2118fb232482

If so:
<fvogt> You can close a dup of bug 386439 therefore
https://bugs.kde.org/show_bug.cgi?id=386439


If not: The immediate difference seems to be that kicker has RootModel in the main.qml while kicker does not. This gives kickoff more time to fetch the client id I bet.

* https://github.com/KDE/plasma-desktop/blob/master/applets/kicker/package/contents/ui/main.qml
* https://github.com/KDE/plasma-desktop/blob/master/applets/kickoff/package/contents/ui/Kickoff.qml
Comment 2 Chris Holland 2017-11-22 01:43:26 UTC
Just confirmed plasmoidviewer worked in neon-gitunstable.

*** This bug has been marked as a duplicate of bug 386439 ***