Bug 444793

Summary: Segfault on startup after failing to load layout
Product: [Unmaintained] lattedock Reporter: Alex Dewar <alex.dewar>
Component: applicationAssignee: Michail Vourlakos <mvourlakos>
Status: RESOLVED WORKSFORME    
Severity: critical    
Priority: NOR    
Version First Reported In: git (master)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Alex Dewar 2021-11-01 21:41:03 UTC
SUMMARY
When starting the latest version of lattedock, I get a segfault before the application even starts up. After debugging it seems that there's a null pointer dereference happening here: https://github.com/KDE/latte-dock/blob/90405fef8a6e7ec272ded6ffb807fe2ac6daf978/app/layouts/synchronizer.cpp#L640


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: NixOS (unstable channel)
(available in About System)
KDE Plasma Version: 5.23.1
KDE Frameworks Version: 5.86.0
Qt Version: 5.15.2
Comment 1 Michail Vourlakos 2021-11-02 18:26:33 UTC
The line you are mentioning could crash only in the following scenario:
1. Latte is loading and layouts manager (m_manager) is created
2. synchronizer is created from m_manager because synchronizer is a child of m_manager
3. For some weird reason Layouts Manager (m_manager) is destroyed that means Latte is fully unloading 
4. Because Latte is unloading even though it should not because of [3] m_manager becomes null so that specific line crashes.

A1. Do you have the backtrace to check it out?
A2. Is your system configured properly for latte startup as mentioned at? https://psifidotos.blogspot.com/2021/08/latte-dock-v0101-bug-fix-release.html
Comment 2 Michail Vourlakos 2021-11-03 19:26:06 UTC
waiting feedback.
Comment 3 Alex Dewar 2021-11-06 15:41:27 UTC
Sorry for the slow reply. I haven't had a chance to look at this again until now. In answer to your question, yes latte-dock is configured as specified. The backtrace is below.

Thread 1 "latte-dock" received signal SIGSEGV, Segmentation fault.
0x00007ffff79d75c0 in Plasma::Applet::actions() const () from /nix/store/8xz87wxxi7x3xkh5vb0g2wypjbza6pnz-plasma-framework-5.86.0/lib/libKF5Plasma.so.5
(gdb) bt
#0  0x00007ffff79d75c0 in Plasma::Applet::actions() const ()
   from /nix/store/8xz87wxxi7x3xkh5vb0g2wypjbza6pnz-plasma-framework-5.86.0/lib/libKF5Plasma.so.5
#1  0x00007fffcc00c8dc in Menu::makeActions() ()
   from /nix/store/lhxhb5dgdlpvpch2vd93c3pazrw0ng44-latte-dock-0.10.0/lib/qt-5.15.2/plugins/plasma_containmentactions_lattecontextmenu.so
#2  0x00007fffcc016108 in QObject* KPluginFactory::createInstance<Menu, QObject>(QWidget*, QObject*, QList<QVariant> const&) ()
   from /nix/store/lhxhb5dgdlpvpch2vd93c3pazrw0ng44-latte-dock-0.10.0/lib/qt-5.15.2/plugins/plasma_containmentactions_lattecontextmenu.so
#3  0x00007ffff5b333a2 in KPluginFactory::create(char const*, QWidget*, QObject*, QList<QVariant> const&, QString const&) () from /nix/store/xm1276viw6zx0aglk512gjfj6rqgqpbk-kcoreaddons-5.86.0/lib/libKF5CoreAddons.so.5
#4  0x00007ffff79d4903 in KPluginFactory::Result<Plasma::ContainmentActions> KPluginFactory::instantiatePlugin<Plasma::ContainmentActions>(KPluginMetaData const&, QObject*, QList<QVariant> const&) ()
   from /nix/store/8xz87wxxi7x3xkh5vb0g2wypjbza6pnz-plasma-framework-5.86.0/lib/libKF5Plasma.so.5
#5  0x00007ffff79d0779 in Plasma::PluginLoader::loadContainmentActions(Plasma::Containment*, QString const&, QList<QVariant> const&) ()
   from /nix/store/8xz87wxxi7x3xkh5vb0g2wypjbza6pnz-plasma-framework-5.86.0/lib/libKF5Plasma.so.5
#6  0x00007ffff79df457 in Plasma::Containment::setContainmentActions(QString const&, QString const&) ()
   from /nix/store/8xz87wxxi7x3xkh5vb0g2wypjbza6pnz-plasma-framework-5.86.0/lib/libKF5Plasma.so.5
#7  0x00007ffff79e0b38 in Plasma::Containment::restore(KConfigGroup&) ()
   from /nix/store/8xz87wxxi7x3xkh5vb0g2wypjbza6pnz-plasma-framework-5.86.0/lib/libKF5Plasma.so.5
