gcc-5 warns: In file included from /usr/include/kdevplatform/language/duchain/topducontext.h:24:0, from /usr/include/kdevplatform/language/duchain/parsingenvironment.h:32, from /var/tmp/portage/dev-util/kdevelop-4.7.1/work/kdevelop-4.7.1/languages/cpp/cppduchain/cpppreprocessenvironment.h:17, from /var/tmp/portage/dev-util/kdevelop-4.7.1/work/kdevelop-4.7.1/languages/cpp/cppduchain/cpppreprocessenvironment.cpp:14: /usr/include/kdevplatform/language/util/setrepository.h: In instantiation of ‘const T& Utils::ConvenientIterator<T, Conversion>::ref() const [with T = KDevelop::IndexedString ; Conversion = Cpp::IndexedStringConversion]’: /var/tmp/portage/dev-util/kdevelop-4.7.1/work/kdevelop-4.7.1/languages/cpp/cppduchain/cpppreprocessenvironment.cpp:120:36: required from here /usr/include/kdevplatform/language/util/setrepository.h:57:38: warning: returning reference to temporary [-Wreturn-local-addr] return Conversion::toItem(*m_it); In file included from /usr/include/kdevplatform/language/duchain/topducontext.h:24:0, from /usr/include/kdevplatform/language/duchain/parsingenvironment.h:32, from /var/tmp/portage/dev-util/kdevelop-4.7.1/work/kdevelop-4.7.1/languages/cpp/cppduchain/environmentmanager.h:23, from /var/tmp/portage/dev-util/kdevelop-4.7.1/work/kdevelop-4.7.1/languages/cpp/cppduchain/environmentmanager.cpp:14: /usr/include/kdevplatform/language/util/setrepository.h: In instantiation of ‘const T& Utils::ConvenientIterator<T, Conversion>::ref() const [with T = KDevelop::IndexedString ; Conversion = Cpp::IndexedStringConversion]’: /var/tmp/portage/dev-util/kdevelop-4.7.1/work/kdevelop-4.7.1/languages/cpp/cppduchain/environmentmanager.cpp:235:48: required from here /usr/include/kdevplatform/language/util/setrepository.h:57:38: warning: returning reference to temporary [-Wreturn-local-addr] return Conversion::toItem(*m_it); The resulting binary crashes. Reproducible: Always
Please get a backtrace of the crash. Is it related to warning? That warning was spit out since forever, it's legacy code.
(In reply to Kevin Funk from comment #1) > Please get a backtrace of the crash. Is it related to warning? Yes it is: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fff4bfff700 (LWP 3227)] QHash<KDevelop::IndexedString, QHashDummyValue>::findNode (this=this@entry=0x7fff44003b80, akey=..., ahp=ahp@entry=0x7fff4bffd630) at /usr/include/qt4/QtCore/qhash.h:882 882 uint h = qHash(akey); (gdb) bt #0 QHash<KDevelop::IndexedString, QHashDummyValue>::findNode (this=this@entry=0x7fff44003b80, akey=..., ahp=ahp@entry=0x7fff4bffd630) at /usr/include/qt4/QtCore/qhash.h:882 #1 0x00007fff68421d71 in insert (avalue=..., akey=..., this=0x7fff44003b80) at /usr/include/qt4/QtCore/qhash.h:759 #2 insert (value=..., this=0x7fff44003b80) at /usr/include/qt4/QtCore/qset.h:181 #3 CppPreprocessEnvironment::merge (this=0x7fff44003b50, file=0x7fff44017820, mergeEnvironment=mergeEnvironment@entry=true) at /var/tmp/portage/dev-util/kdevelop-4.7.1/work/kdevelop-4.7.1/languages/cpp/cppduchain/cpppreprocessenvironment.cpp:120 #4 0x00007fff684f0334 in PreprocessJob::sourceNeeded (this=0xa4ff50, _fileName=..., type=<optimized out>, sourceLine=19, skipCurrentPath=<optimized out>) at /var/tmp/portage/dev-util/kdevelop-4.7.1/work/kdevelop-4.7.1/languages/cpp/preprocessjob.cpp:547 #5 0x00007fff682ec17c in rpp::pp::handle_include (this=this@entry=0x7fff4bffdcc0, skip_current_path=<optimized out>, input=..., output=...) at /var/tmp/portage/dev-util/kdevelop-4.7.1/work/kdevelop-4.7.1/languages/cpp/parser/rpp/pp-engine.cpp:219 #6 0x00007fff682f0287 in rpp::pp::handle_directive (this=this@entry=0x7fff4bffdcc0, directive=directive@entry=76067, input=..., output=...) at /var/tmp/portage/dev-util/kdevelop-4.7.1/work/kdevelop-4.7.1/languages/cpp/parser/rpp/pp-engine.cpp:137 #7 0x00007fff682f082c in rpp::pp::operator() (this=this@entry=0x7fff4bffdcc0, input=..., output=...) at /var/tmp/portage/dev-util/kdevelop-4.7.1/work/kdevelop-4.7.1/languages/cpp/parser/rpp/pp-engine.cpp:272 #8 0x00007fff682f0b13 in rpp::pp::processFileInternal (this=this@entry=0x7fff4bffdcc0, fileName=..., fileContents=..., result=...) at /var/tmp/portage/dev-util/kdevelop-4.7.1/work/kdevelop-4.7.1/languages/cpp/parser/rpp/pp-engine.cpp:98 #9 0x00007fff682f0ea5 in rpp::pp::processFile (this=this@entry=0x7fff4bffdcc0, fileName=..., data=...) at /var/tmp/portage/dev-util/kdevelop-4.7.1/work/kdevelop-4.7.1/languages/cpp/parser/rpp/pp-engine.cpp:85 #10 0x00007fff684f2bac in PreprocessJob::run (this=<optimized out>) at /var/tmp/portage/dev-util/kdevelop-4.7.1/work/kdevelop-4.7.1/languages/cpp/preprocessjob.cpp:249 #11 0x00007ffff1837162 in ThreadWeaver::JobRunHelper::runTheJob(ThreadWeaver::Thread*, ThreadWeaver::Job*) () from /usr/lib/libthreadweaver.so.4 #12 0x00007ffff183735e in ThreadWeaver::Job::execute(ThreadWeaver::Thread*) () from /usr/lib/libthreadweaver.so.4 #13 0x00007ffff1838fdb in ThreadWeaver::JobCollectionJobRunner::execute(ThreadWeaver::Thread*) () from /usr/lib/libthreadweaver.so.4 #14 0x00007ffff183699b in ThreadWeaver::Thread::run() () from /usr/lib/libthreadweaver.so.4 #15 0x00007ffff5c464fc in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4 #16 0x00007ffff4a953e6 in start_thread () from /lib/libpthread.so.0 #17 0x00007ffff57a26cd in clone () from /lib/libc.so.6
Is this reproducible? If yes, please tell us how to reproduce. And/or try to fix the warning and check if that solves the issue for you. That would be greatly appreciated.
(In reply to Kevin Funk from comment #3) > Is this reproducible? If yes, please tell us how to reproduce. Yes. Just compile Kdevelop with gcc-5 and then open a C++ file with it. Kdevelop will crash almost immediately. > And/or try to fix the warning and check if that solves the issue for you. > That would be greatly appreciated. Will look into this next week.
Never seen this, I assume it's fixed by now, if not please reopen.