Bug 230451 - KDevelop Crash when typing
Summary: KDevelop Crash when typing
Status: RESOLVED NOT A BUG
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: PHP (other bugs)
Version First Reported In: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-12 14:44 UTC by Tamás Gere
Modified: 2010-03-16 11:05 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tamás Gere 2010-03-12 14:44:34 UTC
Application: kdevelop (3.9.99 (using KDevPlatform 0.9.99))
KDE Platform Version: 4.4.1 (KDE 4.4.1) (Compiled from sources)
Qt Version: 4.6.2
Operating System: Linux 2.6.32-sabayon x86_64
Distribution: "Gentoo Base System release 2.0.1"

-- Information about the crash:
I'm guessing the autocompleter crashing. I tried declare a class, but the app chrased after "extends" keyword. It repeated all time. So what exactly i timed:

class cache_memcache extends <- so here when i push space here, app crashing.

I'm using SVN version 1102348 i think. Compiled by myself (not portage).

The crash can be reproduced every time.

 -- Backtrace:
Application: KDevelop (kdevelop.bin), signal: Segmentation fault
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib64/libgobject-2.0.so.0.2200.3-gdb.py", line 9, in <module>
    from gobject import register
  File "/usr/share/glib-2.0/gdb/gobject.py", line 3, in <module>
    import gdb.backtrace
ImportError: No module named backtrace
[Current thread is 1 (Thread 0x7fa830cee750 (LWP 13635))]

Thread 6 (Thread 0x7fa81af40910 (LWP 13636)):
#0  0x00007fa82d37524d in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007fa82d6001f2 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007fa82a29826e in KDevelop::DUChainPrivate::CleanupThread::run (this=0x1248c80) at /usr/local/src/kdesdk4/kdevplatform/language/duchain/duchain.cpp:286
#3  0x00007fa82d5ff2c5 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007fa82d370624 in start_thread () from /lib/libpthread.so.0
#5  0x00007fa82ba7256d in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 5 (Thread 0x7fa80f696910 (LWP 13638)):
[KCrash Handler]
#5  0x00007fa82c258e3b in __dynamic_cast () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/libstdc++.so.6
#6  0x00007fa80f6b5224 in Php::CodeCompletionContext::isValidCompletionItem (this=0x7fa80829f750, dec=0x7fa80801d9e0) at /usr/local/src/kdesdk4/kdevelop-plugins/php/completion/context.cpp:1577
#7  0x00007fa80f6ad137 in Php::CodeCompletionContext::completionItems (this=0x7fa80829f750, abort=@0x7fa8080013f0, fullCompletion=<value optimized out>)
    at /usr/local/src/kdesdk4/kdevelop-plugins/php/completion/context.cpp:1384
#8  0x00007fa82a3781cc in KDevelop::CodeCompletionWorker::computeCompletions (this=0x7fa8080013d0, context=<value optimized out>, position=<value optimized out>, view=<value optimized out>, 
    contextRange=<value optimized out>, contextText=<value optimized out>) at /usr/local/src/kdesdk4/kdevplatform/language/codecompletion/codecompletionworker.cpp:159
#9  0x00007fa82a377d61 in KDevelop::CodeCompletionWorker::computeCompletions (this=0x7fa8080013d0, context=<value optimized out>, position=..., view=0x369bad0)
    at /usr/local/src/kdesdk4/kdevplatform/language/codecompletion/codecompletionworker.cpp:119
#10 0x00007fa82a378874 in KDevelop::CodeCompletionWorker::qt_metacall (this=0x7fa8080013d0, _c=<value optimized out>, _id=<value optimized out>, _a=0x2e6d400)
    at /usr/local/src/kdesdk4/build/kdevplatform/language/codecompletionworker.moc:84
