Bug 425070 - Krusader crashes when right-clicking on a file which being externally updated
Summary: Krusader crashes when right-clicking on a file which being externally updated
Status: CONFIRMED
Alias: None
Product: krusader
Classification: Applications
Component: general (other bugs)
Version First Reported In: Git
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Krusader Bugs Distribution List
URL:
Keywords: drkonqi, triaged
: 429655 (view as bug list)
Depends on:
Blocks: 409834
  Show dependency treegraph
 
Reported: 2020-08-06 11:18 UTC by DaBler
Modified: 2025-09-11 07:30 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
New crash information added by DrKonqi (7.76 KB, text/plain)
2020-09-07 05:55 UTC, DaBler
Details
New crash information added by DrKonqi (5.98 KB, text/plain)
2021-02-21 12:54 UTC, DaBler
Details
New crash information added by DrKonqi (5.18 KB, text/plain)
2021-02-23 07:25 UTC, DaBler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description DaBler 2020-08-06 11:18:33 UTC
Application: krusader (2.7.2 "Peace of Mind")
 (Compiled from sources)
Qt Version: 5.14.2
Frameworks Version: 5.70.0
Operating System: Linux 5.4.48-gentoo-8 x86_64
Windowing system: X11
Distribution: Gentoo/Linux

-- Information about the crash:
- What I was doing when the application crashed:

Right-clicked on "Nepotvrzeno 939731.crdownload" file. Then the Krusader crashed.

The crash can be reproduced every time.

-- Backtrace:
Application: Krusader (krusader), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fea710217c0 (LWP 6956))]

