Bug 500241 - Crash when opening duplicated file entry in projects tool
Summary: Crash when opening duplicated file entry in projects tool
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: 24.12.2
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: drkonqi
: 501288 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-02-17 10:07 UTC by Björn Bengtsson
Modified: 2025-03-13 09:16 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report: https://crash-reports.kde.org/organizations/kde/issues/134550/events/97778aa95920414f80225400f479d244/


Attachments
New crash information added by DrKonqi (85.23 KB, text/plain)
2025-02-17 10:07 UTC, Björn Bengtsson
Details
Another crash report (83.88 KB, text/vnd.kde.kcrash-report)
2025-02-17 10:08 UTC, Björn Bengtsson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Bengtsson 2025-02-17 10:07:12 UTC
Application: kate (24.12.2)

ApplicationNotResponding [ANR]: false
Qt Version: 6.8.2
Frameworks Version: 6.10.0
Operating System: Linux 6.12.11-200.fc41.x86_64 x86_64
Windowing System: Wayland
Distribution: "Fedora Linux 41 (Forty One)"
DrKonqi: 6.3.0 [CoredumpBackend]

-- Information about the crash:
I'm running a pretty standard installation of Fedora 41 with KDE Plasma.
I have a saved session open in Kate and the projects tool is showing a local folder.
This is how the crash is reproduced:

1) In the projects tool, select a file system folder.
2) Right-click the folder and select "New file".
3) Enter a file name. The new file is created on the file system and displayed in the list nested under the folder I right-clicked.
4) Right-click the same folder again and select "New file".
5) Enter the SAME file name as in step 3. When clicking OK, a second ENTRY is created and displayed in the list (but no file is created on the file system).
6) Select one of the "new" files and right-click it (it doesn't matter which one).
7) Select "Delete". The file is deleted from the file system and the entry is removed from the list.
8) Double-click the remaining duplicated "new" file entry. This will crash Kate.

Kate: v24.12.2
KDE Plasma: v6.3.0
KDE Frameworks: v6.10.0
Qt: v6.8.2
Kernel: v6.12.11-200

The crash can be reproduced every time.

-- Backtrace (Reduced):
#5  0x00007f37f5fc1b74 in QHashPrivate::iterator<QHashPrivate::Node<QtPrivate::QModelIndexWrapper, QSortFilterProxyModelPrivate::Mapping*> >::node (this=<synthetic pointer>) at /usr/src/debug/qt6-qtbase-6.8.2-2.fc41.x86_64/src/corelib/tools/qhash.h:795
#6  QHash<QtPrivate::QModelIndexWrapper, QSortFilterProxyModelPrivate::Mapping*>::const_iterator::key (this=<synthetic pointer>) at /usr/src/debug/qt6-qtbase-6.8.2-2.fc41.x86_64/src/corelib/tools/qhash.h:1186
#7  QSortFilterProxyModel::parent (this=0x556692c5dd50, child=<optimized out>) at /usr/src/debug/qt6-qtbase-6.8.2-2.fc41.x86_64/src/corelib/itemmodels/qsortfilterproxymodel.cpp:2141
#8  0x00007f37f5f8f3ed in QModelIndex::parent (this=0x7fffb6efb310) at /usr/src/debug/qt6-qtbase-6.8.2-2.fc41.x86_64/src/corelib/itemmodels/qabstractitemmodel.h:506
#9  QItemSelection::select (this=this@entry=0x7fffb6efb280, topLeft=..., bottomRight=...) at /usr/src/debug/qt6-qtbase-6.8.2-2.fc41.x86_64/src/corelib/itemmodels/qitemselectionmodel.cpp:393


Reported using DrKonqi
Comment 1 Björn Bengtsson 2025-02-17 10:07:14 UTC
Created attachment 178472 [details]
New crash information added by DrKonqi

DrKonqi auto-attaching complete backtrace.
Comment 2 Björn Bengtsson 2025-02-17 10:08:56 UTC
Created attachment 178473 [details]
Another crash report
Comment 3 Waqar Ahmed 2025-02-17 10:42:44 UTC
Git commit 17dd0e382e44a39164b5ec2359e02f36c9f8363a by Waqar Ahmed.
Committed on 17/02/2025 at 10:42.
Pushed by waqar into branch 'master'.

Avoid creating duplicate files

M  +8    -0    addons/project/kateprojectviewtree.cpp

https://invent.kde.org/utilities/kate/-/commit/17dd0e382e44a39164b5ec2359e02f36c9f8363a
Comment 4 Waqar Ahmed 2025-03-13 09:16:30 UTC
*** Bug 501288 has been marked as a duplicate of this bug. ***