Bug 441807 - KDevelop crashes upon saving file in subversion project
Summary: KDevelop crashes upon saving file in subversion project
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: VCS: Git (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-31 09:46 UTC by complex_octonion
Modified: 2021-09-04 14:32 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description complex_octonion 2021-08-31 09:46:09 UTC
SUMMARY
It is not possible to use KDevelop for projects where subversion is used, since it crashes upon saving files.

STEPS TO REPRODUCE
1. Open a session with a project where subversion is used.
2. Edit a file and save the changes.

OBSERVED RESULT
KDevelop crashes


EXPECTED RESULT
KDevelop does not crash

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Arch Linux
(available in About System)
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Using git bisect, the crash was identified as being introduced by commit 6e999b0161a2610b0a256316481b39d5b1d3b9f0:
    Implements a toolview which helps in preparing useful, self contained Git commits.
    
    It allows picking and choosing which changes to stage and then, when they are ready, to commit them to the repo.
    
    See https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/128 for more details.


Having built KDevelop revision 50eaff66056898d039047f54290b3e5d8f09594f in Release mode gives the following stack trace for the crash upon saving a file:
Thread 1 "kdevelop" received signal SIGSEGV, Segmentation fault.
0x00007ffff6e363a0 in QStandardItem::rowCount() const () from /usr/lib/libQt5Gui.so.5
(gdb) bt
#0  0x00007ffff6e363a0 in QStandardItem::rowCount() const () at /usr/lib/libQt5Gui.so.5
#1  0x00007fffa951a20c in  () at /usr/lib/qt/plugins/kdevplatform/35/kdevgit.so
#2  0x00007fffa951ef7d in  () at /usr/lib/qt/plugins/kdevplatform/35/kdevgit.so
#3  0x00007ffff659f75b in  () at /usr/lib/libQt5Core.so.5
#4  0x00007ffff68ba91a in KJob::finished(KJob*, KJob::QPrivateSignal) () at /usr/lib/libKF5CoreAddons.so.5
#5  0x00007ffff68bb86e in KJob::finishJob(bool) () at /usr/lib/libKF5CoreAddons.so.5
#6  0x00007ffff65954ff in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#7  0x00007ffff723dd62 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#8  0x00007ffff65683aa in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#9  0x00007ffff656b4a9 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/libQt5Core.so.5
#10 0x00007ffff65c19a4 in  () at /usr/lib/libQt5Core.so.5
#11 0x00007ffff29cc10c in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#12 0x00007ffff2a1fba9 in  () at /usr/lib/libglib-2.0.so.0
#13 0x00007ffff29c9871 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#14 0x00007ffff65c0fd6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#15 0x00007ffff6566d1c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#16 0x00007ffff656f284 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#17 0x000055555555fa9c in  ()
#18 0x00007ffff5ef2b25 in __libc_start_main () at /usr/lib/libc.so.6
#19 0x00005555555607ae in  ()


Having built KDevelop revision 50eaff66056898d039047f54290b3e5d8f09594f in Debug mode gives a slightly different stack trace for the crash upon saving a file (due to assertions being enabled):
#0  0x00007ffff5f28d22 in raise () at /usr/lib/libc.so.6
#1  0x00007ffff5f12862 in abort () at /usr/lib/libc.so.6
#2  0x00007ffff6360910 in  () at /usr/lib/libQt5Core.so.5
#3  0x00007ffff635fcf5 in qt_assert_x(char const*, char const*, char const*, int) () at /usr/lib/libQt5Core.so.5
#4  0x00007fffa953f08d in RepoStatusModel::projectItem(KDevelop::IProject*) const (this=<optimized out>, p=<optimized out>)
    at kdevelop/plugins/git/repostatusmodel.cpp:158
#5  0x00007fffa9547320 in RepoStatusModel::statusReady(KJob*) (this=0x555556348040, job=0x555557eaeb50)
    at kdevelop/plugins/git/repostatusmodel.cpp:446
#6  0x00007ffff65c075b in  () at /usr/lib/libQt5Core.so.5
#7  0x00007ffff68db91a in KJob::finished(KJob*, KJob::QPrivateSignal) () at /usr/lib/libKF5CoreAddons.so.5
#8  0x00007ffff68dc86e in KJob::finishJob(bool) () at /usr/lib/libKF5CoreAddons.so.5
#9  0x00007ffff65b64ff in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#10 0x00007ffff725ed62 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#11 0x00007ffff65893aa in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#12 0x00007ffff658c4a9 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/libQt5Core.so.5
#13 0x00007ffff65e29a4 in  () at /usr/lib/libQt5Core.so.5
#14 0x00007ffff29ec10c in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#15 0x00007ffff2a3fba9 in  () at /usr/lib/libglib-2.0.so.0
#16 0x00007ffff29e9871 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#17 0x00007ffff65e1fd6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#18 0x00007ffff6587d1c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#19 0x00007ffff6590284 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#20 0x000055555555fec7 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at kdevelop/app/main.cpp:855
Comment 1 Igor Kushnir 2021-09-02 10:12:29 UTC
Does https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/252 fix this issue too?
Comment 2 complex_octonion 2021-09-03 16:01:00 UTC
Yes, that fixes this issue too.
Comment 3 Igor Kushnir 2021-09-04 14:32:48 UTC
Git commit d4f79c14e61c15e0b47b476423217f4c7b4414dc by Igor Kushnir.
Committed on 03/09/2021 at 17:42.
Pushed by igorkushnir into branch 'master'.

Git Support plugin: don't crash on projects with another or no VCS

This fix eliminates two crashes:
    * when a project w/o VCS is closed;
    * when a file in a subversion project is saved.
Related: bug 441893

M  +3    -1    plugins/git/repostatusmodel.cpp
M  +1    -1    plugins/git/repostatusmodel.h

https://invent.kde.org/kdevelop/kdevelop/commit/d4f79c14e61c15e0b47b476423217f4c7b4414dc