Thread 3 (Thread 0x7fea67fff700 (LWP 6958)):
#0  __GI___libc_read (nbytes=16, buf=0x7fea67ffeba0, fd=19) at ../sysdeps/unix/sysv/linux/read.c:26
#1  __GI___libc_read (fd=19, buf=buf@entry=0x7fea67ffeba0, nbytes=nbytes@entry=16) at ../sysdeps/unix/sysv/linux/read.c:24
#2  0x00007fea731f621f in read (__nbytes=16, __buf=0x7fea67ffeba0, __fd=<optimized out>) at /usr/include/bits/unistd.h:44
#3  g_wakeup_acknowledge (wakeup=0x562fef3662b0) at ../glib-2.62.6/glib/gwakeup.c:210
#4  0x00007fea731ac40e in g_main_context_check (context=context@entry=0x7fea60000c20, max_priority=2147483647, fds=fds@entry=0x7fea6001c000, n_fds=n_fds@entry=1) at ../glib-2.62.6/glib/gmain.c:3732
#5  0x00007fea731ac893 in g_main_context_iterate (context=context@entry=0x7fea60000c20, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib-2.62.6/glib/gmain.c:3951
#6  0x00007fea731aca0f in g_main_context_iteration (context=0x7fea60000c20, may_block=may_block@entry=1) at ../glib-2.62.6/glib/gmain.c:4015
#7  0x00007fea748b7d2b in QEventDispatcherGlib::processEvents (this=0x7fea60000b60, flags=...) at /var/tmp/portage/dev-qt/qtcore-5.14.2/work/qtbase-everywhere-src-5.14.2/src/corelib/kernel/qeventdispatcher_glib.cpp:425
#8  0x00007fea748604fb in QEventLoop::exec (this=this@entry=0x7fea67ffedb0, flags=..., flags@entry=...) at /var/tmp/portage/dev-qt/qtcore-5.14.2/work/qtbase-everywhere-src-5.14.2/include/QtCore/../../src/corelib/global/qflags.h:136
#9  0x00007fea746aaf5e in QThread::exec (this=this@entry=0x7fea759bcda0 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at /var/tmp/portage/dev-qt/qtcore-5.14.2/work/qtbase-everywhere-src-5.14.2/include/QtCore/../../src/corelib/global/qflags.h:118
#10 0x00007fea75937557 in QDBusConnectionManager::run (this=0x7fea759bcda0 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at /var/tmp/portage/dev-qt/qtdbus-5.14.2/work/qtbase-everywhere-src-5.14.2/src/dbus/qdbusconnection.cpp:179
#11 0x00007fea746abfaf in QThreadPrivate::start (arg=0x7fea759bcda0 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at /var/tmp/portage/dev-qt/qtcore-5.14.2/work/qtbase-everywhere-src-5.14.2/src/corelib/thread/qthread_unix.cpp:342
#12 0x00007fea73c0e027 in start_thread (arg=<optimized out>) at pthread_create.c:479
#13 0x00007fea74168c4f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7fea70649700 (LWP 6957)):
#0  0x00007fea7415e15f in __GI___poll (fds=fds@entry=0x7fea70648ce8, nfds=nfds@entry=1, timeout=timeout@entry=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fea73b38d72 in poll (__timeout=-1, __nfds=1, __fds=0x7fea70648ce8) at /usr/include/bits/poll2.h:46
#2  _xcb_conn_wait (c=c@entry=0x562feee3efb0, cond=cond@entry=0x562feee3eff0, vector=vector@entry=0x0, count=count@entry=0x0) at /var/tmp/portage/x11-libs/libxcb-1.14/work/libxcb-1.14/src/xcb_conn.c:480
#3  0x00007fea73b3aa9a in xcb_wait_for_event (c=c@entry=0x562feee3efb0) at /var/tmp/portage/x11-libs/libxcb-1.14/work/libxcb-1.14/src/xcb_in.c:697
#4  0x00007fea7081f428 in QXcbEventQueue::run (this=0x562feee35340) at /var/tmp/portage/dev-qt/qtgui-5.14.2/work/qtbase-everywhere-src-5.14.2/src/plugins/platforms/xcb/qxcbeventqueue.cpp:228
#5  0x00007fea746abfaf in QThreadPrivate::start (arg=0x562feee35340) at /var/tmp/portage/dev-qt/qtcore-5.14.2/work/qtbase-everywhere-src-5.14.2/src/corelib/thread/qthread_unix.cpp:342
#6  0x00007fea73c0e027 in start_thread (arg=<optimized out>) at pthread_create.c:479
#7  0x00007fea74168c4f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7fea710217c0 (LWP 6956)):
[KCrash Handler]
#6  KrView::setSelected (this=0x18, fileitem=0x562fefe18f00, select=true) at /var/tmp/portage/kde-misc/krusader-2.7.2/work/krusader-2.7.2/krusader/Panel/PanelView/krview.cpp:1186
#7  0x0000562fecef3575 in KrViewItem::setSelected (this=0x562fef7a4c50, s=s@entry=true) at /var/tmp/portage/kde-misc/krusader-2.7.2/work/krusader-2.7.2/krusader/Panel/PanelView/krviewitem.cpp:132
#8  0x0000562fecee9567 in KrMouseHandler::showContextMenu (this=0x562fef5b13b0) at /var/tmp/portage/kde-misc/krusader-2.7.2/work/krusader-2.7.2/krusader/Panel/PanelView/krmousehandler.cpp:319
#9  0x00007fea74895aa0 in doActivate<false> (sender=0x562fef5b13e8, signal_index=3, argv=0x7fff8efe7680) at /var/tmp/portage/dev-qt/qtcore-5.14.2/work/qtbase-everywhere-src-5.14.2/include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:395
#10 0x00007fea74890227 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7fea74b31d20 <QTimer::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fff8efe7680) at /var/tmp/portage/dev-qt/qtcore-5.14.2/work/qtbase-everywhere-src-5.14.2/src/corelib/kernel/qobject.cpp:3930
#11 0x00007fea748992aa in QTimer::timeout (this=<optimized out>, _t1=...) at .moc/moc_qtimer.cpp:205
#12 0x00007fea7488ddf5 in QObject::event (this=0x562fef5b13e8, e=0x7fff8efe79a0) at /var/tmp/portage/dev-qt/qtcore-5.14.2/work/qtbase-everywhere-src-5.14.2/src/corelib/kernel/qobject.cpp:1361
#13 0x00007fea752740b3 in QApplicationPrivate::notify_helper (this=this@entry=0x562feee1f000, receiver=receiver@entry=0x562fef5b13e8, e=e@entry=0x7fff8efe79a0) at /var/tmp/portage/dev-qt/qtwidgets-5.14.2/work/qtbase-everywhere-src-5.14.2/src/widgets/kernel/qapplication.cpp:3685
#14 0x00007fea7527d5c0 in QApplication::notify (this=0x7fff8efe7cf0, receiver=0x562fef5b13e8, e=0x7fff8efe79a0) at /var/tmp/portage/dev-qt/qtwidgets-5.14.2/work/qtbase-everywhere-src-5.14.2/src/widgets/kernel/qapplication.cpp:3431
#15 0x00007fea748616ae in QCoreApplication::notifyInternal2 (receiver=0x562fef5b13e8, event=0x7fff8efe79a0) at /var/tmp/portage/dev-qt/qtcore-5.14.2/work/qtbase-everywhere-src-5.14.2/src/corelib/kernel/qcoreapplication.cpp:1075
#16 0x00007fea748b6feb in QTimerInfoList::activateTimers (this=0x562feee92e50) at /var/tmp/portage/dev-qt/qtcore-5.14.2/work/qtbase-everywhere-src-5.14.2/src/corelib/kernel/qtimerinfo_unix.cpp:643
#17 0x00007fea748b78d1 in timerSourceDispatch (source=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.14.2/work/qtbase-everywhere-src-5.14.2/src/corelib/kernel/qeventdispatcher_glib.cpp:183
#18 idleTimerSourceDispatch (source=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.14.2/work/qtbase-everywhere-src-5.14.2/src/corelib/kernel/qeventdispatcher_glib.cpp:230
#19 0x00007fea731ac6dc in g_main_dispatch (context=0x7fea68005000) at ../glib-2.62.6/glib/gmain.c:3216
#20 g_main_context_dispatch (context=context@entry=0x7fea68005000) at ../glib-2.62.6/glib/gmain.c:3881
#21 0x00007fea731ac978 in g_main_context_iterate (context=context@entry=0x7fea68005000, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib-2.62.6/glib/gmain.c:3954
#22 0x00007fea731aca0f in g_main_context_iteration (context=0x7fea68005000, may_block=may_block@entry=1) at ../glib-2.62.6/glib/gmain.c:4015
#23 0x00007fea748b7d10 in QEventDispatcherGlib::processEvents (this=0x562feee92ea0, flags=...) at /var/tmp/portage/dev-qt/qtcore-5.14.2/work/qtbase-everywhere-src-5.14.2/src/corelib/kernel/qeventdispatcher_glib.cpp:423
#24 0x00007fea748604fb in QEventLoop::exec (this=this@entry=0x7fff8efe7be0, flags=..., flags@entry=...) at /var/tmp/portage/dev-qt/qtcore-5.14.2/work/qtbase-everywhere-src-5.14.2/include/QtCore/../../src/corelib/global/qflags.h:136
#25 0x00007fea7486860f in QCoreApplication::exec () at /var/tmp/portage/dev-qt/qtcore-5.14.2/work/qtbase-everywhere-src-5.14.2/include/QtCore/../../src/corelib/global/qflags.h:118
#26 0x0000562fece71552 in main (argc=<optimized out>, argv=<optimized out>) at /var/tmp/portage/kde-misc/krusader-2.7.2/work/krusader-2.7.2/krusader/main.cpp:316
[Inferior 1 (process 6956) detached]