#11 0x00007fa82d702889 in QObject::event(QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#12 0x00007fa82c8b991c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#13 0x00007fa82c8bfefb in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#14 0x00007fa82dea8996 in KApplication::notify(QObject*, QEvent*) () from /usr/lib64/libkdeui.so.5
#15 0x00007fa82d6f2c0c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#16 0x00007fa82d6f5387 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib64/qt4/libQtCore.so.4
#17 0x00007fa82d71c533 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#18 0x00007fa826ef970e in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#19 0x00007fa826efd0c8 in ?? () from /usr/lib/libglib-2.0.so.0
#20 0x00007fa826efd1f0 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#21 0x00007fa82d71c073 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#22 0x00007fa82d6f1532 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#23 0x00007fa82d6f190c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#24 0x00007fa82d5fc8c9 in QThread::exec() () from /usr/lib64/qt4/libQtCore.so.4
#25 0x00007fa82d5ff2c5 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#26 0x00007fa82d370624 in start_thread () from /lib/libpthread.so.0
#27 0x00007fa82ba7256d in clone () from /lib/libc.so.6
#28 0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7fa80584e910 (LWP 13651)):
#0  0x00007fa82d374fc9 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007fa82ae54326 in ?? () from /usr/lib64/qt4/libQtScript.so.4
#2  0x00007fa82ae54369 in ?? () from /usr/lib64/qt4/libQtScript.so.4
#3  0x00007fa82d370624 in start_thread () from /lib/libpthread.so.0
#4  0x00007fa82ba7256d in clone () from /lib/libc.so.6
#5  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7fa80604f910 (LWP 13659)):
#0  0x00007fa82d374fc9 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007fa82d60028b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007fa82f1646f6 in ?? () from /usr/lib64/libthreadweaver.so.4
#3  0x00007fa82f166dab in ?? () from /usr/lib64/libthreadweaver.so.4
#4  0x00007fa82f166dc4 in ?? () from /usr/lib64/libthreadweaver.so.4
#5  0x00007fa82f16525f in ?? () from /usr/lib64/libthreadweaver.so.4
#6  0x00007fa82f1656b8 in ThreadWeaver::Thread::run() () from /usr/lib64/libthreadweaver.so.4
#7  0x00007fa82d5ff2c5 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#8  0x00007fa82d370624 in start_thread () from /lib/libpthread.so.0
#9  0x00007fa82ba7256d in clone () from /lib/libc.so.6
#10 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7fa803c70910 (LWP 13663)):
#0  0x00007fa82d374fc9 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007fa82d60028b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007fa82f1646f6 in ?? () from /usr/lib64/libthreadweaver.so.4
#3  0x00007fa82f166dab in ?? () from /usr/lib64/libthreadweaver.so.4
#4  0x00007fa82f16525f in ?? () from /usr/lib64/libthreadweaver.so.4
#5  0x00007fa82f1656b8 in ThreadWeaver::Thread::run() () from /usr/lib64/libthreadweaver.so.4
#6  0x00007fa82d5ff2c5 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#7  0x00007fa82d370624 in start_thread () from /lib/libpthread.so.0
#8  0x00007fa82ba7256d in clone () from /lib/libc.so.6
#9  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7fa830cee750 (LWP 13635)):
#0  0x00007fa82ba698a3 in poll () from /lib/libc.so.6
#1  0x00007fa825307b4a in ?? () from /usr/lib/libxcb.so.1
#2  0x00007fa825308087 in ?? () from /usr/lib/libxcb.so.1
#3  0x00007fa825308335 in xcb_writev () from /usr/lib/libxcb.so.1
#4  0x00007fa82911e35a in _XSend () from /usr/lib64/libX11.so.6
#5  0x00007fa82911e8a5 in _XFlush () from /usr/lib64/libX11.so.6
#6  0x00007fa829115f38 in _XData32 () from /usr/lib64/libX11.so.6
#7  0x00007fa8290f08e3 in XChangeProperty () from /usr/lib64/libX11.so.6
#8  0x00007fa82c9568d7 in QWidgetPrivate::setWindowIcon_sys(bool) () from /usr/lib64/qt4/libQtGui.so.4
#9  0x00007fa82c910f78 in QWidget::create(unsigned long, bool, bool) () from /usr/lib64/qt4/libQtGui.so.4
#10 0x00007fa82c916e26 in QWidget::setVisible(bool) () from /usr/lib64/qt4/libQtGui.so.4
#11 0x00007fa804a5b105 in ?? () from /usr/lib64/kde4/katepart.so
#12 0x00007fa804a5c157 in ?? () from /usr/lib64/kde4/katepart.so
#13 0x00007fa804a5d4ec in ?? () from /usr/lib64/kde4/katepart.so
#14 0x00007fa804a5edbe in ?? () from /usr/lib64/kde4/katepart.so
#15 0x00007fa804a5f0a7 in ?? () from /usr/lib64/kde4/katepart.so
#16 0x00007fa804a6088a in ?? () from /usr/lib64/kde4/katepart.so
#17 0x00007fa82d70594f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#18 0x00007fa82d7025a3 in QObject::event(QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#19 0x00007fa82c8b991c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#20 0x00007fa82c8bfefb in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#21 0x00007fa82dea8996 in KApplication::notify(QObject*, QEvent*) () from /usr/lib64/libkdeui.so.5
#22 0x00007fa82d6f2c0c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#23 0x00007fa82d71f772 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#24 0x00007fa82d71c3a8 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#25 0x00007fa826ef970e in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#26 0x00007fa826efd0c8 in ?? () from /usr/lib/libglib-2.0.so.0
#27 0x00007fa826efd1f0 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#28 0x00007fa82d71c073 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#29 0x00007fa82c967c6e in ?? () from /usr/lib64/qt4/libQtGui.so.4
#30 0x00007fa82d6f1532 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#31 0x00007fa82d6f190c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#32 0x00007fa82d6f564b in QCoreApplication::exec() () from /usr/lib64/qt4/libQtCore.so.4
#33 0x00000000004086ff in main (argc=<value optimized out>, argv=<value optimized out>) at /usr/local/src/kdesdk4/kdevelop/app/main_internal.cpp:222

