Bug 507656

Summary: Filelight crash when using smb or sftp
Product: [Applications] filelight Reporter: Hirad <redstar>
Component: generalAssignee: Unassigned bugs <unassigned-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: martin.sandsmark, sitter
Priority: NOR Keywords: drkonqi
Version First Reported In: 25.04.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report: https://crash-reports.kde.org/organizations/kde/issues/226207/events/ebe81859cb27498a9a0474937170e16a/
Attachments: New crash information added by DrKonqi

Description Hirad 2025-07-30 05:43:13 UTC
Application: filelight (25.04.3)

ApplicationNotResponding [ANR]: false
Qt Version: 6.9.1
Frameworks Version: 6.16.0
Operating System: Linux 6.15.8-arch1-1 x86_64
Windowing System: Wayland
Distribution: "Arch Linux"
DrKonqi: 6.4.3 [CoredumpBackend]

-- Information about the crash:
When I open the filelight in a smb or sftp share it shows the size of directories just fine. But as soon as I click on one of those folders inside filelight, filelight crashes. I tried multiple different shares and directories and it happens in all of them.

The crash can be reproduced every time.

-- Backtrace (Reduced):
#5  0x00007f6d5f194078 in KJob::emitResult (this=0x55c226ba27c0) at /usr/src/debug/kcoreaddons/kcoreaddons-6.16.0/src/lib/jobs/kjob.cpp:356
#6  0x00007f6d5dbc0e34 in QObject::event (this=<optimized out>, e=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:1431
#7  0x00007f6d5f301c70 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x55c226ba27c0, e=0x55c226013900) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:3303
#8  0x00007f6d5db68118 in QCoreApplication::notifyInternal2 (receiver=0x55c226ba27c0, event=event@entry=0x55c226013900) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1106
#9  0x00007f6d5db684fb in QCoreApplication::sendEvent (receiver=<optimized out>, event=0x55c226013900) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1546
#10 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x55c2250e3890) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1879
#11 0x00007f6d5de3fcf8 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1733
#12 postEventSourceDispatch (s=0x55c2250e6490) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:246
#13 0x00007f6d5ca6887d in g_main_dispatch (context=0x7f6d50000f00) at ../glib/glib/gmain.c:3398
#14 0x00007f6d5ca69cd7 in g_main_context_dispatch_unlocked (context=0x7f6d50000f00) at ../glib/glib/gmain.c:4249
#15 g_main_context_iterate_unlocked (context=context@entry=0x7f6d50000f00, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4314
#16 0x00007f6d5ca69ee5 in g_main_context_iteration (context=0x7f6d50000f00, may_block=1) at ../glib/glib/gmain.c:4379
#17 0x00007f6d5de3c5e2 in QEventDispatcherGlib::processEvents (this=0x55c2250e6bb0, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399
#18 0x00007f6d5db744b6 in QEventLoop::processEvents (this=0x7ffe70a525c0, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:104
#19 QEventLoop::exec (this=0x7ffe70a525c0, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:186
#20 0x00007f6d5db6c7c1 in QCoreApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1449


Reported using DrKonqi
Comment 1 Hirad 2025-07-30 05:43:17 UTC
Created attachment 183650 [details]
New crash information added by DrKonqi

DrKonqi auto-attaching complete backtrace.
Comment 2 Harald Sitter 2025-07-30 07:16:32 UTC
Cannot reproduce with git builds. What does the specific URL look like? There was some crashing with redirection urls recently.
Comment 3 Hirad 2025-07-30 07:27:53 UTC
(In reply to Harald Sitter from comment #2)
> Cannot reproduce with git builds. What does the specific URL look like?
> There was some crashing with redirection urls recently.

For example if I open filelight from dolphin "Disk usage statistics - current folder" on smb://192.168.0.2/Music/, it shows me all the folders and their sizes just fine. But as soon as I click on any of those folders, let's say Abbath or Behemoth or anything, it crash. 
I've tried to open filelight on different directories, on same 192.168.0.2 or sftp on a server. they all behave the same way.
Comment 4 Harald Sitter 2025-07-30 07:46:40 UTC
I can reproduce it with frameworks 6.16 but not git, so I guess it's already fixed for 6.17 \o/ Should be out in a week or two.
Comment 5 Harald Sitter 2025-07-30 07:53:07 UTC
Actually I lied. I can now also reproduce it on a git build.
Comment 6 Harald Sitter 2025-08-01 10:51:58 UTC
Git commit 15c8385da937047b516fd51eb07bec8d9d76ad9e by Harald Sitter.
Committed on 01/08/2025 at 10:51.
Pushed by sitter into branch 'master'.

memory: prefer shared_ptr for qobject + deleteLater on them

introduce a new make_shared_qobject helper that creates a shared_ptr
with deleteLater semantics. this notably improves safety when used as
class members (that may be used in slot invocations) to prevent
use-after-free scenarios.

unique_ptr has the disadvantage that its deleter signature matters to
the type. it results in very noisy code and complicates assignment of
nullptr_ts. shared_ptr meanwhile does not care. as such it seems
preferrable.

this fixes a crash where we deleted the RemoteLister through resetting
it to nullptr in the updateRunning lambda. this would then delete the
kdirlister and its internals, leaving the signal call chain in an
inconsistent state and crashing when returning the call chain to
KCoreDirListerPrivate::CachedItemsJob::done (which was then working with
an already deleted this)

A  +22   -0    src/memory.h     [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)]
M  +2    -1    src/radialMap/map.cpp
M  +1    -1    src/radialMap/map.h
M  +4    -3    src/scan.cpp
M  +3    -3    src/scan.h

https://invent.kde.org/utilities/filelight/-/commit/15c8385da937047b516fd51eb07bec8d9d76ad9e
Comment 7 Harald Sitter 2025-08-02 18:21:07 UTC
Git commit 61e4afbb76c491240a9bc1042dc337d5d8c490bf by Harald Sitter.
Committed on 01/08/2025 at 10:52.
Pushed by sitter into branch 'release/25.08'.

memory: prefer shared_ptr for qobject + deleteLater on them

introduce a new make_shared_qobject helper that creates a shared_ptr
with deleteLater semantics. this notably improves safety when used as
class members (that may be used in slot invocations) to prevent
use-after-free scenarios.

unique_ptr has the disadvantage that its deleter signature matters to
the type. it results in very noisy code and complicates assignment of
nullptr_ts. shared_ptr meanwhile does not care. as such it seems
preferrable.

this fixes a crash where we deleted the RemoteLister through resetting
it to nullptr in the updateRunning lambda. this would then delete the
kdirlister and its internals, leaving the signal call chain in an
inconsistent state and crashing when returning the call chain to
KCoreDirListerPrivate::CachedItemsJob::done (which was then working with
an already deleted this)


(cherry picked from commit 15c8385da937047b516fd51eb07bec8d9d76ad9e)

Co-authored-by: Harald Sitter <sitter@kde.org>

A  +22   -0    src/memory.h     [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)]
M  +2    -1    src/radialMap/map.cpp
M  +1    -1    src/radialMap/map.h
M  +4    -3    src/scan.cpp
M  +3    -3    src/scan.h

https://invent.kde.org/utilities/filelight/-/commit/61e4afbb76c491240a9bc1042dc337d5d8c490bf