Bug 465801

Summary: Near-constant crashes in ext_idle_notifier_v1_destroy on Wayland
Product: [Frameworks and Libraries] frameworks-baloo Reporter: Nate Graham <nate>
Component: Baloo File DaemonAssignee: baloo-bugs-null
Status: RESOLVED FIXED    
Severity: crash CC: asturm, bednarczyk.pawel, cd+kde, ha51wl8j, matej, tagwerk19, thecornishman
Priority: NOR Keywords: wayland
Version: 5.103.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.104

Description Nate Graham 2023-02-16 00:22:46 UTC
Everything KDE built from git master, with the exception of frameworks which are built from the kf5 branch), on top of Fedora KDE 37.

I just noticed this today because drkonqi hasn't been presenting it to me, but for months, baloo_file_extractor is crashing a dozen or more times per day for me with this backtrace:

#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=11, 
    no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007f0f150afec3 in __pthread_kill_internal (signo=11, threadid=<optimized out>)
    at pthread_kill.c:78
#2  0x00007f0f1505fa76 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
#3  0x00007f0f16520971 in KCrash::defaultCrashHandler (sig=11)
    at /home/nate/kde/src/kcrash/src/kcrash.cpp:626
#4  <signal handler called>
#5  0x00007f0f164a1a95 in wl_map_insert_at (map=map@entry=0x19be450, flags=flags@entry=1, i=23, 
    data=<optimized out>) at ../src/wayland-util.c:276
#6  0x00007f0f164a1bf3 in proxy_destroy (proxy=proxy@entry=0x19f6e70) at ../src/wayland-client.c:510
#7  0x00007f0f164a3750 in wl_proxy_destroy_caller_locks (proxy=0x19f6e70)
    at ../src/wayland-client.c:530
#8  wl_proxy_marshal_array_flags (proxy=proxy@entry=0x19f6e70, opcode=opcode@entry=0, 
    interface=interface@entry=0x0, version=version@entry=1, flags=flags@entry=1, 
    args=args@entry=0x7ffd6f758a80) at ../src/wayland-client.c:868
#9  0x00007f0f164a4219 in wl_proxy_marshal_flags (proxy=0x19f6e70, opcode=0, interface=0x0, 
    version=1, flags=1) at ../src/wayland-client.c:791
#10 0x00007f0f141a695b in ext_idle_notifier_v1_destroy (ext_idle_notifier_v1=0x19f6e70)
    at /home/nate/kde/build/kidletime/src/plugins/wayland/wayland-ext-idle-notify-v1-client-protocol.h:158
#11 QtWayland::ext_idle_notification_v1::destroy (this=this@entry=0x19cf250)
    at /home/nate/kde/build/kidletime/src/plugins/wayland/qwayland-ext-idle-notify-v1.cpp:134
#12 0x00007f0f141a5fa7 in IdleTimeoutExt::~IdleTimeoutExt (this=0x19cf240, __in_chrg=<optimized out>)
    at /home/nate/kde/src/kidletime/src/plugins/wayland/poller.cpp:77
#13 IdleTimeoutExt::~IdleTimeoutExt (this=0x19cf240, __in_chrg=<optimized out>)
    at /home/nate/kde/src/kidletime/src/plugins/wayland/poller.cpp:78
#14 0x00007f0f141a61f7 in QtSharedPointer::ExternalRefCountData::destroy (this=0x19f6fb0)
    at /usr/include/qt5/QtCore/qsharedpointer_impl.h:149
#15 QSharedPointer<IdleTimeout>::deref (dd=0x19f6fb0)
    at /usr/include/qt5/QtCore/qsharedpointer_impl.h:458
#16 QSharedPointer<IdleTimeout>::deref (dd=0x19f6fb0)
    at /usr/include/qt5/QtCore/qsharedpointer_impl.h:454
#17 QSharedPointer<IdleTimeout>::deref (this=<optimized out>)
    at /usr/include/qt5/QtCore/qsharedpointer_impl.h:453
#18 QSharedPointer<IdleTimeout>::~QSharedPointer (this=<optimized out>, __in_chrg=<optimized out>)
    at /usr/include/qt5/QtCore/qsharedpointer_impl.h:310
#19 QHashNode<int, QSharedPointer<IdleTimeout> >::~QHashNode (this=<optimized out>, 
    __in_chrg=<optimized out>) at /usr/include/qt5/QtCore/qhash.h:147
#20 QHash<int, QSharedPointer<IdleTimeout> >::deleteNode2 (node=<optimized out>)
    at /usr/include/qt5/QtCore/qhash.h:595
#21 0x00007f0f1572387c in QHashData::free_helper (this=0x19f6e10, 
    node_delete=0x7f0f141a61e0 <QHash<int, QSharedPointer<IdleTimeout> >::deleteNode2(QHashData::Node*)>) at tools/qhash.cpp:572
#22 0x00007f0f141a4d10 in QHash<int, QSharedPointer<IdleTimeout> >::freeData (x=<optimized out>, 
    this=0x19fb790) at /usr/include/qt5/QtCore/qhash.h:617
