https://bugs.kde.org/show_bug.cgi?id=362913

            Bug ID: 362913
           Summary: Crash when parsing file.
           Product: kdev-python
           Version: unspecified
          Platform: Compiled Sources
                OS: Linux
            Status: UNCONFIRMED
          Severity: crash
          Priority: NOR
         Component: general
          Assignee: m...@svenbrauch.de
          Reporter: francis.he...@yahoo.co.uk
                CC: m...@svenbrauch.de

Arch Linux x86_64, 5.0 branches of kdev-python/kdevelop/kdevplatform as of
March 14 (still...).

When parsing the file contents below, kdev-python crashes.


Reproducible: Always

Steps to Reproduce:
Put the content below in a text file, open it in KDevelop.

Contents
========
from collections import namedtuple

Link = namedtuple('Link', ('origin', 'tag', 'target', 'inverse_tag'))

def __link_inverse(self):
    """View a link from the other end (should be classmethod)"""
    return Link(self.target, self.inverse_tag, self.origin, self.tag)

Link.inverse = __link_inverse


class Network:
    def __init__(self):
        self.links = []

    def __getitem__(self, key):
        if not isinstance(key, tuple):
            if isinstance(key, int):
                return self.links[key]
            key = (key,)
key += (...,) * (4 - len(key))
def match(link):
    return all(query in (value, ...) for query, value in zip(key, link))
return [link for link in self.links if match(link)]
===========
End contents

Actual Results:  
KDevelop crashes:
 - When editing the file into that state.
 - When pressing 'recover changes' after the crash.
 - When pasting the contents into a new file, outside the project tree, and
opening that.

KATE/KWrite don't crash.

Expected Results:  
KDevelop doesn't crash.

Output/backtrace
========
---- Parsing Succeeded ----
 ====> PARSING ====> parsing file 
QUrl("file:///home/flh/projects/PIMesh/network3.py") ; has priority 0
 ====> AST     ====>     building abstract syntax tree for 
"/home/flh/projects/PIMesh/network3.py"
 ====> DUCHAIN ====>     rebuilding duchain for
"/home/flh/projects/PIMesh/network3.py" (was built before)
 ====> DUCHAIN ====>     rebuilding duchain for
"/home/flh/projects/PIMesh/network3.py" (was built before)
ASSERT: "currentContext()" in file
/tmp/yaourt-tmp-flh/aur-kdevelop-python3-git/src/kdev-python/duchain/contextbuilder.cpp,
line 257

Thread 14 "Queue(0x2a36a60" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fff9bfff700 (LWP 18604)]
0x00007ffff439c295 in raise () from /usr/lib/libc.so.6
(gdb) bt full
#0  0x00007ffff439c295 in raise () from /usr/lib/libc.so.6
No symbol table info available.
#1  0x00007ffff439d6da in abort () from /usr/lib/libc.so.6
No symbol table info available.
#2  0x00007ffff4b23c61 in QMessageLogger::fatal(char const*, ...) const () from
/usr/lib/libQt5Core.so.5
No symbol table info available.
#3  0x00007ffff4b1eebe in qt_assert(char const*, char const*, int) () from
/usr/lib/libQt5Core.so.5
No symbol table info available.
#4  0x00007fffa2df0e32 in Python::ContextBuilder::visitComprehensionCommon
(this=0x7fff9bffead0, node=0x7fff90123fe0) at
/tmp/yaourt-tmp-flh/aur-kdevelop-python3-git/src/kdev-python/duchain/contextbuilder.cpp:257
        lock = {m_lock = 0x7ffff2aebba0 <KDevelop::(anonymous
namespace)::Q_QGS_sdDUChainPrivate::innerFunction()::holder+32>, m_locked =
true, m_timeout = 0}
        range = {start = {line = 23, column = 7}, end = {line = 23, column =
50}}
#5  0x00007fffa735441a in Python::AstDefaultVisitor::visitCode
(this=this@entry=0x7fff9bffeb28, node=node@entry=0x7fff90346020) at
/tmp/yaourt-tmp-flh/aur-kdevelop-python3-git/src/kdev-python/parser/astdefaultvisitor.cpp:79
        statement = <optimized out>
        _container_ = {c = {<QListSpecialMethods<Python::Ast*>> = {<No data
fields>}, {p = {static shared_null = {ref = {atomic = {_q_value =
{<std::__atomic_base<int>> = {static _S_alignment = 4, 
                          _M_i = -1}, <No data fields>}}}, alloc = 0, begin =
0, end = 0, array = {0x0}}, d = 0x7fff902e3570}, d = 0x7fff902e3570}}, i = {i =
0x7fff902e35b8}, e = {i = 0x7fff902e35c0}, control = 1}
#6  0x00007fffa2df143a in Python::ContextBuilder::visitCode
(this=0x7fff9bffead0, node=0x7fff90346020) at
/tmp/yaourt-tmp-flh/aur-kdevelop-python3-git/src/kdev-python/duchain/contextbuilder.cpp:319
        doc_url = {static null = {<No data fields>}, d = 0x9d9080}
        doc = {m_index = 123018}
