Bug 373763 - Assertion failure with "View Diff"
Summary: Assertion failure with "View Diff"
Status: RESOLVED FIXED
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: git (show other bugs)
Version: git master
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
: 373790 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-12-17 14:07 UTC by Francis Herne
Modified: 2016-12-27 10:28 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.1.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francis Herne 2016-12-17 14:07:55 UTC
Using current master, adda66a

When selecting "Show Diff" or "Show Diff (all files)" in the annotations context menu, or "Diff to previous revision" in the context menu of a commit in the Git History dialog, KDevelop crashes with the backtrace below.

This seems to happen for any commit in any git project. Oopen

This doesn't happen with the "Show Differences" (i.e since latest commit) entry in the Projects->Git context menu.

This didn't happen with 5.0.2.

ASSERT: "d->type==Special" in file /home/flh/projects/kdevplatform/vcs/vcsrevision.cpp, line 89

(gdb) bt full
#0  0x00007ffff032b04f in raise () at /usr/lib/libc.so.6
#1  0x00007ffff032c47a in abort () at /usr/lib/libc.so.6
#2  0x00007ffff0fcc4f1 in  () at /usr/lib/libQt5Core.so.5
#3  0x00007ffff0fc79be in  () at /usr/lib/libQt5Core.so.5
#4  0x00007fffecfc5fc9 in KDevelop::VcsRevision::specialType() const (this=0x7fffffff9f10) at /home/flh/projects/kdevplatform/vcs/vcsrevision.cpp:89
#5  0x00007fffac6b1490 in GitPlugin::diff(QUrl const&, KDevelop::VcsRevision const&, KDevelop::VcsRevision const&, KDevelop::VcsDiff::Type, KDevelop::IBasicVersionControl::RecursionMode) (this=0x2d9af30, fileOrDirectory=..., srcRevision=..., dstRevision=..., recursion=KDevelop::IBasicVersionControl::Recursive) at /home/flh/projects/kdevplatform/plugins/git/gitplugin.cpp:369
        job = 0x3873930
#6  0x00007fffecfca46b in KDevelop::VcsPluginHelper::diffForRev(QUrl const&) (this=0x32381c0, url=...) at /home/flh/projects/kdevplatform/vcs/vcspluginhelper.cpp:327
        action = 0x32796f0
        rev = {_vptr.VcsRevision = 0x7fffed2182b0 <vtable for KDevelop::VcsRevision+16>, d = 0x18b8670}
        prev = {_vptr.VcsRevision = 0x7fffed2182b0 <vtable for KDevelop::VcsRevision+16>, d = 0x338e790}
        job = 0x0
#7  0x00007fffecfca2fb in KDevelop::VcsPluginHelper::diffForRevGlobal() (this=0x32381c0) at /home/flh/projects/kdevplatform/vcs/vcspluginhelper.cpp:315
        url = {d = 0x2e44dd0}
        project = 0x2ba6460
#8  0x00007fffecfd1353 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (KDevelop::VcsPluginHelper::*)()>::call(void (KDevelop::VcsPluginHelper::*)(), KDevelop::VcsPluginHelper*, void**) (f=(void (KDevelop::VcsPluginHelper::*)(KDevelop::VcsPluginHelper * const)) 0x7fffecfca1f4 <KDevelop::VcsPluginHelper::diffForRevGlobal()>, o=0x32381c0, arg=0x7fffffffa1b0)
    at /usr/include/qt/QtCore/qobjectdefs_impl.h:141
#9  0x00007fffecfd0d8f in QtPrivate::FunctionPointer<void (KDevelop::VcsPluginHelper::*)()>::call<QtPrivate::List<>, void>(void (KDevelop::VcsPluginHelper::*)(), KDevelop::VcsPluginHelper*, void**) (f=(void (KDevelop::VcsPluginHelper::*)(KDevelop::VcsPluginHelper * const)) 0x7fffecfca1f4 <KDevelop::VcsPluginHelper::diffForRevGlobal()>, o=0x32381c0, arg=0x7fffffffa1b0)
    at /usr/include/qt/QtCore/qobjectdefs_impl.h:160