#23 QHash<int, QSharedPointer<IdleTimeout> >::~QHash (this=0x19fb790, __in_chrg=<optimized out>)
    at /usr/include/qt5/QtCore/qhash.h:250
#24 QHash<int, QSharedPointer<IdleTimeout> >::~QHash (this=0x19fb790, __in_chrg=<optimized out>)
    at /usr/include/qt5/QtCore/qhash.h:250
#25 Poller::~Poller (this=0x19fb770, __in_chrg=<optimized out>)
    at /home/nate/kde/src/kidletime/src/plugins/wayland/poller.cpp:136
--Type <RET> for more, q to quit, c to continue without paging--
#26 0x00007f0f141a4d39 in Poller::~Poller (this=0x19fb770, __in_chrg=<optimized out>)
    at /home/nate/kde/src/kidletime/src/plugins/wayland/poller.cpp:136
#27 0x00007f0f15894710 in QLibraryPrivate::unload (this=0x19d6600, flag=QLibraryPrivate::NoUnloadSys)
    at plugin/qlibrary.cpp:611
#28 0x00007f0f15897023 in QLibraryStore::cleanup () at plugin/qlibrary.cpp:416
#29 0x00007f0f15895d5d in qlibraryCleanup () at plugin/qlibrary.cpp:445
#30 (anonymous namespace)::qlibraryCleanup_dtor_class_::~qlibraryCleanup_dtor_class_ (
    this=<optimized out>, __in_chrg=<optimized out>) at plugin/qlibrary.cpp:447
#31 0x00007f0f15061b97 in __cxa_finalize (d=0x7f0f15b54060) at cxa_finalize.c:83
#32 0x00007f0f156ce637 in __do_global_dtors_aux () from /lib64/libQt5Core.so.5
#33 0x00007ffd6f7590e0 in ?? ()
#34 0x00007f0f166cfa9e in _dl_fini () at dl-fini.c:142
Backtrace stopped: frame did not save the PC


I can reproduce it at will by restarting the baloo systemd service with `systemctl status --user kde-baloo.service`
Comment 1 Nate Graham 2023-02-16 00:24:31 UTC
Looks like this started happening on 28 November 2022.
Comment 2 Bug Janitor Service 2023-02-16 11:25:29 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kidletime/-/merge_requests/37
Comment 3 David Redondo 2023-02-20 09:24:45 UTC
Git commit 53779a8d8fb177762d0435634c8ca45b0a47f1db by David Redondo.
Committed on 16/02/2023 at 11:16.
Pushed by davidre into branch 'master'.

wayland: Guard wayland object destructors

Kidletime is a singleton and the client API works by supplying ints to add
or remove timeouts. When not all timeouts are removed before program exits,
trying to destroy the wayland objects will crash since the lifetime of the
wayland connection is tied to the QGuiApplication.
FIXED-IN:5.104

M  +7    -3    src/plugins/wayland/poller.cpp

https://invent.kde.org/frameworks/kidletime/commit/53779a8d8fb177762d0435634c8ca45b0a47f1db
Comment 4 David Redondo 2023-02-20 10:38:31 UTC
Git commit a0da010b8c4c97792543d24f6597ba1c1b3ceaef by David Redondo.
Committed on 20/02/2023 at 09:38.
Pushed by davidre into branch 'kf5'.

wayland: Guard wayland object destructors

Kidletime is a singleton and the client API works by supplying ints to add
or remove timeouts. When not all timeouts are removed before program exits,
trying to destroy the wayland objects will crash since the lifetime of the
wayland connection is tied to the QGuiApplication.
FIXED-IN:5.104


(cherry picked from commit 53779a8d8fb177762d0435634c8ca45b0a47f1db)

M  +7    -3    src/plugins/wayland/poller.cpp

https://invent.kde.org/frameworks/kidletime/commit/a0da010b8c4c97792543d24f6597ba1c1b3ceaef
Comment 5 Andreas Sturmlechner 2023-02-21 09:21:26 UTC
Also reported for 5.102 in Gentoo. Worth mail to distributions list?
Comment 6 Andreas Sturmlechner 2023-02-23 19:49:53 UTC
*** Bug 466266 has been marked as a duplicate of this bug. ***
Comment 7 Andreas Sturmlechner 2023-02-23 19:50:11 UTC
*** Bug 466161 has been marked as a duplicate of this bug. ***
Comment 8 Nicolas Fella 2023-02-26 21:18:38 UTC
*** Bug 466488 has been marked as a duplicate of this bug. ***
Comment 9 Nate Graham 2023-02-28 20:17:06 UTC
*** Bug 466394 has been marked as a duplicate of this bug. ***
Comment 10 Nate Graham 2023-03-13 18:48:01 UTC
*** Bug 467101 has been marked as a duplicate of this bug. ***
Comment 11 tagwerk19 2023-03-13 23:47:48 UTC
(In reply to Bug Janitor Service from comment #2)
> A possibly relevant merge request was started @
> https://invent.kde.org/frameworks/kidletime/-/merge_requests/37
I see Frameworks 5.104 on Arch now and no longer getting crashes.

Thank you!