Bug 376586 - Kdevelop crashes during parsing on large PHP projects/files [DeclarationBuilder::inferArgumentsFromCall]
Summary: Kdevelop crashes during parsing on large PHP projects/files [DeclarationBuild...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: QML/JavaScript (show other bugs)
Version: 5.0.4
Platform: Arch Linux Linux
: HI crash
Target Milestone: 5.1.0
Assignee: kdevelop-bugs-null
URL:
Keywords: release_blocker
Depends on:
Blocks:
 
Reported: 2017-02-17 16:49 UTC by robert
Modified: 2017-03-12 21:30 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.1.0


Attachments
crash log (83.53 KB, text/plain)
2017-02-17 16:49 UTC, robert
Details
crash log for kdevelop 5.0.4 (rebuilt with makepkg options=(debug !strip) ) (81.52 KB, text/plain)
2017-03-05 15:21 UTC, robert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description robert 2017-02-17 16:49:14 UTC
Created attachment 104074 [details]
crash log

Application: kdevelop (5.0.3)

Qt Version: 5.8.0
Frameworks Version: 5.31.0
Operating System: Linux 4.9.8-1-ARCH x86_64
Distribution (Platform): Archlinux Packages

-- Information about the crash:
- What I was doing when the application crashed:

Each time opening the session containing this project KDevelop crashes after some seconds OR when background parser is turned off KDevelop crashes a few seconds after the background parser is enabled
Project contains about 7100 files (most of then PHP and JS), files up to 80000 lines of code


Background parser is set to:

9 Threads with 500ms delay


Kdevelop-PHP 5.0.3/glibc 2.24

The crash can be reproduced every time.
Comment 1 Kevin Funk 2017-02-17 20:26:53 UTC
Crash inside the QML/JS parser plugin:

Thread 10 (Thread 0x7fe1abfff700 (LWP 1979)):
[KCrash Handler]
#6  0x00007fe1a8b3d11a in  () at /usr/lib/qt/plugins/kdevplatform/25/kdevqmljslanguagesupport.so
#7  0x00007fe1a8b3d691 in  () at /usr/lib/qt/plugins/kdevplatform/25/kdevqmljslanguagesupport.so
#8  0x00007fe1a8b6c038 in  () at /usr/lib/qt/plugins/kdevplatform/25/kdevqmljslanguagesupport.so
#9  0x00007fe1a8b6db3c in  () at /usr/lib/qt/plugins/kdevplatform/25/kdevqmljslanguagesupport.so
#10 0x00007fe1a8b3b37c in  () at /usr/lib/qt/plugins/kdevplatform/25/kdevqmljslanguagesupport.so
#11 0x00007fe1a8b3db5a in  () at /usr/lib/qt/plugins/kdevplatform/25/kdevqmljslanguagesupport.so


Could you please try to instal debugging symbols for this plugin and try to reproduce the crash? Please send the backtrace another time.

See: https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
Comment 2 robert 2017-02-17 21:25:26 UTC
I will try without rebuilding my whole dev space.
Comment 3 robert 2017-03-05 15:21:10 UTC
Created attachment 104379 [details]
crash log for kdevelop 5.0.4 (rebuilt with makepkg options=(debug !strip) )
Comment 4 robert 2017-03-05 15:21:29 UTC
latest build still crashing (kdevelop 5.0.4)
Comment 5 Kevin Funk 2017-03-05 17:17:05 UTC
@robert: Is that project public so we can try to reproduce ourselves?

If not, could you please post the ~100 last lines of the stdout/stderr KDevelop before it crashes? It should tell which file it currently tries to parse (that's an indicator which file to send us for a minimal working example).
Comment 6 Kevin Funk 2017-03-05 17:18:22 UTC
Pasting backtrace of crashing thread inline to make it appear in searches:

Thread 11 (Thread 0x7fec7a194700 (LWP 17234)):
[KCrash Handler]
#6  0x00007fec64cdb7a7 in DeclarationBuilder::inferArgumentsFromCall(QmlJS::AST::Node*, QmlJS::AST::ArgumentList*) (this=0x7fec7a193bc0, base=<optimized out>, arguments=0x7fec61703338) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/declarationbuilder.cpp:338
#7  0x00007fec64cdbd61 in DeclarationBuilder::visit(QmlJS::AST::CallExpression*) (this=<optimized out>, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/declarationbuilder.cpp:474
#8  0x00007fec64d06fb0 in QmlJS::AST::CallExpression::accept0(QmlJS::AST::Visitor*) (this=0x7fec61703440, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:301
#9  0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec61703440, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#10 0x00007fec64cd95ff in ContextBuilder::findType(QmlJS::AST::Node*) (this=this@entry=0x7fec7a193bc0, node=0x7fec61703440) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/contextbuilder.cpp:61
#11 0x00007fec64cdc2aa in DeclarationBuilder::visit(QmlJS::AST::ReturnStatement*) (this=0x7fec7a193bc0, node=0x7fec61703480) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/declarationbuilder.cpp:277
#12 0x00007fec64d07e58 in QmlJS::AST::ReturnStatement::accept0(QmlJS::AST::Visitor*) (this=0x7fec61703480, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:611
#13 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec61703480, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#14 0x00007fec64d08733 in QmlJS::AST::Node::accept(QmlJS::AST::Node*, QmlJS::AST::Visitor*) (visitor=0x7fec7a193c18, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#15 0x00007fec64d08733 in QmlJS::AST::StatementSourceElement::accept0(QmlJS::AST::Visitor*) (this=0x7fec617034b8, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:796
#16 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec617034b8, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#17 0x00007fec64d08649 in QmlJS::AST::Node::accept(QmlJS::AST::Node*, QmlJS::AST::Visitor*) (visitor=0x7fec7a193c18, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#18 0x00007fec64d08649 in QmlJS::AST::SourceElements::accept0(QmlJS::AST::Visitor*) (this=0x7fec617034d0, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:777
#19 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec617034d0, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#20 0x00007fec64d08563 in QmlJS::AST::Node::accept(QmlJS::AST::Node*, QmlJS::AST::Visitor*) (visitor=0x7fec7a193c18, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#21 0x00007fec64d08563 in QmlJS::AST::FunctionBody::accept0(QmlJS::AST::Visitor*) (this=0x7fec617034f0, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:758
#22 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec617034f0, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#23 0x00007fec64d08dca in QmlJS::AST::Node::accept(QmlJS::AST::Node*, QmlJS::AST::Visitor*) (node=<optimized out>, visitor=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#24 0x00007fec64ce3dc9 in DeclarationBuilder::declareFunction<QmlJS::FunctionDeclaration>(QmlJS::AST::Node*, bool, KDevelop::QualifiedIdentifier const&, KDevelop::RangeInRevision const&, QmlJS::AST::Node*, KDevelop::RangeInRevision const&, QmlJS::AST::Node*, KDevelop::RangeInRevision const&) (this=this@entry=0x7fec7a193bc0, node=node@entry=0x7fec61703508, newPrototypeContext=newPrototypeContext@entry=false, name=..., nameRange=..., parameters=parameters@entry=0x0, parametersRange=..., body=0x7fec617034f0, bodyRange=...) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/declarationbuilder.cpp:192
#25 0x00007fec64cdd22c in DeclarationBuilder::visit(QmlJS::AST::FunctionExpression*) (this=0x7fec7a193bc0, node=0x7fec61703508) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/declarationbuilder.cpp:252
#26 0x00007fec64d08510 in QmlJS::AST::FunctionExpression::accept0(QmlJS::AST::Visitor*) (this=0x7fec61703508, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:738
#27 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec61703508, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#28 0x00007fec64cd95ff in ContextBuilder::findType(QmlJS::AST::Node*) (this=this@entry=0x7fec7a193bc0, node=0x7fec61703508) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/contextbuilder.cpp:61
#29 0x00007fec64ce0003 in DeclarationBuilder::visit(QmlJS::AST::PropertyNameAndValue*) (this=0x7fec7a193bc0, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/declarationbuilder.cpp:650
#30 0x00007fec64d06c00 in QmlJS::AST::PropertyNameAndValue::accept0(QmlJS::AST::Visitor*) (this=0x7fec61703598, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:207
#31 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec61703598, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#32 0x00007fec64d06cf9 in QmlJS::AST::Node::accept(QmlJS::AST::Node*, QmlJS::AST::Visitor*) (visitor=0x7fec7a193c18, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#33 0x00007fec64d06cf9 in QmlJS::AST::PropertyAssignmentList::accept0(QmlJS::AST::Visitor*) (this=0x7fec616edc70, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:230
#34 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec616edc70, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#35 0x00007fec64d06ac3 in QmlJS::AST::Node::accept(QmlJS::AST::Node*, QmlJS::AST::Visitor*) (visitor=0x7fec7a193c18, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#36 0x00007fec64d06ac3 in QmlJS::AST::ObjectLiteral::accept0(QmlJS::AST::Visitor*) (this=0x7fec6170aa48, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:178
#37 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec6170aa48, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#38 0x00007fec64cd95ff in ContextBuilder::findType(QmlJS::AST::Node*) (this=this@entry=0x7fec7a193bc0, node=0x7fec6170aa48) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/contextbuilder.cpp:61
#39 0x00007fec64cdb9ab in DeclarationBuilder::inferArgumentsFromCall(QmlJS::AST::Node*, QmlJS::AST::ArgumentList*) (this=0x7fec7a193bc0, base=<optimized out>, arguments=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/declarationbuilder.cpp:359
#40 0x00007fec64cdbd61 in DeclarationBuilder::visit(QmlJS::AST::CallExpression*) (this=<optimized out>, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/declarationbuilder.cpp:474
#41 0x00007fec64d06fb0 in QmlJS::AST::CallExpression::accept0(QmlJS::AST::Visitor*) (this=0x7fec6170ab00, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:301
#42 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec6170ab00, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#43 0x00007fec64d07963 in QmlJS::AST::Node::accept(QmlJS::AST::Node*, QmlJS::AST::Visitor*) (visitor=0x7fec7a193c18, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#44 0x00007fec64d07963 in QmlJS::AST::ExpressionStatement::accept0(QmlJS::AST::Visitor*) (this=0x7fec6170ab40, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:510
#45 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec6170ab40, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#46 0x00007fec64d08733 in QmlJS::AST::Node::accept(QmlJS::AST::Node*, QmlJS::AST::Visitor*) (visitor=0x7fec7a193c18, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#47 0x00007fec64d08733 in QmlJS::AST::StatementSourceElement::accept0(QmlJS::AST::Visitor*) (this=0x7fec6170ab68, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:796
#48 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec6170ab68, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#49 0x00007fec64d08649 in QmlJS::AST::Node::accept(QmlJS::AST::Node*, QmlJS::AST::Visitor*) (visitor=0x7fec7a193c18, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#50 0x00007fec64d08649 in QmlJS::AST::SourceElements::accept0(QmlJS::AST::Visitor*) (this=0x7fec60cb5348, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:777
#51 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec60cb5348, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#52 0x00007fec64d08563 in QmlJS::AST::Node::accept(QmlJS::AST::Node*, QmlJS::AST::Visitor*) (visitor=0x7fec7a193c18, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#53 0x00007fec64d08563 in QmlJS::AST::FunctionBody::accept0(QmlJS::AST::Visitor*) (this=0x7fec6171d570, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:758
#54 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec6171d570, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#55 0x00007fec64d08dca in QmlJS::AST::Node::accept(QmlJS::AST::Node*, QmlJS::AST::Visitor*) (node=<optimized out>, visitor=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#56 0x00007fec64ce3dc9 in DeclarationBuilder::declareFunction<QmlJS::FunctionDeclaration>(QmlJS::AST::Node*, bool, KDevelop::QualifiedIdentifier const&, KDevelop::RangeInRevision const&, QmlJS::AST::Node*, KDevelop::RangeInRevision const&, QmlJS::AST::Node*, KDevelop::RangeInRevision const&) (this=this@entry=0x7fec7a193bc0, node=node@entry=0x7fec6171d588, newPrototypeContext=newPrototypeContext@entry=false, name=..., nameRange=..., parameters=parameters@entry=0x7fec60cb4990, parametersRange=..., body=0x7fec6171d570, bodyRange=...) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/declarationbuilder.cpp:192
#57 0x00007fec64cdd22c in DeclarationBuilder::visit(QmlJS::AST::FunctionExpression*) (this=0x7fec7a193bc0, node=0x7fec6171d588) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/declarationbuilder.cpp:252
#58 0x00007fec64d08510 in QmlJS::AST::FunctionExpression::accept0(QmlJS::AST::Visitor*) (this=0x7fec6171d588, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:738
#59 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec6171d588, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#60 0x00007fec64d069c3 in QmlJS::AST::Node::accept(QmlJS::AST::Node*, QmlJS::AST::Visitor*) (visitor=0x7fec7a193c18, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#61 0x00007fec64d069c3 in QmlJS::AST::NestedExpression::accept0(QmlJS::AST::Visitor*) (this=0x7fec6171d618, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:96
#62 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec6171d618, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#63 0x00007fec64cd95ff in ContextBuilder::findType(QmlJS::AST::Node*) (this=this@entry=0x7fec7a193bc0, node=0x7fec6171d618) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/contextbuilder.cpp:61
#64 0x00007fec64cddbb0 in DeclarationBuilder::visit(QmlJS::AST::FieldMemberExpression*) (this=0x7fec7a193bc0, node=0x7fec6171d650) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/declarationbuilder.cpp:541
#65 0x00007fec64d06e28 in QmlJS::AST::FieldMemberExpression::accept0(QmlJS::AST::Visitor*) (this=0x7fec6171d650, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:273
#66 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec6171d650, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#67 0x00007fec64cd95ff in ContextBuilder::findType(QmlJS::AST::Node*) (this=this@entry=0x7fec7a193bc0, node=0x7fec6171d650) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/contextbuilder.cpp:61
#68 0x00007fec64cdb700 in DeclarationBuilder::inferArgumentsFromCall(QmlJS::AST::Node*, QmlJS::AST::ArgumentList*) (this=0x7fec7a193bc0, base=<optimized out>, arguments=0x7fec6171d6b8) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/declarationbuilder.cpp:323
#69 0x00007fec64cdbd61 in DeclarationBuilder::visit(QmlJS::AST::CallExpression*) (this=<optimized out>, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/declarationbuilder.cpp:474
#70 0x00007fec64d06fb0 in QmlJS::AST::CallExpression::accept0(QmlJS::AST::Visitor*) (this=0x7fec6171d6e8, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:301
#71 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec6171d6e8, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#72 0x00007fec64d07963 in QmlJS::AST::Node::accept(QmlJS::AST::Node*, QmlJS::AST::Visitor*) (visitor=0x7fec7a193c18, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#73 0x00007fec64d07963 in QmlJS::AST::ExpressionStatement::accept0(QmlJS::AST::Visitor*) (this=0x7fec6171d728, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:510
#74 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec6171d728, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#75 0x00007fec64d08733 in QmlJS::AST::Node::accept(QmlJS::AST::Node*, QmlJS::AST::Visitor*) (visitor=0x7fec7a193c18, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#76 0x00007fec64d08733 in QmlJS::AST::StatementSourceElement::accept0(QmlJS::AST::Visitor*) (this=0x7fec6171d750, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:796
#77 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec6171d750, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#78 0x00007fec64d08649 in QmlJS::AST::Node::accept(QmlJS::AST::Node*, QmlJS::AST::Visitor*) (visitor=0x7fec7a193c18, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#79 0x00007fec64d08649 in QmlJS::AST::SourceElements::accept0(QmlJS::AST::Visitor*) (this=0x7fec6365ed88, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:777
#80 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec6365ed88, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#81 0x00007fec64d085d3 in QmlJS::AST::Node::accept(QmlJS::AST::Node*, QmlJS::AST::Visitor*) (visitor=0x7fec7a193c18, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#82 0x00007fec64d085d3 in QmlJS::AST::Program::accept0(QmlJS::AST::Visitor*) (this=0x7fec63c00c10, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:767
#83 0x00007fec64d0694c in QmlJS::AST::Node::accept(QmlJS::AST::Visitor*) (this=0x7fec63c00c10, visitor=0x7fec7a193c18) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#84 0x00007fec64d08dca in QmlJS::AST::Node::accept(QmlJS::AST::Node*, QmlJS::AST::Visitor*) (node=<optimized out>, visitor=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#85 0x00007fec64cd923f in ContextBuilder::startVisiting(QmlJS::AST::Node*) (this=<optimized out>, node=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/contextbuilder.cpp:83
#86 0x00007fec64cda6ea in DeclarationBuilder::startVisiting(QmlJS::AST::Node*) (this=0x7fec7a193bc0, node=0x7fec63c00c10) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/declarationbuilder.cpp:110
#87 0x00007fec64cc613e in KDevelop::AbstractContextBuilder<QmlJS::AST::Node, QmlJS::AST::IdentifierPropertyName>::supportBuild(QmlJS::AST::Node*, KDevelop::DUContext*) (context=0x7fec6228cce0, node=0x7fec63c00c10, this=0x7fec7a193bc0) at /usr/include/kdevplatform/language/duchain/builders/abstractcontextbuilder.h:134
#88 0x00007fec64cc613e in KDevelop::AbstractTypeBuilder<QmlJS::AST::Node, QmlJS::AST::IdentifierPropertyName, ContextBuilder>::supportBuild(QmlJS::AST::Node*, KDevelop::DUContext*) (this=0x7fec7a193bc0, node=0x7fec63c00c10, context=<optimized out>) at /usr/include/kdevplatform/language/duchain/builders/abstracttypebuilder.h:85
#89 0x00007fec64cc5c53 in KDevelop::AbstractContextBuilder<QmlJS::AST::Node, QmlJS::AST::IdentifierPropertyName>::build(KDevelop::IndexedString const&, QmlJS::AST::Node*, KDevelop::ReferencedTopDUContext) (this=0x7fec7a193bc0, url=..., node=0x7fec63c00c10, updateContext=...) at /usr/include/kdevplatform/language/duchain/builders/abstractcontextbuilder.h:114
#90 0x00007fec64cdcd44 in DeclarationBuilder::build(KDevelop::IndexedString const&, QmlJS::AST::Node*, KDevelop::ReferencedTopDUContext) (this=this@entry=0x7fec7a193bc0, url=..., node=node@entry=0x7fec63c00c10, updateContext=...) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/duchain/declarationbuilder.cpp:81
#91 0x00007fec64cc11f7 in QmlJsParseJob::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) (this=0x5f4ec60, pointer=..., thread=<optimized out>) at /tmp/build/kdevelop/src/kdevelop-5.0.4/languages/qmljs/qmljsparsejob.cpp:145
#92 0x00007fecb67355d6 in ThreadWeaver::IdDecorator::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#93 0x00007fecb6735bd8 in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#94 0x00007fecb6734aea in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#95 0x00007fecb6734190 in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#96 0x00007fecc21016d8 in  () at /usr/lib/libQt5Core.so.5
#97 0x00007fecbb421454 in start_thread () at /usr/lib/libpthread.so.0
#98 0x00007fecc1a167df in clone () at /usr/lib/libc.so.6
Comment 7 Kevin Funk 2017-03-05 17:33:32 UTC
@robert: Also, for work-arounding the crash you can start KDevelop just like this:
  KDEV_DISABLE_PLUGINS=kdevqmljs kdevelop ...

This will disable the QML/JS language support
Comment 8 Kevin Funk 2017-03-05 18:00:56 UTC
@robert: Does this patch in kdevelop.git fix your issue?

@steckdenis: Opinions?

diff --git a/languages/qmljs/duchain/declarationbuilder.cpp b/languages/qmljs/duchain/declarationbuilder.cpp
index fb0cb5d..b1e2b0e 100644
--- a/languages/qmljs/duchain/declarationbuilder.cpp
+++ b/languages/qmljs/duchain/declarationbuilder.cpp
@@ -330,7 +330,7 @@ void DeclarationBuilder::inferArgumentsFromCall(QmlJS::AST::Node* base, QmlJS::A
 
     auto func_declaration = dynamic_cast<FunctionDeclaration*>(func_type->declaration(topContext()));
 
-    if (!func_declaration) {
+    if (!func_declaration || !func_declaration->internalContext()) {
         return;
     }
Comment 9 robert 2017-03-06 10:35:32 UTC
@kevin
no sorry the project is not public. will check if its always the same file that causes a crash.


also, will try to build the latest git version of kdevelop and kdevplatform and keep you informed about it.
Comment 10 Kevin Funk 2017-03-10 13:28:46 UTC
@robert: Any luck to test my patch?

I'd really like to fix this before the 5.1.0 release, which is about to happen this weekend.
Comment 11 robert 2017-03-11 07:17:37 UTC
Sorry for my late reply, had a busy week :/

Can confirm, with the patch the latest code from git compiles and does not crash when background parser is enabled.

here is some console output when starting kdevelop

kdevelop
kdevplatform.serialization: version-hint not found, seems to be an old version
kdevplatform.serialization: "The data-repository at /home/buchinger/.cache/kdevduchain/kdevelop-{a8bcc2d5-005a-4a9a-9448-f2b870d9b819} has to be cleared."
Waiting for already running kbuildsycoca5 to finish.
Not loading plugin named "KDevNinjaBuilder" because it has been disabled!
Invalid return type in method "core"
Invalid return type in method "core"
kdevplatform.language: Document got removed during parse job creation: "/usr/share/kdevqmljssupport/nodejsmodules/__builtin_ecmascript.js"
kdevplatform.language: Import of function declaration without internal function context encountered!
kdevplatform.language: Import of function declaration without internal function context encountered!
kdevplatform.language: Import of function declaration without internal function context encountered!
kdevplatform.language: Import of function declaration without internal function context encountered!
kdevplatform.language: Import of function declaration without internal function context encountered!
kdevplatform.language: Import of function declaration without internal function context encountered!
kdevplatform.language: Import of function declaration without internal function context encountered!
kdevplatform.language: Import of function declaration without internal function context encountered!
Comment 12 Kevin Funk 2017-03-12 21:30:11 UTC
Git commit 8f62583027a7d0ce89d0993bcb205fdda7317be6 by Kevin Funk.
Committed on 12/03/2017 at 21:27.
Pushed by kfunk into branch '5.1'.

qmljs: Fix crash access internal function context

Fix crash accessing non-existent internal function context.
Unfortunately the reporter can't provide any test QML/JS files.

Note: kdevplatform duchain still warns when encountering function decls
without valid internal function context. This scenario should never
happen to begin with.
  kdevplatform.language: Import of function declaration without internal
function context encountered!
FIXED-IN: 5.1.0

M  +1    -1    languages/qmljs/duchain/declarationbuilder.cpp

https://commits.kde.org/kdevelop/8f62583027a7d0ce89d0993bcb205fdda7317be6