[KDev4] Cpp part crashes when openning the .cpp file.

dukju ahn dukjuahn at gmail.com
Sun Jul 8 15:33:30 UTC 2007


When I open test .cpp file Q_ASSERT fails on attached location.
I enclosed the KTextEditor::Range member values, the file
I edited, failure location, and backtrace.

It could be problem of cpp part or katepart. I'm not sure though.
-------------- next part --------------
m_start.m_line = 0, m_end.m_line = 7

=======the file I edited=========
// this file is only present in trunk
//

int testNotification()
{
    //commit modify
    // commit 2
}
=======end of file==============


QList<KateEditInfo*> KateEditHistory::editsBetweenRevisions(int from, int to) const
{
  QList<KateEditInfo*> ret;

  if (from == -1)
    return ret;

  if (buffer()->edits().isEmpty())
    return ret;

  if (to != -1) {
    Q_ASSERT(from <= to);
    Q_ASSERT(m_revisions.contains(to));
  }

  int fromIndex = 0;
  if (from != 0) {
    Q_ASSERT(m_revisions.contains(from));
    KateEditInfo* fromEdit = m_revisions[from];
    Q_ASSERT(fromEdit);
    fromIndex = buffer()->edits().indexOf(fromEdit);
  }

  KateEditInfo* toEdit = to == -1 ? buffer()->edits().last() : m_revisions[to];
  Q_ASSERT(toEdit);

  int toIndex = buffer()->edits().indexOf(toEdit);
  Q_ASSERT(fromIndex != -1);
  Q_ASSERT(toIndex != -1);
  Q_ASSERT(fromIndex < toIndex);  <<<< =!=!=!=!=!=!=!=!=!=!=!=! THIS LINE 

  for (int i = fromIndex; i <= toIndex; ++i)
    ret.append(buffer()->edits().at(i));

  return ret;
}

/usr/bin/gdb /home/kdev/usr/bin/kdevelop --interpreter=mi2 -quiet
<font color="blue">(gdb) bt</font>
bt
#0  0x00002ae26c40f07b in raise () from /lib64/libc.so.6
#1  0x00002ae26c41084e in abort () from /lib64/libc.so.6
#2  0x00002ae267f4e9a8 in qt_message_output (msgType=QtFatalMsg, buf=0x417ff4c0 "ASSERT: \"fromIndex < toIndex\" in file /home/kdev/ktrunk/kdelibs/kate/document/kateedit.cpp, line 180") at global/qglobal.cpp:2145
#3  0x00002ae267f4eab7 in qFatal (msg=0x2ae26803b408 "ASSERT: \"%s\" in file %s, line %d") at global/qglobal.cpp:2376
#4  0x00002ae267f4ebf5 in qt_assert (assertion=0x2aaaab4c59aa "fromIndex < toIndex", file=0x2aaaab4c5908 "/home/kdev/ktrunk/kdelibs/kate/document/kateedit.cpp", line=180) at global/qglobal.cpp:1904
#5  0x00002aaaab40e1b6 in KateEditHistory::editsBetweenRevisions (this=0xd52fe0, from=1, to=-1) at /home/kdev/ktrunk/kdelibs/kate/document/kateedit.cpp:180
#6  0x00002aaaab438a66 in KateSmartManager::translateFromRevision (this=0xd53ae0, range=@0x41801940, insertBehavior=@0x41801750) at /home/kdev/ktrunk/kdelibs/kate/smart/katesmartmanager.cpp:580
#7  0x00002aaaab43a9d6 in KateSmartManager::newSmartRange (this=0xd53ae0, range=@0x41801940, parent=0x0, insertBehavior=@0x418017d0, internal=false) at /home/kdev/ktrunk/kdelibs/kate/smart/katesmartmanager.cpp:81
#8  0x00002aaaab3ddedd in KateDocument::newSmartRange (this=0xba2c10, range=@0x41801940, parent=0x0, insertBehavior=@0x41801830) at /home/kdev/ktrunk/kdelibs/kate/document/katedocument.cpp:5849
#9  0x00002ae26ce3212a in KDevelop::EditorIntegrator::createRange (this=0x41801e20, range=@0x41801940) at /home/kdev/ktrunk/kdevplatform/editor/editorintegrator.cpp:156
#10 0x00002ae26ce324e7 in KDevelop::EditorIntegrator::topRange (this=0x41801e20, type=KDevelop::EditorIntegrator::DefinitionUseChain) at /home/kdev/ktrunk/kdevplatform/editor/editorintegrator.cpp:129
#11 0x00002aaaaaeaaaff in ContextBuilder::buildContexts (this=0x41801c60, file=@0x41801f10, node=0xf5c780, includes=0x41801e50) at /home/kdev/ktrunk/kdevelop2/languages/cpp/duchainbuilder/contextbuilder.cpp:101
#12 0x00002aaaaaeaf7bd in DeclarationBuilder::buildDeclarations (this=0x41801c60, file=@0x41801f10, node=0xf5c780, includes=0x41801e50) at /home/kdev/ktrunk/kdevelop2/languages/cpp/duchainbuilder/declarationbuilder.cpp:53
#13 0x00002aaaaad67dba in CPPInternalParseJob::run (this=0xf45de0) at /home/kdev/ktrunk/kdevelop2/languages/cpp/cppparsejob.cpp:248
#14 0x00002ae26a56fe71 in ThreadWeaver::JobRunHelper::runTheJob (this=0x41802030, th=0xf45ca0, job=0xf45de0) at /home/kdev/ktrunk/kdelibs/threadweaver/Weaver/Job.cpp:106
#15 0x00002ae26a570075 in ThreadWeaver::Job::execute (this=0xf45de0, th=0xf45ca0) at /home/kdev/ktrunk/kdelibs/threadweaver/Weaver/Job.cpp:135
#16 0x00002ae26a5725c2 in ThreadWeaver::JobCollectionJobRunner::execute (this=0xf45990, t=0xf45ca0) at /home/kdev/ktrunk/kdelibs/threadweaver/Weaver/JobCollection.cpp:82
#17 0x00002ae26a56f360 in ThreadWeaver::ThreadRunHelper::run (this=0x41802100, parent=0xf2ff80, th=0xf45ca0) at /home/kdev/ktrunk/kdelibs/threadweaver/Weaver/Thread.cpp:95
#18 0x00002ae26a56f473 in ThreadWeaver::Thread::run (this=0xf45ca0) at /home/kdev/ktrunk/kdelibs/threadweaver/Weaver/Thread.cpp:142
#19 0x00002ae267f57288 in QThreadPrivate::start (arg=0xf45ca0) at thread/qthread_unix.cpp:166
#20 0x00002ae2681d2f1a in start_thread () from /lib64/libpthread.so.0
#21 0x00002ae26c4a9602 in clone () from /lib64/libc.so.6
#22 0x0000000000000000 in ?? ()
^done


More information about the KDevelop-devel mailing list