#8  0x00007ffff79e8775 in Plasma::CoronaPrivate::addContainment(QString const&, QList<QVariant> const&, unsigned int, int, bool) () from /nix/store/8xz87wxxi7x3xkh5vb0g2wypjbza6pnz-plasma-framework-5.86.0/lib/libKF5Plasma.so.5
#9  0x00007ffff79e94a1 in Plasma::CoronaPrivate::importLayout(KConfigGroup const&, bool) ()
   from /nix/store/8xz87wxxi7x3xkh5vb0g2wypjbza6pnz-plasma-framework-5.86.0/lib/libKF5Plasma.so.5
#10 0x00007ffff79eb72a in Plasma::Corona::loadLayout(QString const&) ()
   from /nix/store/8xz87wxxi7x3xkh5vb0g2wypjbza6pnz-plasma-framework-5.86.0/lib/libKF5Plasma.so.5
#11 0x00000000004c1558 in operator() (__closure=0xab65d0)
    at /home/alex/code/latte-dock/app/layouts/synchronizer.cpp:640
#12 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, Latte::Layouts::Synchronizer::initSingleMode(QString)::<lambda()> >::call (arg=<optimized out>, f=...)
    at /nix/store/fjc4zva4yzg407fy3wmp3dxhzbx5pw82-qtbase-5.15.2-dev/include/QtCore/qobjectdefs_impl.h:146
#13 QtPrivate::Functor<Latte::Layouts::Synchronizer::initSingleMode(QString)::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...)
    at /nix/store/fjc4zva4yzg407fy3wmp3dxhzbx5pw82-qtbase-5.15.2-dev/include/QtCore/qobjectdefs_impl.h:256
#14 QtPrivate::QFunctorSlotObject<Latte::Layouts::Synchronizer::initSingleMode(QString)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>,
    this_=0xab65c0, r=<optimized out>, a=<optimized out>, ret=<optimized out>)
    at /nix/store/fjc4zva4yzg407fy3wmp3dxhzbx5pw82-qtbase-5.15.2-dev/include/QtCore/qobjectdefs_impl.h:443
--Type <RET> for more, q to quit, c to continue without paging--
#15 0x00007ffff4fd03a2 in ?? () from /nix/store/q72zhwmqsrp7b9pmim7bfgwfqpzcbk66-qtbase-5.15.2/lib/libQt5Core.so.5
#16 0x00007ffff4fc202f in QObject::event(QEvent*) () from /nix/store/q72zhwmqsrp7b9pmim7bfgwfqpzcbk66-qtbase-5.15.2/lib/libQt5Core.so.5
#17 0x00007ffff5db474f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /nix/store/q72zhwmqsrp7b9pmim7bfgwfqpzcbk66-qtbase-5.15.2/lib/libQt5Widgets.so.5
#18 0x00007ffff4f9538a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /nix/store/q72zhwmqsrp7b9pmim7bfgwfqpzcbk66-qtbase-5.15.2/lib/libQt5Core.so.5
#19 0x00007ffff4fec88b in QTimerInfoList::activateTimers() () from /nix/store/q72zhwmqsrp7b9pmim7bfgwfqpzcbk66-qtbase-5.15.2/lib/libQt5Core.so.5
#20 0x00007ffff4fed14c in ?? () from /nix/store/q72zhwmqsrp7b9pmim7bfgwfqpzcbk66-qtbase-5.15.2/lib/libQt5Core.so.5
#21 0x00007ffff1a51a9b in g_main_context_dispatch () from /nix/store/1pj0qrswyq0iyfa4xzqwppnfxszvh868-glib-2.70.0/lib/libglib-2.0.so.0
#22 0x00007ffff1a51d48 in g_main_context_iterate.constprop () from /nix/store/1pj0qrswyq0iyfa4xzqwppnfxszvh868-glib-2.70.0/lib/libglib-2.0.so.0
#23 0x00007ffff1a51dff in g_main_context_iteration () from /nix/store/1pj0qrswyq0iyfa4xzqwppnfxszvh868-glib-2.70.0/lib/libglib-2.0.so.0
#24 0x00007ffff4fed4e0 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /nix/store/q72zhwmqsrp7b9pmim7bfgwfqpzcbk66-qtbase-5.15.2/lib/libQt5Core.so.5
#25 0x00007ffff4f93d3b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /nix/store/q72zhwmqsrp7b9pmim7bfgwfqpzcbk66-qtbase-5.15.2/lib/libQt5Core.so.5
#26 0x00007ffff4f9c320 in QCoreApplication::exec() () from /nix/store/q72zhwmqsrp7b9pmim7bfgwfqpzcbk66-qtbase-5.15.2/lib/libQt5Core.so.5
#27 0x000000000043d57e in main (argc=<optimized out>, argv=0x7fffffff40b0) at /home/alex/code/latte-dock/app/main.cpp:327
Comment 4 Michail Vourlakos 2021-11-06 16:09:48 UTC
run in cmd, latte-dock -v

