Bug 352211 - Crashes when including non-sense (here: plugins.qmltypes) [Cpp::EnvironmentFile::identityOffset (this=0x0)]
Summary: Crashes when including non-sense (here: plugins.qmltypes) [Cpp::EnvironmentFi...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-03 11:36 UTC by Kevin Funk
Modified: 2016-03-09 08:03 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Funk 2015-09-03 11:36:28 UTC
Accidentally includes plugins.qmltypes into a source file => oldcpp sometimes(?) crashes:

logger.h is a file I added to reproduce this; it's contents:
---
#ifndef LOGGER_H
#define LOGGER_H

#include <../../home/kfunk/devel/build/qt5.4/qtbase/qml/QtQuick.2/plugins.qmltypes>

class Logger : public QObject
{
    Q_OBJECT

private:
};

#endif // LOGGER_H
---

Backtrace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffacbdf700 (LWP 11749)]
0x00007ffff3755cf2 in KDevelop::ParsingEnvironmentFile::d_func (this=0x0) at /home/kfunk/devel/src/kf5/kdevplatform/language/duchain/parsingenvironment.h:209
(gdb) bt
#0  0x00007ffff3755cf2 in KDevelop::ParsingEnvironmentFile::d_func (this=0x0) at /home/kfunk/devel/src/kf5/kdevplatform/language/duchain/parsingenvironment.h:209
#1  0x00007ffff37eda20 in KDevelop::ParsingEnvironmentFile::indexedTopContext (this=0x0) at /home/kfunk/devel/src/kf5/kdevplatform/language/duchain/parsingenvironment.cpp:106
#2  0x00007fffa751fed9 in Cpp::EnvironmentFile::identityOffset (this=0x0) at /home/kfunk/devel/src/kf5/kdevelop/languages/cpp/cppduchain/environmentmanager.cpp:608
#3  0x00007fffac307c05 in PreprocessJob::headerSectionEndedInternal (this=0x7fffa93c4180, stream=0x7fffacbdbff0) at /home/kfunk/devel/src/kf5/kdevelop/languages/cpp/preprocessjob.cpp:370
#4  0x00007fffac307667 in PreprocessJob::headerSectionEnded (this=0x7fffa93c4180, stream=...) at /home/kfunk/devel/src/kf5/kdevelop/languages/cpp/preprocessjob.cpp:319
#5  0x00007fffac296a54 in rpp::pp_macro_expander::operator() (this=0x7fffacbdc208, input=..., output=..., substitute=false, table=0x0) at /home/kfunk/devel/src/kf5/kdevelop/languages/cpp/parser/rpp/pp-macro-expander.cpp:312
#6  0x00007fffac2a2bed in rpp::pp::operator() (this=0x7fffacbdc200, input=..., output=...) at /home/kfunk/devel/src/kf5/kdevelop/languages/cpp/parser/rpp/pp-engine.cpp:289
#7  0x00007fffac2a1868 in rpp::pp::processFileInternal (this=0x7fffacbdc200, fileName="/home/kfunk/devel/build/qt5.4/qtbase/qml/QtQuick.2/plugins.qmltypes", fileContents="import QtQuick.tooling 1.1\n\n// This file describes the plugin-su
pplied types contained in the library.\n// It is used for QML tooling purposes only.\n//\n// This file was auto-generated by:\n// 'qmlplugin"... = {...}, result=<empty>) at /home/kfunk/devel/src/kf5/kdevelop/languages/cpp/parser/rpp/pp-e
ngine.cpp:100
#8  0x00007fffac2a16fd in rpp::pp::processFile (this=0x7fffacbdc200, fileName="/home/kfunk/devel/build/qt5.4/qtbase/qml/QtQuick.2/plugins.qmltypes", data="import QtQuick.tooling 1.1\n\n// This file describes the plugin-supplied types con
tained in the library.\n// It is used for QML tooling purposes only.\n//\n// This file was auto-generated by:\n// 'qmlplugin"... = {...}) at /home/kfunk/devel/src/kf5/kdevelop/languages/cpp/parser/rpp/pp-engine.cpp:87
#9  0x00007fffac306c02 in PreprocessJob::run (this=0x7fffa93c4180, self=..., thread=0x0) at /home/kfunk/devel/src/kf5/kdevelop/languages/cpp/preprocessjob.cpp:249
#10 0x00007fffebe779f7 in ThreadWeaver::Executor::run (this=0x7fffec093630 <ThreadWeaver::Private::defaultExecutor>, job=..., thread=0x0) at /home/kfunk/devel/src/kf5/threadweaver/src/executor.cpp:52
#11 0x00007fffebe7684d in ThreadWeaver::Private::DefaultExecutor::execute (this=0x7fffec093630 <ThreadWeaver::Private::defaultExecutor>, job=..., thread=0x0) at /home/kfunk/devel/src/kf5/threadweaver/src/job_p.cpp:70
#12 0x00007fffebe77c54 in ThreadWeaver::ExecuteWrapper::executeWrapped (this=0x7fffa849bcb8, job=..., thread=0x0) at /home/kfunk/devel/src/kf5/threadweaver/src/executewrapper.cpp:64
#13 0x00007fffebe767b9 in ThreadWeaver::Private::DebugExecuteWrapper::execute (this=0x7fffa849bcb8, job=..., th=0x0) at /home/kfunk/devel/src/kf5/threadweaver/src/job_p.cpp:58
#14 0x00007fffebe75450 in ThreadWeaver::Job::execute (this=0x7fffa93c4180, self=..., th=0x0) at /home/kfunk/devel/src/kf5/threadweaver/src/job.cpp:83
#15 0x00007fffebe7568f in ThreadWeaver::Job::blockingExecute (this=0x7fffa93c4180) at /home/kfunk/devel/src/kf5/threadweaver/src/job.cpp:104
(gdb) 0x7fffa931fde0) at /home/kfunk/devel/src/kf5/kdevelop/languages/cpp/cppparsejob.cpp:177
#17 0x00007fffac3092f9 in PreprocessJob::sourceNeeded (this=0x2499490, fileName="../../home/kfunk/devel/build/qt5.4/qtbase/qml/QtQuick.2/plugins.qmltypes", type=rpp::Preprocessor::IncludeGlobal, sourceLine=0, skipCurrentPath=false) at /h
ome/kfunk/devel/src/kf5/kdevelop/languages/cpp/preprocessjob.cpp:580
#18 0x00007fffac2a27a5 in rpp::pp::handle_include (this=0x7fffacbddb20, skip_current_path=false, input=..., output=...) at /home/kfunk/devel/src/kf5/kdevelop/languages/cpp/parser/rpp/pp-engine.cpp:221
#19 0x00007fffac2a1e3b in rpp::pp::handle_directive (this=0x7fffacbddb20, directive=506539, input=..., output=...) at /home/kfunk/devel/src/kf5/kdevelop/languages/cpp/parser/rpp/pp-engine.cpp:139
#20 0x00007fffac2a2acb in rpp::pp::operator() (this=0x7fffacbddb20, input=..., output=...) at /home/kfunk/devel/src/kf5/kdevelop/languages/cpp/parser/rpp/pp-engine.cpp:274
#21 0x00007fffac2a1868 in rpp::pp::processFileInternal (this=0x7fffacbddb20, fileName="/home/kfunk/devel/src/kf5/kdevelop/languages/cpp/tests/cpptestfiles/logger.h", fileContents="#include <../../home/kfunk/devel/build/qt5.4/qtbase/qml/Q
tQuick.2/plugins.qmltypes>\n\000\000\000" = {...}, result=<empty>) at /home/kfunk/devel/src/kf5/kdevelop/languages/cpp/parser/rpp/pp-engine.cpp:100
#22 0x00007fffac2a16fd in rpp::pp::processFile (this=0x7fffacbddb20, fileName="/home/kfunk/devel/src/kf5/kdevelop/languages/cpp/tests/cpptestfiles/logger.h", data="#include <../../home/kfunk/devel/build/qt5.4/qtbase/qml/QtQuick.2/plugins
.qmltypes>\n\000\000\000" = {...}) at /home/kfunk/devel/src/kf5/kdevelop/languages/cpp/parser/rpp/pp-engine.cpp:87
#23 0x00007fffac306c02 in PreprocessJob::run (this=0x2499490, self=..., thread=0x24954b0) at /home/kfunk/devel/src/kf5/kdevelop/languages/cpp/preprocessjob.cpp:249
#24 0x00007fffebe779f7 in ThreadWeaver::Executor::run (this=0x7fffec093630 <ThreadWeaver::Private::defaultExecutor>, job=..., thread=0x24954b0) at /home/kfunk/devel/src/kf5/threadweaver/src/executor.cpp:52
#25 0x00007fffebe7684d in ThreadWeaver::Private::DefaultExecutor::execute (this=0x7fffec093630 <ThreadWeaver::Private::defaultExecutor>, job=..., thread=0x24954b0) at /home/kfunk/devel/src/kf5/threadweaver/src/job_p.cpp:70
#26 0x00007fffebe77c54 in ThreadWeaver::ExecuteWrapper::executeWrapped (this=0x129ff68, job=..., thread=0x24954b0) at /home/kfunk/devel/src/kf5/threadweaver/src/executewrapper.cpp:64
#27 0x00007fffebe767b9 in ThreadWeaver::Private::DebugExecuteWrapper::execute (this=0x129ff68, job=..., th=0x24954b0) at /home/kfunk/devel/src/kf5/threadweaver/src/job_p.cpp:58
#28 0x00007fffebe77c54 in ThreadWeaver::ExecuteWrapper::executeWrapped (this=0x618dd50, job=..., thread=0x24954b0) at /home/kfunk/devel/src/kf5/threadweaver/src/executewrapper.cpp:64
#29 0x00007fffebe77bdf in ThreadWeaver::ExecuteWrapper::execute (this=0x618dd50, job=..., thread=0x24954b0) at /home/kfunk/devel/src/kf5/threadweaver/src/executewrapper.cpp:57
#30 0x00007fffebe75450 in ThreadWeaver::Job::execute (this=0x2499490, self=..., th=0x24954b0) at /home/kfunk/devel/src/kf5/threadweaver/src/job.cpp:83
#31 0x00007fffebe74bbe in ThreadWeaver::Thread::run (this=0x24954b0) at /home/kfunk/devel/src/kf5/threadweaver/src/thread.cpp:114
#32 0x00007ffff58fb48e in QThreadPrivate::start (arg=0x24954b0) at /home/kfunk/devel/src/qt5.4/qtbase/src/corelib/thread/qthread_unix.cpp:337
#33 0x00007fffeec766aa in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#34 0x00007ffff5210eed in clone () from /lib/x86_64-linux-gnu/libc.so.6

Reproducible: Sometimes
Comment 1 Kevin Funk 2016-03-09 08:03:55 UTC
Should be fixed with the switch to the Clang backend in 5.0.