#7  0x00007fffa328ec59 in KDevelop::AbstractContextBuilder<Python::Ast,
Python::Identifier>::supportBuild (this=0x7fff9bffead0, node=0x7fff90346020,
context=<optimized out>)
    at
/usr/include/kdevplatform/language/duchain/builders/abstractcontextbuilder.h:134
No locals.
#8  0x00007fffa328de6c in KDevelop::AbstractUseBuilder<Python::Ast,
Python::Identifier, Python::ContextBuilder>::buildUses (node=0x7fff90346020,
this=0x7fff9bffead0)
    at
/usr/include/kdevplatform/language/duchain/builders/abstractusebuilder.h:72
        top = <optimized out>
#9  Python::ParseJob::run (this=<optimized out>) at
/tmp/yaourt-tmp-flh/aur-kdevelop-python3-git/src/kdev-python/pythonparsejob.cpp:178
        builder = 
    {<KDevelop::AbstractDeclarationBuilder<Python::Ast, Python::Identifier,
Python::TypeBuilder>> = {<Python::TypeBuilder> =
{<KDevelop::AbstractTypeBuilder<Python::Ast, Python::Identifier,
Python::ContextBuilder>> = {<Python::ContextBuilder> =
{<KDevelop::AbstractContextBuilder<Python::Ast, Python::Identifier>> =
{_vptr.AbstractContextBuilder = 0x7fffa3035730 <vtable for
Python::DeclarationBuilder+16>, m_identifier = {m_index = 65538, {
                        dd = 0x7ffff32e86d0
<KDevelop::emptyConstantIdentifierPrivate()::item>, cd = 0x7ffff32e86d0
<KDevelop::emptyConstantIdentifierPrivate()::item>}}, m_url = {m_index =
998164}, m_qIdentifier = {
                      m_index = 65538, {dd = 0x7ffff32e8670
<KDevelop::emptyConstantQualifiedIdentifierPrivate()::item>, cd =
0x7ffff32e8670 <KDevelop::emptyConstantQualifiedIdentifierPrivate()::item>}}, 
                    m_compilingContexts = false, m_recompiling = true,
m_nextContextStack = {<QVector<int>> = {d = 0x7fff90004750}, <No data fields>},
m_lastContext = 0x7fff08003a40, m_encountered = {q_hash = {{
                          d = 0x7fff900047a0, e = 0x7fff900047a0}}},
m_contextStack = {<QVector<KDevelop::DUContext*>> = {d = 0x7fff903e5da0}, <No
data fields>}}, <Python::AstDefaultVisitor> = {<Python::AstVisitor> = {
                      _vptr.AstVisitor = 0x7fffa30358b0 <vtable for
Python::DeclarationBuilder+400>}, <No data fields>}, 
                  m_temporarilyClosedContexts =
{<QListSpecialMethods<KDevelop::DUChainPointer<KDevelop::DUContext> >> = {<No
data fields>}, {p = {static shared_null = {ref = {atomic = {
                              _q_value = {<std::__atomic_base<int>> = {static
_S_alignment = 4, _M_i = -1}, <No data fields>}}}, alloc = 0, begin = 0, end =
0, array = {0x0}}, d = 0x7fff903c9290}, d = 0x7fff903c9290}},
                  m_mostRecentArgumentsContext = {d = {d = 0x0}}, m_prebuilding
= false, m_unresolvedImports = {<QListSpecialMethods<KDevelop::IndexedString>>
= {<No data fields>}, {p = {static shared_null = {ref = {
                            atomic = {_q_value = {<std::__atomic_base<int>> =
{static _S_alignment = 4, _M_i = -1}, <No data fields>}}}, alloc = 0, begin =
0, end = 0, array = {0x0}},
                        d = 0x7ffff4dc39c0 <QListData::shared_null>}, d =
0x7ffff4dc39c0 <QListData::shared_null>}}, m_futureModificationRevision =
{modificationTime = 1462921836, revision = 13},
                  m_currentlyParsedDocument = {m_index = 998164}, m_mapAst =
false, m_topContext = {m_topContext = 0x0}, m_editor = 0x7fff904014c0,
                  m_importedParentContexts =
{<QListSpecialMethods<KDevelop::DUContext*>> = {<No data fields>}, {p = {static
shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {static
_S_alignment = 4,
                                  _M_i = -1}, <No data fields>}}}, alloc = 0,
begin = 0, end = 0, array = {0x0}}, d = 0x7ffff4dc39c0
<QListData::shared_null>}, d = 0x7ffff4dc39c0 <QListData::shared_null>}},
                  m_indentInformationCache = {value = 0x0, d = 0x0}},
