Bug 494099 - Kate crashes after untracked file deleted from project sidebar
Summary: Kate crashes after untracked file deleted from project sidebar
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: 24.08.1
Platform: Neon Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2024-10-04 09:59 UTC by Helga
Modified: 2024-10-04 11:24 UTC (History)
0 users

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


Attachments
New crash information added by DrKonqi (72.20 KB, text/plain)
2024-10-04 09:59 UTC, Helga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Helga 2024-10-04 09:59:38 UTC
Application: kate (24.08.1)

Qt Version: 6.7.2
Frameworks Version: 6.6.0
Operating System: Linux 6.8.0-40-generic x86_64
Windowing System: X11
Distribution: KDE neon 6.1
DrKonqi: 6.1.5 [CoredumpBackend]

-- Information about the crash:
Reproducing the crash:

* open Kate via command line invocation with source files in a git repo, some of which are git-tracked and some of which aren't
* select untracked file via the project sidebar
* in the right click menu, press "delete" on the file

The crash can be reproduced every time.

-- Backtrace (Reduced):
#6  0x00007b7dc592800f in QHashPrivate::iterator<QHashPrivate::Node<QModelIndex, QSortFilterProxyModelPrivate::Mapping*> >::node (this=<synthetic pointer>) at ./src/corelib/tools/qhash.h:788
#7  QHash<QModelIndex, QSortFilterProxyModelPrivate::Mapping*>::const_iterator::value (this=<synthetic pointer>) at ./src/corelib/tools/qhash.h:1154
#8  QSortFilterProxyModelPrivate::proxy_to_source (proxy_index=..., this=0x60dc82fa91d0) at ./src/corelib/itemmodels/qsortfilterproxymodel.cpp:553
#9  QSortFilterProxyModelPrivate::proxy_to_source (proxy_index=..., this=0x60dc82fa91d0) at ./src/corelib/itemmodels/qsortfilterproxymodel.cpp:543
#10 QSortFilterProxyModel::mapToSource (this=<optimized out>, proxyIndex=...) at ./src/corelib/itemmodels/qsortfilterproxymodel.cpp:3241


Reported using DrKonqi
Comment 1 Helga 2024-10-04 09:59:39 UTC
Created attachment 174400 [details]
New crash information added by DrKonqi

DrKonqi auto-attaching complete backtrace.
Comment 2 Waqar Ahmed 2024-10-04 11:24:37 UTC
Git commit eb5d004ae1e0a913a1b211e2cd81806c96245bfc by Waqar Ahmed.
Committed on 04/10/2024 at 11:24.
Pushed by waqar into branch 'master'.

Check for index validity when deleting file

Can't reproduce the bug on master, but I can reproduce it with distro Kate.
Regardles, this change should make it safer

M  +27   -19   addons/project/kateprojecttreeviewcontextmenu.cpp

https://invent.kde.org/utilities/kate/-/commit/eb5d004ae1e0a913a1b211e2cd81806c96245bfc