Kdevelop crashes when parsing some files with template functions. I cannot provide the source code for the file - it is proprietary. Reproducible: Always Steps to Reproduce: I cannot provide sample code to reproduce it , since I don't know how to isolate the affecting function. Any help? Backtrace (50 outermost frames): #104736 0x00007fffb5c91448 in Cpp::TemplateDeclaration::setSpecializedFrom (this=this@entry=0x7fff4c454328, other=0x7fff4d5e9eb8) at /home/mcencora/tmp/kdevelop/languages/cpp/cppduchain/templatedeclaration.cpp:391 #104737 0x00007fffb5c91448 in Cpp::TemplateDeclaration::setSpecializedFrom (this=this@entry=0x7fff4c454328, other=0x7fff4d5e9eb8) at /home/mcencora/tmp/kdevelop/languages/cpp/cppduchain/templatedeclaration.cpp:391 #104738 0x00007fffb5c91448 in Cpp::TemplateDeclaration::setSpecializedFrom (this=0x7fff4c454328, other=0x7fff4d5e9eb8) at /home/mcencora/tmp/kdevelop/languages/cpp/cppduchain/templatedeclaration.cpp:391 #104739 0x00007fffb5c5a38f in DeclarationBuilder::openDeclaration<KDevelop::FunctionDefinition> (this=this@entry=0x7fff61fbcb00, name=name@entry=0x7fff4d72c730, rangeNode=rangeNode@entry=0x7fff4d72c570, customName=..., collapseRangeAtStart=collapseRangeAtStart@entry=false, collapseRangeAtEnd=collapseRangeAtEnd@entry=false) at /home/mcencora/tmp/kdevelop/languages/cpp/cppduchain/declarationbuilder.cpp:656 #104740 0x00007fffb5c402dd in DeclarationBuilder::openFunctionDeclaration (this=this@entry=0x7fff61fbcb00, name=0x7fff4d72c730, rangeNode=rangeNode@entry=0x7fff4d72c570) at /home/mcencora/tmp/kdevelop/languages/cpp/cppduchain/declarationbuilder.cpp:867 #104741 0x00007fffb5c420ce in DeclarationBuilder::visitDeclarator (this=0x7fff61fbcb00, node=0x7fff4d72c570) at /home/mcencora/tmp/kdevelop/languages/cpp/cppduchain/declarationbuilder.cpp:497 #104742 0x00007fffb5c43e2b in DeclarationBuilder::visitFunctionDeclaration (this=0x7fff61fbcb00, node=0x7fff4d72dbc8) at /home/mcencora/tmp/kdevelop/languages/cpp/cppduchain/declarationbuilder.cpp:181 #104743 0x00007fffb5c30dcb in ContextBuilder::visitFunctionDefinition (this=0x7fff61fbcb00, node=0x7fff4d72dbc8) at /home/mcencora/tmp/kdevelop/languages/cpp/cppduchain/contextbuilder.cpp:577 #104744 0x00007fffb5c3115e in ContextBuilder::visitTemplateDeclaration (this=0x7fff61fbcb00, ast=0x7fff4d72dc28) at /home/mcencora/tmp/kdevelop/languages/cpp/cppduchain/contextbuilder.cpp:293 #104745 0x00007fffb598a111 in visitNodes<DeclarationAST*> (v=0x7fff61fbcb60, nodes=<optimized out>) at /home/mcencora/tmp/kdevelop/languages/cpp/parser/visitor.h:139 #104746 0x00007fffb5c32541 in KDevelop::AbstractContextBuilder<AST, NameAST>::supportBuild (this=0x7fff61fbcb00, node=0x7fff4d45c7c0, context=<optimized out>) at /usr/local/include/kdevplatform/language/duchain/builders/abstractcontextbuilder.h:133 #104747 0x00007fffb5c2dff6 in ContextBuilder::buildContexts (this=0x7fff61fbcb00, file=..., node=0x7fff4d45c7c0, includes=<optimized out>, updateContext=..., removeOldImports=false) at /home/mcencora/tmp/kdevelop/languages/cpp/cppduchain/contextbuilder.cpp:422 #104748 0x00007fffb5c3bc42 in DeclarationBuilder::buildDeclarations (this=<optimized out>, file=..., node=<optimized out>, includes=<optimized out>, updateContext=..., removeOldImports=false) at /home/mcencora/tmp/kdevelop/languages/cpp/cppduchain/declarationbuilder.cpp:96 #104749 0x00007fffb615c36c in CPPInternalParseJob::run (this=0x84d75d0) at /home/mcencora/tmp/kdevelop/languages/cpp/cppparsejob.cpp:644 #104750 0x00007fffec682e3a in ThreadWeaver::JobRunHelper::runTheJob (this=this@entry=0x7fff61fbcd50, th=th@entry=0x7fff58002e50, job=job@entry=0x84d75d0) at ../../../threadweaver/Weaver/Job.cpp:106 #104751 0x00007fffec682fb1 in ThreadWeaver::Job::execute (this=0x84d75d0, th=0x7fff58002e50) at ../../../threadweaver/Weaver/Job.cpp:135 #104752 0x00007fffec684e23 in ThreadWeaver::JobCollectionJobRunner::execute (this=0x5ee9820, t=0x7fff58002e50) at ../../../threadweaver/Weaver/JobCollection.cpp:82 #104753 0x00007fffec68260f in ThreadWeaver::ThreadRunHelper::run (this=this@entry=0x7fff61fbcdc0, parent=0xe52430, th=th@entry=0x7fff58002e50) at ../../../threadweaver/Weaver/Thread.cpp:95 #104754 0x00007fffec6826cb in ThreadWeaver::Thread::run (this=0x7fff58002e50) at ../../../threadweaver/Weaver/Thread.cpp:142 #104755 0x00007ffff5ce7bec in QThreadPrivate::start (arg=0x7fff58002e50) at thread/qthread_unix.cpp:338 #104756 0x00007ffff3adbf8e in start_thread (arg=0x7fff61fbd700) at pthread_create.c:311 #104757 0x00007ffff49ede1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
Created attachment 81450 [details] Example project triggering this crash The attached project allows to reproduce the problem. In the example project just copy/pasting the function worked for me, but as soon as I tried to edit the main.cpp further kdevelop crashed. In the real case where I encountered this KDevelop actually crashed already right after pasting the copy of the template specialization. Even though the current state of the main.cpp does not compile, KDevelop shouldn't crash here since its just an intermediate step when writing a new specialization for the template function.
Well turns out the second specialization does not even need to be using the same signature. The same issue occurs for me when changing the signature.
Git commit 61e585a694addd4c4850e6019244732a9bb4f307 by Andreas Pakulat. Committed on 31/07/2013 at 22:28. Pushed by apaku into branch '4.5'. Merge branch '318492/prevent_endless_recursion_setSpecializedFrom' into 4.5 REVIEW: 111796 http://commits.kde.org/kdevelop/61e585a694addd4c4850e6019244732a9bb4f307
*** Bug 328467 has been marked as a duplicate of this bug. ***