m_typeStack = {<QVector<KDevelop::TypePtr<KDevelop::AbstractType> >> = {d =
0x7fff901250f0}, <No data fields>},
                m_lastType =
{<QExplicitlySharedDataPointer<KDevelop::AbstractType>> = {d = 0x7fff90378210},
<No data fields>},
                m_topTypes =
{<QListSpecialMethods<KDevelop::TypePtr<KDevelop::AbstractType> >> = {<No data
fields>}, {p = {static shared_null = {ref = {atomic = {_q_value =
{<std::__atomic_base<int>> = {
                                static _S_alignment = 4, _M_i = -1}, <No data
fields>}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x7fff9031cc00},
d = 0x7fff9031cc00}}}, <No data fields>},
            m_declarationStack = {<QVector<KDevelop::Declaration*>> = {d =
0x7fff902e5b90}, <No data fields>}, m_lastComment = {d = 0x7ffff4dc1b20
<QArrayData::shared_null>}},
          m_scheduledForDeletion =
{<QListSpecialMethods<KDevelop::DUChainBase*>> = {<No data fields>}, {p =
{static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> =
{static _S_alignment = 4,
                          _M_i = -1}, <No data fields>}}}, alloc = 0, begin =
0, end = 0, array = {0x0}}, d = 0x7ffff4dc39c0 <QListData::shared_null>}, d =
0x7ffff4dc39c0 <QListData::shared_null>}}, m_correctionHelper = {
            d = 0x7fff9040bf40}, m_ownPriority = 0, m_currentClassType =
{<QExplicitlySharedDataPointer<KDevelop::StructureType>> = {d =
0x7fff901ab2d0}, <No data fields>}, m_missingModules = {d = 0x7fff9031b6f0},
          m_lastComment = 0x0}
        usebuilder = {<KDevelop::AbstractUseBuilder<Python::Ast,
Python::Identifier, Python::ContextBuilder>> = {<Python::ContextBuilder> =
{<KDevelop::AbstractContextBuilder<Python::Ast, Python::Identifier>> = {
                _vptr.AbstractContextBuilder = 0x7fffa3035de0 <vtable for
Python::UseBuilder+16>, m_identifier = {m_index = 65538, {dd = 0x7ffff32e86d0
<KDevelop::emptyConstantIdentifierPrivate()::item>,
                    cd = 0x7ffff32e86d0
<KDevelop::emptyConstantIdentifierPrivate()::item>}}, m_url = {m_index = 0},
m_qIdentifier = {m_index = 65538, {
                    dd = 0x7ffff32e8670
<KDevelop::emptyConstantQualifiedIdentifierPrivate()::item>, cd =
0x7ffff32e8670 <KDevelop::emptyConstantQualifiedIdentifierPrivate()::item>}},
m_compilingContexts = false,
                m_recompiling = true, m_nextContextStack = {<QVector<int>> = {d
= 0x7fff90129530}, <No data fields>}, m_lastContext = 0x7fff901666c0,
m_encountered = {q_hash = {{d = 0x7fff9030c860, e = 0x7fff9030c860}}},
                m_contextStack = {<QVector<KDevelop::DUContext*>> = {d =
0x7fff9038dd10}, <No data fields>}}, <Python::AstDefaultVisitor> =
{<Python::AstVisitor> = {
                  _vptr.AstVisitor = 0x7fffa3035ed0 <vtable for
Python::UseBuilder+256>}, <No data fields>},
---Type <return> to continue, or q <return> to quit---
              m_temporarilyClosedContexts =
{<QListSpecialMethods<KDevelop::DUChainPointer<KDevelop::DUContext> >> = {<No
data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value =
{<std::__atomic_base<int>> = {
                              static _S_alignment = 4, _M_i = -1}, <No data
fields>}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x7ffff4dc39c0
<QListData::shared_null>},
                  d = 0x7ffff4dc39c0 <QListData::shared_null>}},
m_mostRecentArgumentsContext = {d = {d = 0x0}}, m_prebuilding = false,
              m_unresolvedImports =
{<QListSpecialMethods<KDevelop::IndexedString>> = {<No data fields>}, {p =
{static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> =
{static _S_alignment = 4,
                              _M_i = -1}, <No data fields>}}}, alloc = 0, begin
= 0, end = 0, array = {0x0}}, d = 0x7ffff4dc39c0 <QListData::shared_null>}, d =
0x7ffff4dc39c0 <QListData::shared_null>}},
              m_futureModificationRevision = {modificationTime = 4294967295,
revision = 0}, m_currentlyParsedDocument = {m_index = 998164}, m_mapAst =
false, m_topContext = {m_topContext = 0x0}, m_editor = 0x7fff904014c0,
              m_importedParentContexts =
{<QListSpecialMethods<KDevelop::DUContext*>> = {<No data fields>}, {p = {static
shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {static
_S_alignment = 4,
                              _M_i = -1}, <No data fields>}}}, alloc = 0, begin