Reported using DrKonqi
Comment 1 Davide Gianforte 2020-08-10 09:38:05 UTC
The problem is about setting the file as the selected one in the panel.

Can you share your .krusaderrc config file or at least your selection settings? (Konfigurator -> Panel -> Selection Mode).

The file seems to be a Chrome partial download. Does it still exists in the directory? Can you try the same action in Dolphin?

Thank you
Comment 2 DaBler 2020-08-12 11:20:28 UTC
That excerpt from krusaderrc:

[Custom Selection Mode]
Immediate Context Menu=false
Left Selects=false
Right Preserves=true
ShiftCtrl Left Selects=true
Space Moves Down=false

(I can share the whole file if needed)
Comment 3 DaBler 2020-08-12 11:23:06 UTC
The Dolphin is fine (will not crash on right-click).
Comment 4 Davide Gianforte 2020-08-14 09:27:46 UTC
Thank you for the info; unfortunately, I cannot replicate the bug nor install Chrome to test a download - for now (I think you can right-click on other files without issues).
Comment 5 DaBler 2020-08-14 09:33:46 UTC
You can simulate the Chrome download with:

dd bs=1 if=/dev/urandom of=tmp

and then right-click on the tmp file.
Comment 6 Toni Asensi Esteve 2020-09-06 22:59:17 UTC
I could not also reproduce the problem :-( , right-clicking on those files had the normal behavior.

When the crash happened, did you have the file preview enabled?
Comment 7 DaBler 2020-09-07 05:55:30 UTC
Created attachment 131459 [details]
New crash information added by DrKonqi

krusader (2.7.2 "Peace of Mind") using Qt 5.14.2

The file previews are disabled. Just follow these steps to reproduce the crash:

$ export LANG=C
$ dd bs=1 if=/dev/urandom of=tmp &                  
$ krusader --left .

right-click on the "tmp" file

-- Backtrace (Reduced):
#6  KrView::setSelected (this=0x18, fileitem=0x33, select=true) at /var/tmp/portage/kde-misc/krusader-2.7.2/work/krusader-2.7.2/krusader/Panel/PanelView/krview.cpp:1186
#7  0x0000560a8b6e8575 in KrViewItem::setSelected (this=0x560a8e8cabd0, s=s@entry=true) at /var/tmp/portage/kde-misc/krusader-2.7.2/work/krusader-2.7.2/krusader/Panel/PanelView/krviewitem.cpp:132
#8  0x0000560a8b6de567 in KrMouseHandler::showContextMenu (this=0x560a8d813830) at /var/tmp/portage/kde-misc/krusader-2.7.2/work/krusader-2.7.2/krusader/Panel/PanelView/krmousehandler.cpp:319
#9  0x00007fce3f720aa0 in doActivate<false> (sender=0x560a8d813868, signal_index=3, argv=0x7ffd2dd3dcd0) at /var/tmp/portage/dev-qt/qtcore-5.14.2/work/qtbase-everywhere-src-5.14.2/include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:395
[...]
#11 0x00007fce3f7242aa in QTimer::timeout (this=<optimized out>, _t1=...) at .moc/moc_qtimer.cpp:205
Comment 8 Bug Janitor Service 2020-09-22 04:33:11 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 9 Bug Janitor Service 2020-10-07 04:33:14 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!
Comment 10 DaBler 2021-02-21 12:54:25 UTC
Created attachment 136013 [details]
New crash information added by DrKonqi

krusader (2.7.2 "Peace of Mind") using Qt 5.15.2

I still face this problem in Krusader version 2.7.2 (KDE 20.08.3). It occurs, for example, when clicking on *.crdownload.

-- Backtrace (Reduced):
#6  0x000055dc0b849057 in std::__atomic_base<int>::load (__m=std::memory_order_relaxed, this=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/include/g++-v9/bits/atomic_base.h:419
#7  QAtomicOps<int>::load<int> (_q_value=...) at /usr/include/qt5/QtCore/qatomic_cxx11.h:227
#8  QBasicAtomicInteger<int>::load (this=<optimized out>) at /usr/include/qt5/QtCore/qbasicatomic.h:103
[...]
#10 QList<QUrl>::~QList (this=0x7ffc555e5910, __in_chrg=<optimized out>) at /usr/include/qt5/QtCore/qlist.h:845
#11 0x000055dc0b8490e5 in QList<QUrl>::operator= (other=..., this=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/include/g++-v9/bits/move.h:182
Comment 11 Toni Asensi Esteve 2021-02-22 22:23:00 UTC
I've tried it, though I found no problem using the git version of Krusader under Kubuntu 20.04 nor 20.10. Can you follow the steps of
    https://commits.kde.org/krusader?path=INSTALL
in order to build the git version of Krusader and tell us if your problem is solved?
Comment 12 DaBler 2021-02-23 07:25:20 UTC
Created attachment 136074 [details]
New crash information added by DrKonqi

krusader (2.8.0-dev "Bleeding Edge") using Qt 5.15.2

Crashes even with git version of the Krusader (version 2.8.0-dev "Bleeding Edge", cloned on 08:17:36 23/2/2021) with exactly the same stacktrace.

-- Backtrace (Reduced):
#6  KrView::setSelected (this=0x18, fileitem=0x56501c982e00, select=true) at /var/tmp/portage/kde-misc/krusader-9999/work/krusader-9999/krusader/Panel/PanelView/krview.cpp:1189
#7  0x000056501a475235 in KrViewItem::setSelected (this=0x56501cabc520, s=s@entry=true) at /var/tmp/portage/kde-misc/krusader-9999/work/krusader-9999/krusader/Panel/PanelView/krviewitem.cpp:120
#8  0x000056501a46ace7 in KrMouseHandler::showContextMenu (this=0x56501c25b850) at /var/tmp/portage/kde-misc/krusader-9999/work/krusader-9999/krusader/Panel/PanelView/krmousehandler.cpp:334
#9  0x00007f6512f20ee5 in QtPrivate::QSlotObjectBase::call (a=0x7ffc17194800, r=0x56501c25b850, this=0x56501c25ae90) at /var/tmp/portage/dev-qt/qtcore-5.15.2-r2/work/qtbase-everywhere-src-5.15.2/include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#10 doActivate<false> (sender=0x56501c25b888, signal_index=3, argv=0x7ffc17194800) at /var/tmp/portage/dev-qt/qtcore-5.15.2-r2/work/qtbase-everywhere-src-5.15.2/src/corelib/kernel/qobject.cpp:3886
Comment 13 Davide Gianforte 2021-02-23 07:32:08 UTC
It could be related to bug 425528: the panel refreshes its contents and when the right click popup renders, it has no more a valid fileitem.
Comment 14 Nikita Melnichenko 2021-02-23 08:36:03 UTC
(In reply to DaBler from comment #7)
> $ export LANG=C
> $ dd bs=1 if=/dev/urandom of=tmp &                  
> $ krusader --left .
> 
> right-click on the "tmp" file
I can repro this bug with the above steps by doing a long right click (for the context menu). Thanks DaBler!

(In reply to Davide Gianforte from comment #13)
> It could be related to bug 425528: the panel refreshes its contents and when
> the right click popup renders, it has no more a valid fileitem.
Exactly! We've bumped into this multiple times and I have to admit we should take on redesigning that legacy piece of code. This change won't be small and it touches the core of Krusader logic, but it's worth doing. Hopefully, I could find some time to look into it in the next few months.

Reference discussion:
https://invent.kde.org/utilities/krusader/-/merge_requests/33
https://phabricator.kde.org/D22431
(there was also a discussion with a deeper investigation I did long time ago, and I couldn't find it now...)
Comment 15 Nikita Melnichenko 2021-12-23 19:22:19 UTC
*** Bug 429655 has been marked as a duplicate of this bug. ***
Comment 16 Nikita Melnichenko 2021-12-23 19:57:07 UTC
Consolidated multiple bugs here as the root cause is the same: when we get inotify for dir update, due to a legacy piece of code mentioned in comment #14, krusader kills all old KrViewItem instances, including the one user works with (right click or rename). It also affects scrolling, as underlying view loses position when list is re-created.

To solve we need to carefully merge old list and new list, keeping all the objects for the files that remained in the dir. In addition, when an item pointer is used, we need a way to say if the item is still valid as it actually could have been deleted in case the file is vanished from the dir. Likely, the shared pointer pattern and isValid member is sufficient.
Comment 17 DaBler 2025-09-11 07:30:07 UTC
still an issue