This bug may be a duplicate of or related to bug 224479.

Possible duplicates by query: bug 224479.

Reported using DrKonqi
Comment 1 Milian Wolff 2010-03-12 15:39:49 UTC
Does this problem persist after you remove ~/.kdevduchain?

This looks rather fishy, esp. considering that it crashes in a dynamic cast. The code is:

    static DUChainPointer<ClassDeclaration> exceptionDecl;
    if (!exceptionDecl) {
        QList<Declaration*> decs = dec->context()->findDeclarations(QualifiedIdentifier("exception"));
        Q_ASSERT(decs.count() == 1);
        exceptionDecl = dynamic_cast<ClassDeclaration*>(decs.first());
        Q_ASSERT(exceptionDecl);
    }

Anyone else an idea what might be happening?

I'll try to reproduce at home, though I'm pretty sure that it once worked fine...
Comment 2 Milian Wolff 2010-03-12 15:42:29 UTC
Just compiled at work and tried your example: Works fine. Does this also happen in other files?
Comment 3 David Nolden 2010-03-14 18:10:46 UTC
Might happen if you use multithreading and don't lock the duchain before calling findDeclarations, as the declarations may already be deleted when you try to cast them.
Comment 4 Niko Sams 2010-03-14 18:40:42 UTC
It's locked, and ENSURE_CAN_READ would abort else.
Comment 5 Tamás Gere 2010-03-15 17:54:02 UTC
Hi!

Tomorrow (2010.03.16) I'll try to reproduce on a code what i can share with you and will attach here. Maybe the error accours on my specific code.
Comment 6 Tamás Gere 2010-03-16 11:05:22 UTC
Hi!

Today morning, i completly removed all installed binary, build directories and my working copy. Checked out source again and re-compiled everything. Now the autocomplete works at that point. Thanks for your time guys, next time i'll start with this.

Cheers