what is your latte version?
Comment 5 Michail Vourlakos 2021-11-06 16:23:52 UTC
has been fixed with Latte v0.10.2
Comment 6 Alex Dewar 2021-11-06 17:58:53 UTC
I just built v0.10.3 and I'm getting exactly the same error.
Comment 7 Michail Vourlakos 2021-11-06 18:07:46 UTC
(In reply to Alex Dewar from comment #6)
> I just built v0.10.3 and I'm getting exactly the same error.

No idea what is wrong in your build, install system then. The crash is identifiable and comes from containmentactions changes that were introduced with kf5 5.86
It was fixed with latte v0.10.2 which is also part of 0.10.3. 

Nothing to do with the line you mentioned.
Comment 8 Michail Vourlakos 2021-11-06 18:10:29 UTC
Show me the new crash report please because it might be a different one.
Comment 9 Michail Vourlakos 2021-11-06 18:58:01 UTC
waiting for new backtrace
Comment 10 Alex Dewar 2021-11-09 09:59:28 UTC
Sorry, you're totally right. The backtrace was completely different this time:

Thread 1 "latte-dock" received signal SIGSEGV, Segmentation fault.
0x00007ffff79b3700 in Plasma::Applet::actions() const () from /nix/store/klj3bampx885gs5zc71md2xa6mfkabh0-plasma-framework-5.87.0/lib/libKF5Plasma.so.5
(gdb) bt
#0  0x00007ffff79b3700 in Plasma::Applet::actions() const ()
   from /nix/store/klj3bampx885gs5zc71md2xa6mfkabh0-plasma-framework-5.87.0/lib/libKF5Plasma.so.5
#1  0x00007fffa40ab8dc in Menu::makeActions() ()
   from /nix/store/p8paf5aim9py2sv7ix76rrf0fp1laiif-latte-dock-0.10.0/lib/qt-5.15.2/plugins/plasma_containmentactions_lattecontextmenu.so
#2  0x00007fffa40b5108 in QObject* KPluginFactory::createInstance<Menu, QObject>(QWidget*, QObject*, QList<QVariant> const&) ()
   from /nix/store/p8paf5aim9py2sv7ix76rrf0fp1laiif-latte-dock-0.10.0/lib/qt-5.15.2/plugins/plasma_containmentactions_lattecontextmenu.so
#3  0x00007ffff5aed672 in KPluginFactory::create(char const*, QWidget*, QObject*, QList<QVariant> const&, QString const&) ()
   from /nix/store/a385qmx6q1mmglhhrxnfxjz07mgzx45b-kcoreaddons-5.87.0/lib/libKF5CoreAddons.so.5
#4  0x00007ffff79b0a63 in KPluginFactory::Result<Plasma::ContainmentActions> KPluginFactory::instantiatePlugin<Plasma::ContainmentActions>(KPluginMetaData const&, QObject*, QList<QVariant> const&) ()
   from /nix/store/klj3bampx885gs5zc71md2xa6mfkabh0-plasma-framework-5.87.0/lib/libKF5Plasma.so.5
#5  0x00007ffff79ac47b in Plasma::PluginLoader::loadContainmentActions(Plasma::Containment*, QString const&, QList<QVariant> const&) ()
   from /nix/store/klj3bampx885gs5zc71md2xa6mfkabh0-plasma-framework-5.87.0/lib/libKF5Plasma.so.5
#6  0x00007ffff79bb537 in Plasma::Containment::setContainmentActions(QString const&, QString const&) ()
   from /nix/store/klj3bampx885gs5zc71md2xa6mfkabh0-plasma-framework-5.87.0/lib/libKF5Plasma.so.5
#7  0x00007ffff79bcc18 in Plasma::Containment::restore(KConfigGroup&) ()
   from /nix/store/klj3bampx885gs5zc71md2xa6mfkabh0-plasma-framework-5.87.0/lib/libKF5Plasma.so.5
#8  0x00007ffff79c4855 in Plasma::CoronaPrivate::addContainment(QString const&, QList<QVariant> const&, unsigned int, int, bool) ()
   from /nix/store/klj3bampx885gs5zc71md2xa6mfkabh0-plasma-framework-5.87.0/lib/libKF5Plasma.so.5
#9  0x00007ffff79c5581 in Plasma::CoronaPrivate::importLayout(KConfigGroup const&, bool) ()
   from /nix/store/klj3bampx885gs5zc71md2xa6mfkabh0-plasma-framework-5.87.0/lib/libKF5Plasma.so.5
#10 0x00007ffff79c780a in Plasma::Corona::loadLayout(QString const&) ()
   from /nix/store/klj3bampx885gs5zc71md2xa6mfkabh0-plasma-framework-5.87.0/lib/libKF5Plasma.so.5
#11 0x00000000004c23a8 in operator() (__closure=0xa4a840) at /home/alex/code/latte-dock/app/layouts/synchronizer.cpp:640
#12 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, Latte::Layouts::Synchronizer::initSingleMode(QString)::<lambda()> >::call (arg=<optimized out>, f=...)
    at /nix/store/yllw0d88ra3w4q439bn2sj0f2rs1y12v-qtbase-5.15.2-dev/include/QtCore/qobjectdefs_impl.h:146
#13 QtPrivate::Functor<Latte::Layouts::Synchronizer::initSingleMode(QString)::<lambda()>, 0>::call<QtPrivate::List<>, void> (
    arg=<optimized out>, f=...) at /nix/store/yllw0d88ra3w4q439bn2sj0f2rs1y12v-qtbase-5.15.2-dev/include/QtCore/qobjectdefs_impl.h:256
