Bug 441893 - Closing a project with no VCS crashes KDevelop
Summary: Closing a project with no VCS crashes KDevelop
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: VCS: Git (show other bugs)
Version: git master
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2021-09-02 07:04 UTC by Igor Kushnir
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 Igor Kushnir 2021-09-02 07:04:12 UTC
Application: kdevelop (5.6.40)
 (Compiled from sources)
Qt Version: 5.15.2
Frameworks Version: 5.85.0
Operating System: Linux 5.10.60-1-MANJARO x86_64
Windowing System: X11
Drkonqi Version: 5.22.4
Distribution: Manjaro Linux

-- Information about the crash:
- What I was doing when the application crashed: exiting a KDevelop session with a project that has no version control system configured.

Steps to reproduce:
1. Open or create a project without a version control system.
2. Close the opened/created project or exit KDevelop.

The reporter is unsure if this crash is reproducible.

-- Backtrace:
Application: KDevelop (kdevelop), signal: Segmentation fault

[KCrash Handler]
#4  0x00007f03f00162a4 in QStandardItem::rowCount() const () at /usr/lib/libQt5Gui.so.5
#5  0x00007f03766eff37 in findItemChild(QStandardItem const*, QVariant const&, int) (parent=parent@entry=0x0, value=..., role=role@entry=258) at /usr/src/debug/kdevelop/plugins/git/repostatusmodel.cpp:146
#6  0x00007f03766f0020 in RepoStatusModel::projectItem(KDevelop::IProject*) const (this=this@entry=0x558cc6486290, p=<optimized out>) at /usr/src/debug/kdevelop/plugins/git/repostatusmodel.cpp:160
#7  0x00007f03766f012b in RepoStatusModel::removeProject(KDevelop::IProject*) (this=0x558cc6486290, p=<optimized out>) at /usr/src/debug/kdevelop/plugins/git/repostatusmodel.cpp:134
#8  0x00007f03ef7738b5 in  () at /usr/lib/libQt5Core.so.5
#9  0x00007f03f0f18163 in KDevelop::IProjectController::projectClosing(KDevelop::IProject*) (this=this@entry=0x558cc5e37700, _t1=<optimized out>, _t1@entry=0x558cc71b8f00) at /usr/src/debug/build/kdevplatform/interfaces/KDevPlatformInterfaces_autogen/EWIEGA46WW/moc_iprojectcontroller.cpp:273
#10 0x00007f03f1028318 in KDevelop::ProjectController::takeProject(KDevelop::IProject*) (this=0x558cc5e37700, proj=<optimized out>) at /usr/src/debug/kdevelop/kdevplatform/shell/projectcontroller.cpp:1073
#11 0x00007f03f102852e in KDevelop::ProjectController::closeProject(KDevelop::IProject*) (proj=0x558cc71b8f00, this=0x558cc5e37700) at /usr/src/debug/kdevelop/kdevplatform/shell/projectcontroller.cpp:1093
#12 KDevelop::ProjectController::closeAllProjects() (this=0x558cc5e37700) at /usr/src/debug/kdevelop/kdevplatform/shell/projectcontroller.cpp:1103
#13 0x00007f03f101b621 in KDevelop::Core::cleanup() (this=0x558cc597d860) at /usr/src/debug/kdevelop/kdevplatform/shell/core.cpp:386
#14 0x00007f03f101b8d0 in KDevelop::Core::shutdown() (this=0x558cc597d860) at /usr/src/debug/kdevelop/kdevplatform/shell/core.cpp:344
#15 0x00007f03f0ffd3ce in KDevelop::MainWindow::~MainWindow() (this=0x558cc598e160, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /usr/src/debug/kdevelop/kdevplatform/shell/mainwindow.cpp:150
#16 0x00007f03f0ffd42a in KDevelop::MainWindow::~MainWindow() (this=0x558cc598e160, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /usr/src/debug/kdevelop/kdevplatform/shell/mainwindow.cpp:154
#17 0x00007f03ef769e64 in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#18 0x00007f03ed85d528 in KXmlGuiWindow::event(QEvent*) () at /usr/lib/libKF5XmlGui.so.5
#19 0x00007f03f0420ff6 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#20 0x00007f03ef73c1aa in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#21 0x00007f03ef73f359 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/libQt5Core.so.5
#22 0x00007f03ef7964b8 in  () at /usr/lib/libQt5Core.so.5
#23 0x00007f03ebbff10c in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#24 0x00007f03ebc52ba9 in  () at /usr/lib/libglib-2.0.so.0
#25 0x00007f03ebbfc871 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#26 0x00007f03ef795aca in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#27 0x00007f03ef73aa5b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#28 0x00007f03ef743248 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#29 0x0000558cc48f49d6 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kdevelop/app/main.cpp:855
[Inferior 1 (process 210948) detached]

Possible duplicates by query: bug 383917, bug 382875, bug 344710, bug 308083, bug 305026.

Reported using DrKonqi
Comment 1 Igor Kushnir 2021-09-02 07:12:56 UTC
> The reporter is unsure if this crash is reproducible.
That's my reporting mistake. Actually the crash can be reproduced every time on every project without a VCS.

In a Debug build the assertion is triggered: ASSERT: "proj" in file /home/Fast_storage/kdevelop/plugins/git/repostatusmodel.cpp, line 158
Comment 2 Jan Paul Batrina 2021-09-02 08:43:18 UTC
Can confirm with kdevelop built from master.

Possibly related to https://bugs.kde.org/show_bug.cgi?id=441807 since both crashes are in QStandardItem::rowCount() and are VCS-related.

Can you test if the crash does not occur before the commit 6e999b0161a2610b0a256316481b39d5b1d3b9f0?
Comment 3 Bug Janitor Service 2021-09-02 08:54:30 UTC
A possibly relevant merge request was started @ https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/252
Comment 4 Bug Janitor Service 2021-09-02 08:54:32 UTC
A possibly relevant merge request was started @ https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/252
Comment 5 Igor Kushnir 2021-09-02 08:59:41 UTC
> Can you test if the crash does not occur before the commit 6e999b0161a2610b0a256316481b39d5b1d3b9f0?
Makes more sense for you to test if the SVN crash is fixed by my merge request :)
Comment 6 Igor Kushnir 2021-09-02 10:11:38 UTC
> Makes more sense for you to test if the SVN crash is fixed by my merge request :)
Jan Paul Batrina, sorry, mixed you up with the svn crash reporter :)
I'll ask the reporter of the svn crash to test the patch.
Comment 7 Jan Paul Batrina 2021-09-02 10:20:11 UTC
It's all right, I would have tested it too but sadly I'm not too familiar with subversion.

Glad you quickly found a fix! Hopefully both bugs are fixed after that is merged
Comment 8 Igor Kushnir 2021-09-04 14:32:56 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 441807

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

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