Bug 386709

Summary: Batch editing project defines causes a program crash
Product: [Applications] kdevelop Reporter: tony.wasserka
Component: generalAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: crash Keywords: junior-jobs
Priority: NOR    
Version: git master   
Target Milestone: 5.2.0   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 5.2.1
Sentry Crash Report:

Description tony.wasserka 2017-11-10 10:48:11 UTC
In the "Defines" tab of the "Language Support" pane in the project configuration dialog, trying to edit defined macros using the "Batch Edit..." dialog crashes KDevelop.

This affects all projects for me (both Makefile and CMake based). For the crash to manifest it's sufficient to open the dialog and press "OK" without making any modifications (including leaving the defines list empty).

I'm using the Ubuntu packages from blaze's kf5 PPA, currently at version 4:5.2.0+1~git20171109-1~xenial1. Unfortunately it seems that these builds do not come with debug information.

Thread 1 "kdevelop" received signal SIGSEGV, Segmentation fault.
0x00007ffff69136c4 in QPlainTextEdit::document() const () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
(gdb) bt
#0  0x00007ffff69136c4 in QPlainTextEdit::document() const () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#1  0x00007fff87dca0a5 in ?? () from /usr/lib/x86_64-linux-gnu/qt5/plugins/kdevplatform/30/kdevdefinesandincludesmanager.so
#2  0x00007ffff5e64baf in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007ffff6ac32b2 in QAbstractButton::clicked(bool) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#4  0x00007ffff6825f44 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#5  0x00007ffff6827559 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#6  0x00007ffff68276d4 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#7  0x00007ffff676bfc8 in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#8  0x00007ffff672905c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#9  0x00007ffff672ec19 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#10 0x00007ffff5e3638b in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007ffff672db32 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#12 0x00007ffff67865bb in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#13 0x00007ffff6788b7b in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#14 0x00007ffff672905c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x00007ffff672e516 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#16 0x00007ffff5e3638b in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007ffff61784e1 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#18 0x00007ffff617a1a5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#19 0x00007ffff615df08 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#20 0x00007fffdd6cb200 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#21 0x00007fffee62b197 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x00007fffee62b3f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007fffee62b49c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#24 0x00007ffff5e8c7cf in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#25 0x00007ffff5e33b4a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#26 0x00007ffff5e3bbec in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#27 0x000000000040c4ec in ?? ()
#28 0x00007ffff5484830 in __libc_start_main (main=0x4060b0, argc=1, argv=0x7fffffffdc18, init=<optimised out>, fini=<optimised out>, rtld_fini=<optimised out>, stack_end=0x7fffffffdc08) at ../csu/libc-start.c:291
#29 0x000000000040c809 in _start ()


Reproducible: Always

Steps to Reproduce:
1. Open the "Defines" tab of the "Language Support" pane in the project configuration dialog
2. Press "Batch Edit..."
3. Press "OK"

Actual Results:  
The application crashes immediately.

Expected Results:  
The application should run just fine.
Comment 1 Kevin Funk 2017-11-13 09:05:37 UTC
Git commit 22cb8945164634d3d6e0757763d1b6f2d847c1b6 by Kevin Funk.
Committed on 13/11/2017 at 09:04.
Pushed by kfunk into branch '5.2'.

custom-dai: Don't crash when batch editing

Broke with 6ccc2a32
FIXED-IN: 5.2.1

M  +1    -1    plugins/custom-definesandincludes/kcm_widget/projectpathswidget.cpp

https://commits.kde.org/kdevelop/22cb8945164634d3d6e0757763d1b6f2d847c1b6