#14 QtPrivate::QFunctorSlotObject<Latte::Layouts::Synchronizer::initSingleMode(QString)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0xa4a830, r=<optimized out>,
    a=<optimized out>, ret=<optimized out>)
    at /nix/store/yllw0d88ra3w4q439bn2sj0f2rs1y12v-qtbase-5.15.2-dev/include/QtCore/qobjectdefs_impl.h:443
#15 0x00007ffff4f833a2 in ?? () from /nix/store/dj66jij1jaa2iywh4cgar3h4js9brr4a-qtbase-5.15.2/lib/libQt5Core.so.5
#16 0x00007ffff4f7502f in QObject::event(QEvent*) () from /nix/store/dj66jij1jaa2iywh4cgar3h4js9brr4a-qtbase-5.15.2/lib/libQt5Core.so.5
#17 0x00007ffff5d6f74f in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /nix/store/dj66jij1jaa2iywh4cgar3h4js9brr4a-qtbase-5.15.2/lib/libQt5Widgets.so.5
#18 0x00007ffff4f4838a in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
   from /nix/store/dj66jij1jaa2iywh4cgar3h4js9brr4a-qtbase-5.15.2/lib/libQt5Core.so.5
#19 0x00007ffff4f9f88b in QTimerInfoList::activateTimers() ()
   from /nix/store/dj66jij1jaa2iywh4cgar3h4js9brr4a-qtbase-5.15.2/lib/libQt5Core.so.5
#20 0x00007ffff4fa014c in ?? () from /nix/store/dj66jij1jaa2iywh4cgar3h4js9brr4a-qtbase-5.15.2/lib/libQt5Core.so.5
#21 0x00007ffff185ba9b in g_main_context_dispatch () from /nix/store/f6csxwcz4906d55rp4prlv1ll0fhx06k-glib-2.70.0/lib/libglib-2.0.so.0
#22 0x00007ffff185bd48 in g_main_context_iterate.constprop ()
   from /nix/store/f6csxwcz4906d55rp4prlv1ll0fhx06k-glib-2.70.0/lib/libglib-2.0.so.0
#23 0x00007ffff185bdff in g_main_context_iteration () from /nix/store/f6csxwcz4906d55rp4prlv1ll0fhx06k-glib-2.70.0/lib/libglib-2.0.so.0
#24 0x00007ffff4fa04e0 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /nix/store/dj66jij1jaa2iywh4cgar3h4js9brr4a-qtbase-5.15.2/lib/libQt5Core.so.5
#25 0x00007ffff4f46d3b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /nix/store/dj66jij1jaa2iywh4cgar3h4js9brr4a-qtbase-5.15.2/lib/libQt5Core.so.5
#26 0x00007ffff4f4f320 in QCoreApplication::exec() () from /nix/store/dj66jij1jaa2iywh4cgar3h4js9brr4a-qtbase-5.15.2/lib/libQt5Core.so.5
#27 0x000000000043e57e in main (argc=<optimized out>, argv=0x7fffffff40d0) at /home/alex/code/latte-dock/app/main.cpp:327
Comment 11 Michail Vourlakos 2021-11-09 10:23:25 UTC
(In reply to Alex Dewar from comment #10)
> Sorry, you're totally right. The backtrace was completely different this
> time:
> 

No it isnt. It is the same crash and based on the last backtrace you have not installed properly v0.10.3 . The backtrace you sent points to v0.10.0 . You need at least v0.10.2 as mentioned earlier.

e.g. /nix/store/p8paf5aim9py2sv7ix76rrf0fp1laiif-latte-dock-0.10.0/lib
Comment 12 Bug Janitor Service 2021-11-24 04:39:19 UTC
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!
Comment 13 Bug Janitor Service 2021-12-09 04:35:24 UTC
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!