| Summary: | Kdevelop crashes when auto variable references std::unique_ptr::release | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | Rafał Malinowski <rafal.przemyslaw.malinowski> |
| Component: | Language Support: CPP (old) | Assignee: | kdevelop-bugs-null |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | crash | ||
| Priority: | NOR | ||
| Version First Reported In: | 4.5.1 | ||
| Target Milestone: | --- | ||
| Platform: | Ubuntu | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
Please provide a backtrace Here it is:
(gdb) backtrace
#0 KDevelop::AbstractType::makeDynamic (this=this@entry=0x0) at ../../language/duchain/types/abstracttype.cpp:35
#1 0x00007ffff1c32081 in d_func_dynamic (this=0x0) at ../../language/duchain/types/abstracttype.h:284
#2 KDevelop::AbstractType::setModifiers (this=0x0, modifiers=0) at ../../language/duchain/types/abstracttype.cpp:57
#3 0x00007fffc6909186 in TypeBuilder::createIntegralTypeForExpression (this=0x7ffee9cd9ad0, expression=<optimized out>)
at ../../../../languages/cpp/cppduchain/typebuilder.cpp:469
#4 0x00007fffc68da8fe in ContextBuilder::visitDeclarator (this=0x7ffee9cd9ad0, node=0x7ffee060ba08)
at ../../../../languages/cpp/cppduchain/contextbuilder.cpp:937
#5 0x00007fffc68ed275 in DeclarationBuilder::visitDeclarator (this=0x7ffee9cd9ad0, node=0x7ffee060ba08)
at ../../../../languages/cpp/cppduchain/declarationbuilder.cpp:532
#6 0x00007fffc68dbaf7 in ContextBuilder::visitInitDeclarator (this=this@entry=0x7ffee9cd9ad0, node=node@entry=0x7ffee060bdd0)
at ../../../../languages/cpp/cppduchain/contextbuilder.cpp:912
#7 0x00007fffc68e911f in DeclarationBuilder::visitInitDeclarator (this=0x7ffee9cd9ad0, node=0x7ffee060bdd0)
at ../../../../languages/cpp/cppduchain/declarationbuilder.cpp:256
#8 0x00007fffc690750c in TypeBuilder::visitSimpleDeclaration (this=this@entry=0x7ffee9cd9ad0, node=node@entry=0x7ffee060be10)
at ../../../../languages/cpp/cppduchain/typebuilder.cpp:672
#9 0x00007fffc68ebac8 in DeclarationBuilder::visitSimpleDeclaration (this=0x7ffee9cd9ad0, node=0x7ffee060be10)
at ../../../../languages/cpp/cppduchain/declarationbuilder.cpp:422
#10 0x00007fffc663a559 in visitNodes<StatementAST*> (nodes=<optimized out>, v=<optimized out>) at ../../../../languages/cpp/parser/visitor.h:139
#11 DefaultVisitor::visitCompoundStatement (this=this@entry=0x7ffee9cd9b30, node=node@entry=0x7ffee060b5a0)
at ../../../../languages/cpp/parser/default_visitor.cpp:73
#12 0x00007fffc68da7cc in ContextBuilder::visitCompoundStatement (this=0x7ffee9cd9ad0, node=0x7ffee060b5a0)
at ../../../../languages/cpp/cppduchain/contextbuilder.cpp:674
#13 0x00007fffc68da6ef in ContextBuilder::visitFunctionDefinition (this=0x7ffee9cd9ad0, node=0x7ffee060bfa8)
at ../../../../languages/cpp/cppduchain/contextbuilder.cpp:592
#14 0x00007fffc663ae39 in visitNodes<DeclarationAST*> (v=0x7ffee9cd9b30, nodes=<optimized out>) at ../../../../languages/cpp/parser/visitor.h:139
#15 0x00007fffc68dcdc9 in KDevelop::AbstractContextBuilder<AST, NameAST>::supportBuild (this=0x7ffee9cd9ad0, node=0x7ffee060a300, context=<optimized out>)
at /usr/include/kdevplatform/language/duchain/builders/abstractcontextbuilder.h:133
#16 0x00007fffc68dc32a in ContextBuilder::buildContexts (this=0x7ffee9cd9ad0, file=..., node=0x7ffee060a300, includes=<optimized out>, updateContext=...,
removeOldImports=removeOldImports@entry=false) at ../../../../languages/cpp/cppduchain/contextbuilder.cpp:422
#17 0x00007fffc68e7c12 in DeclarationBuilder::buildDeclarations (this=this@entry=0x7ffee9cd9ad0, file=..., node=node@entry=0x7ffee060a300,
includes=includes@entry=0x7ffee9cd9830, updateContext=..., removeOldImports=removeOldImports@entry=false)
at ../../../../languages/cpp/cppduchain/declarationbuilder.cpp:96
#18 0x00007fffc6dfb27a in CPPInternalParseJob::run (this=<optimized out>) at ../../../languages/cpp/cppparsejob.cpp:644
#19 0x00007fffec638cb2 in ThreadWeaver::JobRunHelper::runTheJob (this=this@entry=0x7ffee9cd9d50, th=th@entry=0x35e7990, job=job@entry=0x41daf00)
at ../../../threadweaver/Weaver/Job.cpp:106
#20 0x00007fffec638e6e in ThreadWeaver::Job::execute (this=0x41daf00, th=0x35e7990) at ../../../threadweaver/Weaver/Job.cpp:135
#21 0x00007fffec63a90b in ThreadWeaver::JobCollectionJobRunner::execute (this=0x9072f0, t=0x35e7990) at ../../../threadweaver/Weaver/JobCollection.cpp:82
#22 0x00007fffec6386bb in ThreadWeaver::Thread::run (this=0x35e7990) at ../../../threadweaver/Weaver/Thread.cpp:108
#23 0x00007ffff5ce0f2f in QThreadPrivate::start (arg=0x35e7990) at thread/qthread_unix.cpp:338
#24 0x00007ffff3ac4f6e in start_thread (arg=0x7ffee9cda700) at pthread_create.c:311
fixed for kdev 4.5.2 and 4.6 (I'll announce the former officially now). cheers *** This bug has been marked as a duplicate of bug 318972 *** |
I use C++11 features. auto combined with std::unique_ptr::release results in crash. Reproducible: Always Steps to Reproduce: 1. Create C++/CMake project from template 2. Update CMakeLists.txt to allow C++11: project(auto_crash) set (CXX_FLAGS "-std=c++0x") set_property (SOURCE main.cpp APPEND_STRING PROPERTY COMPILE_FLAGS " ${CXX_FLAGS}") add_executable(auto_crash main.cpp) install(TARGETS auto_crash RUNTIME DESTINATION bin) 3. Write following code in main.cpp: #include <iostream> #include <memory> std::unique_ptr<int> get_int() { return std::unique_ptr<int>(new int(12)); } int main(int argc, char **argv) { std::cout << "Hello, world!" << std::endl; auto x = get_int().release(); return x; } Actual Results: KDevelop crashes on auto x = get_int().release(); line Expected Results: KDevelop does not crash