Bug 269832 - KDevelop Crash in PHP Parser
Summary: KDevelop Crash in PHP Parser
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: 4.2.60
Platform: Compiled Sources Linux
: VHI crash
Target Milestone: 4.2.0
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-31 18:39 UTC by George Goldberg
Modified: 2011-04-06 18:00 UTC (History)
1 user (show)

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 George Goldberg 2011-03-31 18:39:01 UTC
Application: kdevelop (4.2.60)
KDE Platform Version: 4.6.41 (4.7 >= 20110106) (Compiled from sources)
Qt Version: 4.7.2
Operating System: Linux 2.6.32-5-amd64 x86_64
Distribution: Debian GNU/Linux unstable (sid)

-- Information about the crash:
- What I was doing when the application crashed:
Working on a PHP project in KDevelop. I had just typed the following code into a file:

<?php
if (isset($uri_bits[3])) {

At which point KDevelop crashed, and then crashed almost immediately on each subsequent restart of it (even after clearing out duchain data).

I'm not sure if the same crash would happen out of context of the rest of the project however.

Version used is latest git from 30th March (of entire KDE trunk, including kdevplatform, kdevelop and kdev php plugin).

The crash can be reproduced every time.

-- Backtrace:
Application: KDevelop (kdevelop), signal: Segmentation fault
[Current thread is 1 (Thread 0x7fc3504157a0 (LWP 6260))]

Thread 7 (Thread 0x7fc333313700 (LWP 6261)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:211
#1  0x00007fc34ba48682 in wait (this=<value optimized out>, mutex=0x187dfa0, time=1000) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=<value optimized out>, mutex=0x187dfa0, time=1000) at thread/qwaitcondition_unix.cpp:160
#3  0x00007fc347e70146 in KDevelop::DUChainPrivate::CleanupThread::run (this=0x187df80) at /home/gberg/development/src/other/kde/kdevplatform/language/duchain/duchain.cpp:286
#4  0x00007fc34ba48035 in QThreadPrivate::start (arg=0x187df80) at thread/qthread_unix.cpp:320
#5  0x00007fc33eb08ae3 in ?? () from /usr/lib/libGL.so.1
#6  0x00007fc34b7a78ba in start_thread (arg=<value optimized out>) at pthread_create.c:300
#7  0x00007fc349e203cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#8  0x0000000000000000 in ?? ()

Thread 6 (Thread 0x7fc327799700 (LWP 6266)):
#0  0x00007fc349e154b3 in __poll (fds=<value optimized out>, nfds=<value optimized out>, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007fc343fd26c9 in ?? () from /lib/libglib-2.0.so.0
#2  0x00007fc343fd2b1c in g_main_context_iteration () from /lib/libglib-2.0.so.0
#3  0x00007fc34bb5bde6 in QEventDispatcherGlib::processEvents (this=0x1a7d430, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#4  0x00007fc34bb30022 in QEventLoop::processEvents (this=<value optimized out>, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007fc34bb3026c in QEventLoop::exec (this=0x7fc327798ce0, flags=...) at kernel/qeventloop.cpp:201
#6  0x00007fc34ba457d4 in QThread::exec (this=<value optimized out>) at thread/qthread.cpp:492
#7  0x00007fc347f8fc2f in KDevelop::CompletionWorkerThread::run (this=0x1cee510) at /home/gberg/development/src/other/kde/kdevplatform/language/codecompletion/codecompletionmodel.cpp:84
#8  0x00007fc34ba48035 in QThreadPrivate::start (arg=0x1cee510) at thread/qthread_unix.cpp:320
#9  0x00007fc33eb08ae3 in ?? () from /usr/lib/libGL.so.1
#10 0x00007fc34b7a78ba in start_thread (arg=<value optimized out>) at pthread_create.c:300
#11 0x00007fc349e203cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#12 0x0000000000000000 in ?? ()

Thread 5 (Thread 0x7fc326f98700 (LWP 6268)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007fc348b92164 in QTWTF::TCMalloc_PageHeap::scavengerThread (this=0x7fc348eac0e0) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2359
#2  0x00007fc348b92199 in QTWTF::TCMalloc_PageHeap::runScavengerThread (context=0x7fc348eba1b4) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1464
#3  0x00007fc33eb08ae3 in ?? () from /usr/lib/libGL.so.1
#4  0x00007fc34b7a78ba in start_thread (arg=<value optimized out>) at pthread_create.c:300
#5  0x00007fc349e203cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#6  0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7fc322063700 (LWP 6275)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007fc342b38474 in scavengerThread (context=0x7fc34340c4e0) at wtf/FastMalloc.cpp:2380
#2  WTF::TCMalloc_PageHeap::runScavengerThread (context=0x7fc34340c4e0) at wtf/FastMalloc.cpp:1501
#3  0x00007fc33eb08ae3 in ?? () from /usr/lib/libGL.so.1
#4  0x00007fc34b7a78ba in start_thread (arg=<value optimized out>) at pthread_create.c:300
#5  0x00007fc349e203cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#6  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7fc29fff6700 (LWP 6284)):
[KCrash Handler]
#6  0x00007fc32560c4d5 in KDevPG::TokenStreamBase<Php::Token>::nextToken (this=0x3c4f9a0) at /opt/kde/include/kdevelop-pg-qt/kdev-pg-token-stream.h:102
#7  0x00007fc32560c2fe in Php::Parser::yylex (this=0x50df6f0) at /home/gberg/development/build/other/kde/kdev-php/parser/phpparser.h:28
#8  0x00007fc3255fbd44 in Php::Parser::parseStatement (this=0x50df6f0, yynode=0x7fc29fff48c8) at /home/gberg/development/build/other/kde/kdev-php/parser/phpparser.cpp:9466
#9  0x00007fc3255fc9a8 in Php::Parser::parseStatement (this=0x50df6f0, yynode=0x7fc29fff5148) at /home/gberg/development/build/other/kde/kdev-php/parser/phpparser.cpp:9659
#10 0x00007fc325604496 in Php::Parser::parseTopStatement (this=0x50df6f0, yynode=0x7fc29fff52f0) at /home/gberg/development/build/other/kde/kdev-php/parser/phpparser.cpp:11439
#11 0x00007fc3255f7fa7 in Php::Parser::parseOuterTopStatement (this=0x50df6f0, yynode=0x7fc29fff5358) at /home/gberg/development/build/other/kde/kdev-php/parser/phpparser.cpp:8209
#12 0x00007fc3255faf2f in Php::Parser::parseStart (this=0x50df6f0, yynode=0x7fc29fff53a8) at /home/gberg/development/build/other/kde/kdev-php/parser/phpparser.cpp:9319
#13 0x00007fc32561ef2b in Php::ParseSession::parse (this=0x7fc29fff5640, ast=0x7fc29fff5768) at /home/gberg/development/src/other/kde/kdev-php/parser/parsesession.cpp:124
#14 0x00007fc325af1656 in Php::ParseJob::run (this=0x50dd970) at /home/gberg/development/src/other/kde/kdev-php/phpparsejob.cpp:122
#15 0x00007fc34e71e111 in ThreadWeaver::JobRunHelper::runTheJob (this=0x7fc29fff5c20, th=0x2108a50, job=0x50dd970) at /home/gberg/development/src/other/kde/kdelibs/threadweaver/Weaver/Job.cpp:106
#16 0x00007fc34e71e381 in ThreadWeaver::Job::execute (this=0x50dd970, th=0x2108a50) at /home/gberg/development/src/other/kde/kdelibs/threadweaver/Weaver/Job.cpp:135
#17 0x00007fc34e720ce3 in ThreadWeaver::JobCollection::execute (this=0x50dd970, t=0x2108a50) at /home/gberg/development/src/other/kde/kdelibs/threadweaver/Weaver/JobCollection.cpp:210
#18 0x00007fc34e71d5b2 in ThreadWeaver::ThreadRunHelper::run (this=0x7fc29fff5d30, parent=0x1754120, th=0x2108a50) at /home/gberg/development/src/other/kde/kdelibs/threadweaver/Weaver/Thread.cpp:95
#19 0x00007fc34e71d81f in ThreadWeaver::Thread::run (this=0x2108a50) at /home/gberg/development/src/other/kde/kdelibs/threadweaver/Weaver/Thread.cpp:142
#20 0x00007fc34ba48035 in QThreadPrivate::start (arg=0x2108a50) at thread/qthread_unix.cpp:320
#21 0x00007fc33eb08ae3 in ?? () from /usr/lib/libGL.so.1
#22 0x00007fc34b7a78ba in start_thread (arg=<value optimized out>) at pthread_create.c:300
#23 0x00007fc349e203cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#24 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7fc29f7f5700 (LWP 6285)):
#0  __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:136
#1  0x00007fc34b7aa0e9 in _L_lock_953 () from /lib/libpthread.so.0
#2  0x00007fc34b7a9f0b in __pthread_mutex_lock (mutex=0x131b4e8) at pthread_mutex_lock.c:61
#3  0x00007fc343fcf7cd in g_main_context_wakeup () from /lib/libglib-2.0.so.0
#4  0x00007fc34bb33cab in QCoreApplication::postEvent (receiver=0x7fc34fcfcea0, event=0x50e4ea0, priority=0) at kernel/qcoreapplication.cpp:1194
#5  0x00007fc34bb3996f in QMetaMethod::invoke (this=<value optimized out>, object=<value optimized out>, connectionType=<value optimized out>, returnValue=..., val0=..., val1=..., val2=..., val3=..., val4=..., val5=..., val6=..., val7=..., val8=..., val9=...) at kernel/qmetaobject.cpp:1618
#6  0x00007fc34bb3a4f8 in QMetaObject::invokeMethod (obj=0x7fc34fcfcea0, member=<value optimized out>, type=Qt::QueuedConnection, ret=..., val0=..., val1=..., val2=..., val3=..., val4=..., val5=..., val6=..., val7=..., val8=..., val9=...) at kernel/qmetaobject.cpp:1151
#7  0x00007fc34fade648 in QMetaObject::invokeMethod (obj=0x7fc34fcfcea0, member=0x7fc34faeea39 "doInternalSlot", type=Qt::QueuedConnection, val0=..., val1=..., val2=..., val3=..., val4=..., val5=..., val6=..., val7=..., val8=..., val9=...) at /usr/include/qt4/QtCore/qobjectdefs.h:408
#8  0x00007fc34faddcf4 in KDevelop::ForegroundLock::relock (this=0x7fc29f7f41bf) at /home/gberg/development/src/other/kde/kdevplatform/interfaces/foregroundlock.cpp:183
#9  0x00007fc34fadd91c in KDevelop::ForegroundLock::ForegroundLock (this=0x7fc29f7f41bf, lock=true) at /home/gberg/development/src/other/kde/kdevplatform/interfaces/foregroundlock.cpp:142
#10 0x00007fc347e505a8 in KDevelop::ParseJob::readContents (this=0x50e1020) at /home/gberg/development/src/other/kde/kdevplatform/language/backgroundparser/parsejob.cpp:219
#11 0x00007fc325af1559 in Php::ParseJob::run (this=0x50e1020) at /home/gberg/development/src/other/kde/kdev-php/phpparsejob.cpp:109
#12 0x00007fc34e71e111 in ThreadWeaver::JobRunHelper::runTheJob (this=0x7fc29f7f4c20, th=0x2c4c280, job=0x50e1020) at /home/gberg/development/src/other/kde/kdelibs/threadweaver/Weaver/Job.cpp:106
#13 0x00007fc34e71e381 in ThreadWeaver::Job::execute (this=0x50e1020, th=0x2c4c280) at /home/gberg/development/src/other/kde/kdelibs/threadweaver/Weaver/Job.cpp:135
#14 0x00007fc34e720ce3 in ThreadWeaver::JobCollection::execute (this=0x50e1020, t=0x2c4c280) at /home/gberg/development/src/other/kde/kdelibs/threadweaver/Weaver/JobCollection.cpp:210
#15 0x00007fc34e71d5b2 in ThreadWeaver::ThreadRunHelper::run (this=0x7fc29f7f4d30, parent=0x1754120, th=0x2c4c280) at /home/gberg/development/src/other/kde/kdelibs/threadweaver/Weaver/Thread.cpp:95
#16 0x00007fc34e71d81f in ThreadWeaver::Thread::run (this=0x2c4c280) at /home/gberg/development/src/other/kde/kdelibs/threadweaver/Weaver/Thread.cpp:142
#17 0x00007fc34ba48035 in QThreadPrivate::start (arg=0x2c4c280) at thread/qthread_unix.cpp:320
#18 0x00007fc33eb08ae3 in ?? () from /usr/lib/libGL.so.1
#19 0x00007fc34b7a78ba in start_thread (arg=<value optimized out>) at pthread_create.c:300
#20 0x00007fc349e203cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#21 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7fc3504157a0 (LWP 6260)):
#0  0x00007fc34b7af0bd in read () at ../sysdeps/unix/syscall-template.S:82
#1  0x00007fc343fd1cb5 in g_main_context_check () from /lib/libglib-2.0.so.0
#2  0x00007fc343fd26e3 in ?? () from /lib/libglib-2.0.so.0
#3  0x00007fc343fd2b1c in g_main_context_iteration () from /lib/libglib-2.0.so.0
#4  0x00007fc34bb5bd8f in QEventDispatcherGlib::processEvents (this=0x12ede50, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:422
#5  0x00007fc34ad5c4de in QGuiEventDispatcherGlib::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#6  0x00007fc34bb30022 in QEventLoop::processEvents (this=<value optimized out>, flags=...) at kernel/qeventloop.cpp:149
#7  0x00007fc34bb3026c in QEventLoop::exec (this=0x7fff2a5a9330, flags=...) at kernel/qeventloop.cpp:201
#8  0x00007fc34bb3476b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1008
#9  0x000000000040b83c in main (argc=1, argv=0x7fff2a5ab4d8) at /home/gberg/development/src/other/kde/kdevelop/app/main.cpp:474

Reported using DrKonqi
Comment 1 Milian Wolff 2011-04-01 11:37:14 UTC
Jonathan, can you look at that please? It's easily reproducible and I have no idea whats the issue. Well, except that mBufferIndex overflows mBufferSize quite a lot. But why and why is it not cached?

Furthermore the debug info is totally borked for me, neither valgrind nor gdb show me correct line numbers in the backtrace...
Comment 2 Milian Wolff 2011-04-06 18:00:24 UTC
fixed with kdevelop-pg-qt 0.9.5. release will be announced later