Bug 305912 - Crash when parsing python source
Summary: Crash when parsing python source
Status: RESOLVED FIXED
Alias: None
Product: kdev-python
Classification: Developer tools
Component: Language support (show other bugs)
Version: git master
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Sven Brauch
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-28 07:43 UTC by Radek Novacek
Modified: 2012-08-28 08:01 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Radek Novacek 2012-08-28 07:43:09 UTC
KDevelop with kdev-python (today's master) crashes shortly after start with saved session, containing both C and Python projects. Backtrace follows:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ff581645700 (LWP 5851)]
Python::DeclarationBuilder::visitFor (this=0x7ff56cacde60, node=0x7ff56cd4bef8) at ../duchain/declarationbuilder.cpp:430
430                 if ( contentType->whichType() == AbstractType::TypeUnsure ) {
(gdb) bt
#0  Python::DeclarationBuilder::visitFor (this=0x7ff56cacde60, node=0x7ff56cd4bef8) at ../duchain/declarationbuilder.cpp:430
#1  0x00007ff5809eda37 in visitNodeList<Python::Ast> (l=..., this=0x7ff56cacde60) at ../duchain/contextbuilder.h:126
#2  Python::ContextBuilder::visitFunctionBody (this=0x7ff56cacde60, node=<optimized out>) at ../duchain/contextbuilder.cpp:500
#3  0x00007ff5809f38a4 in Python::DeclarationBuilder::visitFunctionDefinition (this=0x7ff56cacde60, node=0x7ff56cd4ab80) at ../duchain/declarationbuilder.cpp:1477
#4  0x00007ff679668ff3 in Python::AstDefaultVisitor::visitClassDefinition (this=0x7ff56cacdec0, node=0x7ff56cd46a80) at ../parser/astdefaultvisitor.cpp:317
#5  0x00007ff5809f2d27 in Python::DeclarationBuilder::visitClassDefinition (this=0x7ff56cacde60, node=0x7ff56cd46a80) at ../duchain/declarationbuilder.cpp:1398
#6  0x00007ff6796688e3 in Python::AstDefaultVisitor::visitCode (this=0x7ff56cacdec0, node=<optimized out>) at ../parser/astdefaultvisitor.cpp:47
#7  0x00007ff5809eb9b7 in Python::ContextBuilder::visitCode (this=0x7ff56cacde60, node=0x56cb470) at ../duchain/contextbuilder.cpp:341
#8  0x00007ff5809f2341 in Python::DeclarationBuilder::visitCode (this=0x7ff56cacde60, node=0x56cb470) at ../duchain/declarationbuilder.cpp:362
#9  0x00007ff580a00115 in supportBuild (context=0x7ff56cd89d20, node=0x56cb470, this=0x7ff56cacde60) at /home/radek/kdevelop/include/kdevplatform/language/duchain/builders/abstractcontextbuilder.h:133
#10 KDevelop::AbstractTypeBuilder<Python::Ast, Python::Identifier, Python::ContextBuilder>::supportBuild (this=0x7ff56cacde60, node=0x56cb470, context=<optimized out>)
    at /home/radek/kdevelop/include/kdevplatform/language/duchain/builders/abstracttypebuilder.h:85
#11 0x00007ff5809ee51f in build (updateContext=..., node=0x56cb470, url=..., this=0x7ff56cacde60) at /home/radek/kdevelop/include/kdevplatform/language/duchain/builders/abstractcontextbuilder.h:113
#12 Python::ContextBuilder::build (this=0x7ff56cacde60, url=..., node=0x56cb470, updateContext=...) at ../duchain/contextbuilder.cpp:85
#13 0x00007ff5809f13f3 in Python::DeclarationBuilder::build (this=0x7ff56cacde60, url=..., node=0x56cb470, updateContext=...) at ../duchain/declarationbuilder.cpp:102
#14 0x00007ff5809f137a in Python::DeclarationBuilder::build (this=0x7ff581644af0, url=..., node=0x56cb470, updateContext=...) at ../duchain/declarationbuilder.cpp:95
#15 0x00007ff5819aa7a9 in Python::ParseJob::run (this=0x4eb8e00) at ../pythonparsejob.cpp:156
#16 0x00007ff69ed7093a in ThreadWeaver::JobRunHelper::runTheJob (this=this@entry=0x7ff581644cd0, th=th@entry=0x7ff5cc00eeb0, job=job@entry=0x4eb8e00) at /usr/src/debug/kdelibs-4.9.0/threadweaver/Weaver/Job.cpp:106
#17 0x00007ff69ed70ab1 in ThreadWeaver::Job::execute (this=0x4eb8e00, th=0x7ff5cc00eeb0) at /usr/src/debug/kdelibs-4.9.0/threadweaver/Weaver/Job.cpp:135
#18 0x00007ff69ed7010f in ThreadWeaver::ThreadRunHelper::run (this=this@entry=0x7ff581644d20, parent=0x1439dd0, th=th@entry=0x7ff5cc00eeb0) at /usr/src/debug/kdelibs-4.9.0/threadweaver/Weaver/Thread.cpp:95
#19 0x00007ff69ed701cb in ThreadWeaver::Thread::run (this=0x7ff5cc00eeb0) at /usr/src/debug/kdelibs-4.9.0/threadweaver/Weaver/Thread.cpp:142
#20 0x00007ff69c4895eb in QThreadPrivate::start (arg=0x7ff5cc00eeb0) at thread/qthread_unix.cpp:307
#21 0x00007ff69c1f9d14 in start_thread () from /lib64/libpthread.so.0
#22 0x00007ff69a5e067d in clone () from /lib64/libc.so.6

Variable contentType is NULL pointer

(gdb) p contentType
$1 = {
  d = 0x0
}


Reproducible: Sometimes

Steps to Reproduce:
1. Start KDevelop with saved session
2. crash
Comment 1 Sven Brauch 2012-08-28 08:01:40 UTC
Git commit 83257ea64df9273d00b0824b32926b048cf76173 by Sven Brauch.
Committed on 28/08/2012 at 10:01.
Pushed by brauch into branch 'master'.

Fix a crash when a container used in a foor loop has no content type

M  +3    -2    duchain/declarationbuilder.cpp

http://commits.kde.org/kdev-python/83257ea64df9273d00b0824b32926b048cf76173