#10 0x00007fffecfd059b in QtPrivate::QSlotObject<void (KDevelop::VcsPluginHelper::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x30ede30, r=0x32381c0, a=0x7fffffffa1b0, ret=0x0) at /usr/include/qt/QtCore/qobject_impl.h:120
#11 0x00007ffff11ec43e in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/libQt5Core.so.5
#12 0x00007ffff1e93992 in QAction::triggered(bool) () at /usr/lib/libQt5Widgets.so.5
#13 0x00007ffff1e96380 in QAction::activate(QAction::ActionEvent) () at /usr/lib/libQt5Widgets.so.5
#14 0x00007ffff200582a in  () at /usr/lib/libQt5Widgets.so.5
#15 0x00007ffff200ce8c in  () at /usr/lib/libQt5Widgets.so.5
#16 0x00007ffff200de86 in QMenu::mouseReleaseEvent(QMouseEvent*) () at /usr/lib/libQt5Widgets.so.5
#17 0x00007ffff1ee19b8 in QWidget::event(QEvent*) () at /usr/lib/libQt5Widgets.so.5
#18 0x00007ffff20101b3 in QMenu::event(QEvent*) () at /usr/lib/libQt5Widgets.so.5
#19 0x00007ffff1e9a35c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#20 0x00007ffff1ea298d in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#21 0x00007ffff11c08e0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#22 0x00007ffff1ea103d in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () at /usr/lib/libQt5Widgets.so.5
#23 0x00007ffff1efc4c6 in  () at /usr/lib/libQt5Widgets.so.5
#24 0x00007ffff1efeac3 in  () at /usr/lib/libQt5Widgets.so.5
#25 0x00007ffff1e9a35c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#26 0x00007ffff1ea1ad1 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#27 0x00007ffff11c08e0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#28 0x00007ffff1706663 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /usr/lib/libQt5Gui.so.5
#29 0x00007ffff17081e5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/libQt5Gui.so.5
#30 0x00007ffff16e615b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Gui.so.5
#31 0x00007fffd7b42dc0 in  () at /usr/lib/libQt5XcbQpa.so.5
#32 0x00007fffe4daa587 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#33 0x00007fffe4daa7f0 in  () at /usr/lib/libglib-2.0.so.0
#34 0x00007fffe4daa89c in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#35 0x00007ffff12152bf in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#36 0x00007ffff11bed3a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#37 0x00007ffff200a97d in QMenu::exec(QPoint const&, QAction*) () at /usr/lib/libQt5Widgets.so.5
#38 0x00007ffff5da0ddb in  () at /usr/lib/libKF5TextEditor.so.5
#39 0x00007ffff5da126f in  () at /usr/lib/libKF5TextEditor.so.5
#40 0x00007ffff1ee19b8 in QWidget::event(QEvent*) () at /usr/lib/libQt5Widgets.so.5
#41 0x00007ffff1e9a35c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#42 0x00007ffff1ea298d in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#43 0x00007ffff11c08e0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
---Type <return> to continue, or q <return> to quit---
#44 0x00007ffff1ea103d in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () at /usr/lib/libQt5Widgets.so.5
#45 0x00007ffff1efc0b6 in  () at /usr/lib/libQt5Widgets.so.5
#46 0x00007ffff1efeac3 in  () at /usr/lib/libQt5Widgets.so.5
#47 0x00007ffff1e9a35c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#48 0x00007ffff1ea1ad1 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#49 0x00007ffff11c08e0 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#50 0x00007ffff1706663 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /usr/lib/libQt5Gui.so.5
#51 0x00007ffff17081e5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/libQt5Gui.so.5
#52 0x00007ffff16e615b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Gui.so.5
#53 0x00007fffd7b42dc0 in  () at /usr/lib/libQt5XcbQpa.so.5
#54 0x00007fffe4daa587 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#55 0x00007fffe4daa7f0 in  () at /usr/lib/libglib-2.0.so.0
#56 0x00007fffe4daa89c in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#57 0x00007ffff12152bf in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#58 0x00007ffff11bed3a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#59 0x00007ffff11c723c in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#60 0x000000000040f1f5 in main ()
Comment 1 Kevin Funk 2016-12-18 11:19:59 UTC
*** Bug 373790 has been marked as a duplicate of this bug. ***
Comment 2 Francis Herne 2016-12-26 00:54:52 UTC
Git commit 58ef793180cd1cc4b071072fdf2d85e4fb9ea52a by Francis Herne.
Committed on 26/12/2016 at 00:54.
Pushed by flherne into branch 'master'.

Don't hit assertion with "View Diff"

Commit 0c9ff4de caused KDevelop to crash on "View Diff" in almost all
 cases, because it didn't check
  `dstRevision.revisionType() == VcsRevision::Special`
 before calling `dstRevision.specialType()`.

I have other doubts about that commit, but for now just fix the bug.

M  +8    -7    plugins/git/gitplugin.cpp

https://commits.kde.org/kdevplatform/58ef793180cd1cc4b071072fdf2d85e4fb9ea52a