Bug 113940 - Ctrl+space crashes Kdevelop with PHP
Summary: Ctrl+space crashes Kdevelop with PHP
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: PHP (other bugs)
Version First Reported In: 3.2.91
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
: 137340 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-10-06 04:01 UTC by Niels
Modified: 2007-01-14 17:18 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Niels 2005-10-06 04:01:18 UTC
Version:           3.2.91 (using KDE 3.4.91 (beta1, >= 20050910), Gentoo)
Compiler:          gcc version 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)
OS:                Linux (i686) release 2.6.12-gentoo-r6

I'm using Kdevelop for PHP.

I've got "Enable realtime parser" turned off (Bug 113690).
I've got "Enable code completion" and "Enable code hinting" turned off, because one of those makes the editor unusably slow.

If I now press Ctrl+Space, Kdevelop crashes. Every time.

Backtrace:

Using host libthread_db library "/lib/libthread_db.so.1".
`system-supplied DSO at 0xffffe000' has disappeared; keeping its symbols.
[Thread debugging using libthread_db enabled]
[New Thread -1208760128 (LWP 1754)]
[New Thread -1217483856 (LWP 1755)]
[KCrash handler]
#4  0xb78be8f7 in PHPCodeCompletion::cursorPositionChanged (this=0x88b2658)
    at phpcodecompletion.cpp:131
#5  0xb78c3b93 in PHPCodeCompletion::qt_invoke (this=0x88b2658, _id=2, _o=0x2)
    at phpcodecompletion.moc:86
#6  0x47a63510 in QObject::activate_signal (this=0x895a838, clist=0x88b3488, 
    o=0xbfddfb50) at qobject.cpp:2355
#7  0x47a63368 in QObject::activate_signal (this=0x895a838, signal=2)
    at qobject.cpp:2324
#8  0x484fba1f in KAction::activated (this=0x2) at kaction.moc:176
#9  0x484fb0fa in KAction::slotActivated (this=0x895a838) at kaction.cpp:1102
#10 0x484fbdd7 in KAction::qt_invoke (this=0x895a838, _id=1214974376, 
    _o=0xbfddfc70) at kaction.moc:218
#11 0x47a63510 in QObject::activate_signal (this=0x895d360, clist=0x9396b80, 
    o=0xbfddfc70) at qobject.cpp:2355
#12 0x47a63368 in QObject::activate_signal (this=0x895d360, signal=2)
    at qobject.cpp:2324
#13 0x481f5b5f in KAccelPrivate::menuItemActivated (this=0x2)
    at kaccelprivate.moc:110
#14 0x481f3f0e in KAccelPrivate::emitActivatedSignal (this=0x895d360, 
    pAction=0x895d480) at kaccel.cpp:378
#15 0x481f3cfb in KAccelPrivate::eventFilter (this=0x895d360, 
    pEvent=0xbfde0170) at kaccel.cpp:350
#16 0x47a6083a in QObject::activate_filters (this=0x81e8210, e=0xbfde0170)
    at qobject.cpp:902
#17 0x47a606b7 in QObject::event (this=0x81e8210, e=0xbfde0170)
    at qobject.cpp:735
#18 0x47aa68c3 in QWidget::event (this=0x81e8210, e=0xbfde0170)
    at qwidget.cpp:4658
#19 0x47b89216 in QMainWindow::event (this=0x81e8210, e=0xbfde0170)
    at qmainwindow.cpp:1686
#20 0x479f30a5 in QApplication::internalNotify (this=0xbfde06e0, 
    receiver=0x81e8210, e=0xbfde0170) at qapplication.cpp:2635
#21 0x479f2440 in QApplication::notify (this=0xbfde06e0, receiver=0x8f33f48, 
    e=0xbfde0170) at qapplication.cpp:2392
#22 0x4818e557 in KApplication::notify (this=0xbfde06e0, receiver=0x8f33f48, 
    event=0xbfde0170) at kapplication.cpp:550
#23 0x4954b756 in QApplication::sendEvent (receiver=0x2, event=0x6e0069)
    at qapplication.h:491
#24 0x481f2a4a in KAccelEventHandler::x11Event (this=0x81e1638, 
    pEvent=0x483124ec) at kaccel.cpp:144
#25 0x4829f50a in KAppX11HackWidget::publicx11Event (this=0xbfddf9fc, e=0x2)
    at kapplication.cpp:1652
#26 0x481933e0 in KApplication::x11EventFilter (this=0xbfde06e0, 
    _event=0xbfde0510) at kapplication.cpp:1722
#27 0x47962955 in qt_x11EventFilter (ev=0xbfde0510)
    at qapplication_x11.cpp:386
#28 0x4796e6bb in QApplication::x11ProcessEvent (this=0xbfde06e0, 
    event=0xbfde0510) at qapplication_x11.cpp:3308
#29 0x4798cbc5 in QEventLoop::processEvents (this=0x8175f60, flags=4)
    at qeventloop_x11.cpp:192
#30 0x47a0a649 in QEventLoop::enterLoop (this=0x8175f60) at qeventloop.cpp:198
#31 0x47a0a562 in QEventLoop::exec (this=0x8175f60) at qeventloop.cpp:145
#32 0x479f3247 in QApplication::exec (this=0xbfde06e0)
    at qapplication.cpp:2758
#33 0x0804ebc2 in main (argc=2, argv=0x2) at main.cpp:145
Comment 1 Frank Osterfeld 2005-10-07 19:55:03 UTC
I can confirm this using current 3.5 branch (rev. 467250)
Comment 2 Philip Rodrigues 2006-11-15 00:18:59 UTC
*** Bug 137340 has been marked as a duplicate of this bug. ***
Comment 3 Andreas Pakulat 2007-01-14 16:44:41 UTC
I can't reproduce this bug in 3.4, if somebody can please re-open.
Comment 4 Andreas Pakulat 2007-01-14 16:50:03 UTC
Nice, just after closing it I managed to crash kdevelop. Re-opening. What I did was disabling the code-completion/hinting and also the realtime-parser. Then go to a member function of a class and type

return $this-><ctrl+space>.

Backtrace is the same is in the original report.
Comment 5 Andreas Pakulat 2007-01-14 17:18:02 UTC
SVN commit 623352 by apaku:

Don't try to access variables that might not have been initialized properly.
BUG: 113940


 M  +6 -4      phpcodecompletion.cpp  


--- branches/kdevelop/3.4/languages/php/phpcodecompletion.cpp #623351:623352
@@ -36,7 +36,7 @@
 
 using namespace std;
 
-PHPCodeCompletion::PHPCodeCompletion(PHPSupportPart *phpSupport, PHPConfigData *config) {
+PHPCodeCompletion::PHPCodeCompletion(PHPSupportPart *phpSupport, PHPConfigData *config) : QObject(), m_cursorInterface(0), m_codeInterface(0), m_editInterface(0), m_selectionInterface(0) {
 
    m_phpSupport = phpSupport;
    m_config = config;
@@ -128,6 +128,8 @@
 
 void PHPCodeCompletion::cursorPositionChanged(){
    uint line, col;
+   if( !m_cursorInterface || !m_selectionInterface || !m_codeInterface || !m_editInterface )
+      return;
    m_cursorInterface->cursorPositionReal(&line, &col);
 
    kdDebug(9018) << "cursorPositionChanged:" << line << ":" << col  << endl;
@@ -237,7 +239,7 @@
                e.prefix = nClass->name() + " ::";
                e.text = nFunc->name();
                ArgumentDom pArg = (*funcIt)->argumentList().first();
-               if (pArg) 
+               if (pArg)
                   e.postfix = "(" + pArg->type() +")";
                else
                   e.postfix = "()";
@@ -305,7 +307,7 @@
       list = getClasses(extends.cap(1));
       return showCompletionBox(list, extends.cap(1).length());
    }
-  
+
    return false;
 }
 
@@ -653,7 +655,7 @@
             m_codeInterface->showArgHint ( argsList, "()", "," );
             return true;
          }
-      }   
+      }
    }
 
    if (line.findRev("->") != -1) {