= 0, end = 0, array = {0x0}}, d = 0x7fff903b2aa0}, d = 0x7fff903b2aa0}},
m_indentInformationCache = {value = 0x0, d = 0x0}},
            m_trackerStack =
{<QVector<KDevelop::AbstractUseBuilder<Python::Ast, Python::Identifier,
Python::ContextBuilder>::ContextUseTracker>> = {d = 0x7fff902eb6d0}, <No data
fields>},
            m_contexts = {<QVector<KDevelop::DUContext*>> = {d =
0x7fff901294e0}, <No data fields>}, m_finishContext = true}, m_session = 0x0,
m_nextUseStack = {<QVector<int>> = {
              d = 0x7ffff4dc1b20 <QArrayData::shared_null>}, <No data fields>},
m_errorReportingEnabled = true, m_ignoreVariables = {d = 0x7fff9031b6f0}}
        needsReparse = <optimized out>
        __PRETTY_FUNCTION__ = "virtual void
Python::ParseJob::run(ThreadWeaver::JobPointer, ThreadWeaver::Thread*)"
        parselock = <optimized out>
        urlLock = {m_url = {m_index = 998164}}
        toUpdate = {m_topContext = 0x7fff08003a40}
        parserResults = {first = {value = 0x7fff90346020, d = 0x7fff9008f920},
second = true}
        editor = {value = <optimized out>, d = 0x7fff902b30c0}
        lock = {m_lock = 0x7fffa3035de0 <vtable for Python::UseBuilder+16>,
m_locked = 2, m_timeout = 32767}
#10 0x00007fffe95e436a in
ThreadWeaver::IdDecorator::run(QSharedPointer<ThreadWeaver::JobInterface>,
ThreadWeaver::Thread*) () from /usr/lib/libKF5ThreadWeaver.so.5
No symbol table info available.
#11 0x00007fffe95e47a7 in
ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&,
ThreadWeaver::Thread*) () from /usr/lib/libKF5ThreadWeaver.so.5
No symbol table info available.
#12 0x00007fffe95e372a in
ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&,
ThreadWeaver::Thread*) () from /usr/lib/libKF5ThreadWeaver.so.5
No symbol table info available.
#13 0x00007fffe95e2aa0 in ThreadWeaver::Thread::run() () from
/usr/lib/libKF5ThreadWeaver.so.5
No symbol table info available.
#14 0x00007ffff4b3c1d8 in ?? () from /usr/lib/libQt5Core.so.5
No symbol table info available.
#15 0x00007fffecc82474 in start_thread () from /usr/lib/libpthread.so.0
No symbol table info available.
#16 0x00007ffff445084d in clone () from /usr/lib/libc.so.6
No symbol table info available.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to