https://bugs.kde.org/show_bug.cgi?id=441319
Bug ID: 441319 Summary: reproducible libclang: crash detected during parsing on startup Product: kdevelop Version: 5.6.2 Platform: Gentoo Packages OS: Linux Status: REPORTED Severity: normal Priority: NOR Component: Language Support: CPP (Clang-based) Assignee: kdevelop-bugs-n...@kde.org Reporter: amber...@hotmail.com Target Milestone: --- Created attachment 140920 --> https://bugs.kde.org/attachment.cgi?id=140920&action=edit change causing kdevelop crash SUMMARY Short story long: saw that ECM 5.85.0 comes with optional stricter compiler settings so decided to turn them on and work through them (project is https://sourceforge.net/p/kuroo). STEPS TO REPRODUCE 1. Fetch revision #1657 of https://svn.code.sf.net/p/kuroo/code/kuroo4/trunk 2. Apply attached patch 3. Trigger clang reparse of the project OBSERVED RESULT KDevelop crashes, console output: ``` $ kdevelop QSocketNotifier: Can only be used with threads started with QThread kdevplatform.serialization: version mismatch or no version hint; expected version: 84279809 kdevplatform.serialization: "The data-repository at /home/andrew/.cache/kdevduchain/kdevelop-{83555a53-d447-4862-b0f6-024f33d6573b} has to be cleared." Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString) kf.coreaddons: no metadata found in "/usr/lib64/qt5/plugins/kf5/kio/desktop.so" "Failed to extract plugin meta data from '/usr/lib64/qt5/plugins/kf5/kio/desktop.so'" kf.coreaddons: no metadata found in "/usr/lib64/qt5/plugins/kf5/kio/applications.so" "Failed to extract plugin meta data from '/usr/lib64/qt5/plugins/kf5/kio/applications.so'" kf.coreaddons: no metadata found in "/usr/lib64/qt5/plugins/kf5/kio/desktop.so" "Failed to extract plugin meta data from '/usr/lib64/qt5/plugins/kf5/kio/desktop.so'" kf.coreaddons: no metadata found in "/usr/lib64/qt5/plugins/kf5/kio/applications.so" "Failed to extract plugin meta data from '/usr/lib64/qt5/plugins/kf5/kio/applications.so'" kf.coreaddons: no metadata found in "/usr/lib64/qt5/plugins/kf5/kio/desktop.so" "Failed to extract plugin meta data from '/usr/lib64/qt5/plugins/kf5/kio/desktop.so'" kf.coreaddons: no metadata found in "/usr/lib64/qt5/plugins/kf5/kio/applications.so" "Failed to extract plugin meta data from '/usr/lib64/qt5/plugins/kf5/kio/applications.so'" qrc:/qml/Develop.qml:139:21: QML Heading: Binding loop detected for property "font.pointSize" qrc:/qml/area_code.qml:87:9: QML Heading: Binding loop detected for property "font.pointSize" qrc:/qml/area_code.qml:63:9: QML Heading: Binding loop detected for property "font.pointSize" qrc:/qml/storage.js:24: TypeError: Cannot call method 'openDatabaseSync' of undefined qrc:/qml/storage.js:24: TypeError: Cannot call method 'openDatabaseSync' of undefined libclang: crash detected during parsing: { 'source_filename' : '/home/andrew/code/kuroo/trunk/src/core/global.cpp' 'command_line_args' : ['clang', '-ferror-limit=100', '-fspell-checking', '', '-Wunused-parameter', '-Wunreachable-code', '-Wall', '-Wextra', '-Wcast-align', '-Wchar-subscripts', '-Wformat-security', '-Wno-long-long', '-Wpointer-arith', '-Wundef', '-Wnon-virtual-dtor', '-Woverloaded-virtual', '-Wreturn-type', '-Wvla', '-Wdate-time', '-Wsuggest-override', '-Wlogical-op', '-std=c++11', '-fno-operator-names', '-Wall', '-Wextra', '-Wcast-align', '-Wchar-subscripts', '-Wformat-security', '-Wno-long-long', '-Wpointer-arith', '-Wundef', '-Wnon-virtual-dtor', '-Woverloaded-virtual', '-Wreturn-type', '-Wvla', '-Wdate-time', '-Wsuggest-override', '-Wlogical-op', '-pedantic', '-Wzero-as-null-pointer-constant', '-Wmissing-include-dirs', '-fdiagnostics-color=always', '-fexceptions', '-fvisibility=hidden', '-fvisibility-inlines-hidden', '-fPIC', '-std=c++17', '-nostdinc', '-nostdinc++', '-xc++', '-isystem', '/usr/share/kdevclangsupport/wrappedQtHeaders', '-isystem', '/usr/share/kdevclangsupport/wrappedQtHeaders/QtCore', '-isystem/usr/include/qt5', '-isystem/usr/include/KF5/KItemViews', '-isystem/usr/include/KF5/kio', '-isystem/usr/include/KF5/KJobWidgets', '-isystem/usr/include/KF5/KNotifications', '-isystem/usr/include/KF5/KWidgetsAddons', '-isystem/usr/include/KF5/KConfigCore', '-isystem/usr/include/KF5/KCoreAddons', '-isystem/usr/include/KF5/KI18n', '-isystem/usr/include/KF5/KService', '-isystem/usr/include/KF5/KCompletion', '-isystem/usr/include/KF5/ThreadWeaver', '-isystem/usr/include/KF5/KTextWidgets', '-isystem/usr/include/KF5/Solid', '-isystem/usr/include/KF5/KDESu', '-isystem/usr/include/KF5/KWindowSystem', '-isystem/usr/include/KF5/KCoreAddons', '-isystem/usr/include/KF5/SonnetCore', '-isystem/usr/include/KF5/KPty', '-isystem/usr/include/KF5/KAuth', '-isystem/usr/include/KF5/KWidgetsAddons', '-isystem/usr/include/KF5/KConfigWidgets', '-isystem/usr/include/KF5/KXmlGui', '-isystem/usr/include/qt5/QtWidgets', '-isystem/usr/include/qt5/QtGui', '-isystem/usr/include/qt5/QtCore', '-isystem/usr/include/KF5/KCodecs', '-isystem/usr/include/KF5/KIconThemes', '-isystem/usr/include/KF5/KItemModels', '-isystem/usr/include/qt5', '-isystem/usr/include/qt5/QtCore', '-isystem/usr/lib64/qt5/mkspecs/linux-g++', '-isystem/usr/include/KF5/KAuth', '-isystem/usr/include/KF5', '-isystem/usr/include/KF5/KCoreAddons', '-isystem/usr/include/KF5/KConfigCore', '-isystem/usr/include/KF5/KConfigGui', '-isystem/usr/include/qt5/QtGui', '-isystem/usr/include/qt5/QtXml', '-isystem/usr/include/KF5/KI18n', '-isystem/usr/include/KF5/KItemViews', '-isystem/usr/include/qt5/QtWidgets', '-isystem/usr/include/KF5/KIOCore', '-isystem/usr/include/KF5/KService', '-isystem/usr/include/qt5/QtNetwork', '-isystem/usr/include/qt5/QtDBus', '-isystem/usr/include/KF5/KNotifications', '-isystem/usr/include/KF5/ThreadWeaver', '-isystem/usr/include/KF5/KTextWidgets', '-isystem/usr/include/KF5/SonnetUi', '-isystem/usr/include/KF5/KWidgetsAddons', '-isystem/usr/include/KF5/KWindowSystem', '-isystem/usr/include/KF5/KXmlGui', '-isystem/usr/include/KF5/KConfigWidgets', '-isystem/usr/include/KF5/KCodecs', '-isystem/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11', '-isystem/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11/x86_64-pc-linux-gnu', '-isystem/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11/backward', '-isystem/usr/include', '-I/home/andrew/code/kuroo/trunk/src', '-I/home/andrew/code/kuroo/trunk/src/portage', '-I/home/andrew/code/kuroo/trunk/src/core', '-I/home/andrew/code/kuroo/trunk/src/queue', '-I/home/andrew/code/kuroo/trunk/src/history', '-I/home/andrew/code/kuroo/trunk/src/config', '-I/home/andrew/code/kuroo/trunk/src/logs', '-I/home/andrew/code/kuroo/trunk/build/src', '-I/home/andrew/code/kuroo/trunk/src', '-I/home/andrew/code/kuroo/trunk/build/src/kuroo_autogen/include', '-I/home/andrew/code/kuroo/trunk/src/config', '-I/home/andrew/code/kuroo/trunk/src/core', '-I/home/andrew/code/kuroo/trunk/src/history', '-I/home/andrew/code/kuroo/trunk/src/intro', '-I/home/andrew/code/kuroo/trunk/src/logs', '-I/home/andrew/code/kuroo/trunk/src/portage', '-I/home/andrew/code/kuroo/trunk/src/queue', '-isystem', '/usr/lib/clang/12.0.1/include', '-imacros', '/tmp/kdevelop.uOquwG', '-working-directory/home/andrew/code/kuroo/trunk/build'], 'unsaved_files' : [], 'options' : 781, } KCrash: crashing... crashRecursionCounter = 2 KCrash: Application Name = kdevelop path = /usr/bin pid = 11999 KCrash: Arguments: /usr/bin/kdevelop KCrash: Attempting to start /usr/lib64/libexec/drkonqi QSocketNotifier: Invalid socket 3 and type 'Read', disabling... QSocketNotifier: Invalid socket 14 and type 'Read', disabling... QSocketNotifier: Invalid socket 65 and type 'Read', disabling... QSocketNotifier: Invalid socket 75 and type 'Read', disabling... QSocketNotifier: Invalid socket 67 and type 'Read', disabling... QSocketNotifier: Invalid socket 70 and type 'Exception', disabling... QSocketNotifier: Invalid socket 72 and type 'Read', disabling... QSocketNotifier: Invalid socket 22 and type 'Read', disabling... QSocketNotifier: Invalid socket 25 and type 'Read', disabling... QSocketNotifier: Invalid socket 19 and type 'Read', disabling... The Wayland connection experienced a fatal error: Invalid argument Unable to start Dr. Konqi QSocketNotifier: Can only be used with threads started with QThread ``` EXPECTED RESULT KDevelop works as usual SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: Gentoo kernel 5.12.19 (available in About System) KDE Plasma Version: 5.85.0 KDE Frameworks Version: 5.22.4 Qt Version: 5.15.2 ADDITIONAL INFORMATION Output when running the clang command manually: ``` ~/code/kuroo/trunk $ clang -ferror-limit=100 -fspell-checking -Wunused-parameter -Wunreachable-code -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Wreturn-type -Wvla -Wdate-time -Wsuggest-override -Wlogical-op -std=c++11 -fno-operator-names -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Wreturn-type -Wvla -Wdate-time -Wsuggest-override -Wlogical-op -pedantic -Wzero-as-null-pointer-constant -Wmissing-include-dirs -fdiagnostics-color=always -fexceptions -fvisibility=hidden -fvisibility-inlines-hidden -fPIC -std=c++17 -nostdinc -nostdinc++ -xc++ -isystem /usr/share/kdevclangsupport/wrappedQtHeaders -isystem /usr/share/kdevclangsupport/wrappedQtHeaders/QtCore -isystem/usr/include/qt5 -isystem/usr/include/KF5/KItemViews -isystem/usr/include/KF5/kio -isystem/usr/include/KF5/KJobWidgets -isystem/usr/include/KF5/KNotifications -isystem/usr/include/KF5/KWidgetsAddons -isystem/usr/include/KF5/KConfigCore -isystem/usr/include/KF5/KCoreAddons -isystem/usr/include/KF5/KI18n -isystem/usr/include/KF5/KService -isystem/usr/include/KF5/KCompletion -isystem/usr/include/KF5/ThreadWeaver -isystem/usr/include/KF5/KTextWidgets -isystem/usr/include/KF5/Solid -isystem/usr/include/KF5/KDESu -isystem/usr/include/KF5/KWindowSystem -isystem/usr/include/KF5/KCoreAddons -isystem/usr/include/KF5/SonnetCore -isystem/usr/include/KF5/KPty -isystem/usr/include/KF5/KAuth -isystem/usr/include/KF5/KWidgetsAddons -isystem/usr/include/KF5/KConfigWidgets -isystem/usr/include/KF5/KXmlGui -isystem/usr/include/qt5/QtWidgets -isystem/usr/include/qt5/QtGui -isystem/usr/include/qt5/QtCore -isystem/usr/include/KF5/KCodecs -isystem/usr/include/KF5/KIconThemes -isystem/usr/include/KF5/KItemModels -isystem/usr/include/qt5 -isystem/usr/include/qt5/QtCore -isystem/usr/lib64/qt5/mkspecs/linux-g++ -isystem/usr/include/KF5/KAuth -isystem/usr/include/KF5 -isystem/usr/include/KF5/KCoreAddons -isystem/usr/include/KF5/KConfigCore -isystem/usr/include/KF5/KConfigGui -isystem/usr/include/qt5/QtGui -isystem/usr/include/qt5/QtXml -isystem/usr/include/KF5/KI18n -isystem/usr/include/KF5/KItemViews -isystem/usr/include/qt5/QtWidgets -isystem/usr/include/KF5/KIOCore -isystem/usr/include/KF5/KService -isystem/usr/include/qt5/QtNetwork -isystem/usr/include/qt5/QtDBus -isystem/usr/include/KF5/KNotifications -isystem/usr/include/KF5/ThreadWeaver -isystem/usr/include/KF5/KTextWidgets -isystem/usr/include/KF5/SonnetUi -isystem/usr/include/KF5/KWidgetsAddons -isystem/usr/include/KF5/KWindowSystem -isystem/usr/include/KF5/KXmlGui -isystem/usr/include/KF5/KConfigWidgets -isystem/usr/include/KF5/KCodecs -isystem/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11 -isystem/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11/x86_64-pc-linux-gnu -isystem/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include/g++-v11/backward -isystem/usr/include -I/home/andrew/code/kuroo/trunk/src -I/home/andrew/code/kuroo/trunk/src/portage -I/home/andrew/code/kuroo/trunk/src/core -I/home/andrew/code/kuroo/trunk/src/queue -I/home/andrew/code/kuroo/trunk/src/history -I/home/andrew/code/kuroo/trunk/src/config -I/home/andrew/code/kuroo/trunk/src/logs -I/home/andrew/code/kuroo/trunk/build/src -I/home/andrew/code/kuroo/trunk/src -I/home/andrew/code/kuroo/trunk/build/src/kuroo_autogen/include -I/home/andrew/code/kuroo/trunk/src/config -I/home/andrew/code/kuroo/trunk/src/core -I/home/andrew/code/kuroo/trunk/src/history -I/home/andrew/code/kuroo/trunk/src/intro -I/home/andrew/code/kuroo/trunk/src/logs -I/home/andrew/code/kuroo/trunk/src/portage -I/home/andrew/code/kuroo/trunk/src/queue -isystem /usr/lib/clang/12.0.1/include -imacros /tmp/kdevelop.uOquwG -working-directory/home/andrew/code/kuroo/trunk/build /home/andrew/code/kuroo/trunk/src/core/global.cpp warning: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'? [-Wunknown-warning-option] warning: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'? [-Wunknown-warning-option] In file included from /home/andrew/code/kuroo/trunk/src/core/global.cpp:24: /home/andrew/code/kuroo/trunk/src/core/global.h:32:46: error: lambda expression in an unevaluated operand Q_GLOBAL_STATIC_WITH_ARGS(QString, kurooDir, QStringLiteral("/var/cache/kuroo/")); //->KConfig ^ /usr/include/qt5/QtCore/qstringliteral.h:66:6: note: expanded from macro 'QStringLiteral' ([]() noexcept -> QString { \ ^ In file included from /home/andrew/code/kuroo/trunk/src/core/global.cpp:24: /home/andrew/code/kuroo/trunk/src/core/global.h:35:59: error: expected '(' or '{' Q_GLOBAL_STATIC_WITH_ARGS(QRegularExpression, m_rxEmerge, QS("^\\[ebuild([\\s\\w~#*]*)\\]\\s+" //Also allow * for merging hardmasked packages ^ /home/andrew/code/kuroo/trunk/src/core/global.h:35:1: error: unexpected type name 'Type': expected expression Q_GLOBAL_STATIC_WITH_ARGS(QRegularExpression, m_rxEmerge, QS("^\\[ebuild([\\s\\w~#*]*)\\]\\s+" //Also allow * for merging hardmasked packages ^ /usr/include/qt5/QtCore/qglobalstatic.h:153:9: note: expanded from macro 'Q_GLOBAL_STATIC_WITH_ARGS' Q_GLOBAL_STATIC_INTERNAL(ARGS) \ ^ /usr/include/qt5/QtCore/qglobalstatic.h:89:35: note: expanded from macro 'Q_GLOBAL_STATIC_INTERNAL' noexcept(noexcept(Type ARGS)) \ ^ In file included from /home/andrew/code/kuroo/trunk/src/core/global.cpp:24: /home/andrew/code/kuroo/trunk/src/core/global.h:35:59: error: expected ')' Q_GLOBAL_STATIC_WITH_ARGS(QRegularExpression, m_rxEmerge, QS("^\\[ebuild([\\s\\w~#*]*)\\]\\s+" //Also allow * for merging hardmasked packages ^ /home/andrew/code/kuroo/trunk/src/core/global.h:35:1: note: to match this '(' Q_GLOBAL_STATIC_WITH_ARGS(QRegularExpression, m_rxEmerge, QS("^\\[ebuild([\\s\\w~#*]*)\\]\\s+" //Also allow * for merging hardmasked packages ^ /usr/include/qt5/QtCore/qglobalstatic.h:153:9: note: expanded from macro 'Q_GLOBAL_STATIC_WITH_ARGS' Q_GLOBAL_STATIC_INTERNAL(ARGS) \ ^ /usr/include/qt5/QtCore/qglobalstatic.h:89:34: note: expanded from macro 'Q_GLOBAL_STATIC_INTERNAL' noexcept(noexcept(Type ARGS)) \ ^ /home/andrew/code/kuroo/trunk/src/core/global.cpp:27:63: error: calling a private constructor of class 'QString' Q_GLOBAL_STATIC_WITH_ARGS(QRegularExpression, rxNameVersion, ("(?:[a-zA-Z0-9]|-)*" ^ /usr/include/qt5/QtCore/qstring.h:973:5: note: declared private here QString(const char *ch); ^ /home/andrew/code/kuroo/trunk/src/core/global.cpp:27:63: error: calling a private constructor of class 'QString' Q_GLOBAL_STATIC_WITH_ARGS(QRegularExpression, rxNameVersion, ("(?:[a-zA-Z0-9]|-)*" ^ /usr/include/qt5/QtCore/qstring.h:973:5: note: declared private here QString(const char *ch); ^ /home/andrew/code/kuroo/trunk/src/core/global.cpp:42:18: error: calling a private constructor of class 'QChar' package.remove( ' ' ); ^ /usr/include/qt5/QtCore/qchar.h:626:5: note: declared private here QChar(char c) noexcept; ^ /home/andrew/code/kuroo/trunk/src/core/global.cpp:45:25: error: calling a private constructor of class 'QChar' if ( package.contains( '/' ) ) { ^ /usr/include/qt5/QtCore/qchar.h:626:5: note: declared private here QChar(char c) noexcept; ^ /home/andrew/code/kuroo/trunk/src/core/global.cpp:46:28: error: calling a private constructor of class 'QString' list << package.section( "/", 0, 0 ); ^ /usr/include/qt5/QtCore/qstring.h:973:5: note: declared private here QString(const char *ch); ^ /home/andrew/code/kuroo/trunk/src/core/global.cpp:47:34: error: calling a private constructor of class 'QString' nameVersion = package.section( "/", 1, 1 ); ^ /usr/include/qt5/QtCore/qstring.h:973:5: note: declared private here QString(const char *ch); ^ /home/andrew/code/kuroo/trunk/src/core/global.cpp:60:39: error: calling a private constructor of class 'QString' list << nameVersion.section( name + "-", 1 ); ^ /usr/include/qt5/QtCore/qstring.h:973:5: note: declared private here QString(const char *ch); ^ 2 warnings and 11 errors generated. ``` -- You are receiving this mail because: You are watching all bug changes.