Bug 73116 - Kdevelop crashes when typing a dot at the end of a comment
Summary: Kdevelop crashes when typing a dot at the end of a comment
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: 3.0.0
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-21 11:27 UTC by tulkas
Modified: 2014-04-24 06:53 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 tulkas 2004-01-21 11:27:12 UTC
Version:           3.0.0 (using KDE 3.1.5)
Installed from:    Gentoo
Compiler:          gcc version 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7)
OS:          Linux (i686) release 2.4.23_pre8-gss

This first occured to me when working on a C++ - header-file which was written by someone else: When I was writing a doxygen-formatted comment and came to the end of the line, Kdevelop crashed when I typed a dot ('.').
Kdevelop did not save any changes I had done before and, strangely enough, this behaviour can be reproduced again and again.
Since I'm not the file's author, I don't want to post it completely, but here is a shortened version which does roughly the same to Kdevelop:

----------8<--------------------

class sAbstrakteFahrzeugdaten : VERWENDE_SCHNITTSTELLE(Schnittstelle)
{
    DEKLARIERE_SCHNITTSTELLE(sAbstrakteFahrzeugdaten);
public:
    //////////////////////////////////////////////////////////////////////
    /// Liefert die Fahrzeugbeschreibung für die diese Daten gültig sind
    /// @result Die zugehörige Fahrzeugbeschreibung.
    //--------------------------------------------------------------------
    virtual sAbstrakteFahrzeugbeschreibung::Zeiger  fahrzeugbeschreibung() = 0;
}

----------8<--------------------

When I go to the line in the comment which ends on "gültig sind" and type an additional dot, nothing happens, neither in this short header-file nor in the long version.
But if (in the above file) I type a dot at the end of the line, press backspace and then again type a dot, Kdevelop crashes.
In the original file it's even more annoying: if there is already a dot there (at the end of the comment-line), I can write whatever I want, but if there is no dot, typing a dot will immediately cause kdevelop to crash. If I type a comma or any letter, nothing strange happens, just the dot causes the crash (although I think I once did it with an opening bracket ('('), too).
If the comment-block is before the keyword 'class', it is absolutely crash-proof; the mentioned behaviour just affects comments in the class{}- block.

Hmm, there are some other things that might be worth mentioning since I don't have the slightest idea what causes the crash:
- Kate deals with the same situation without any problems, so I guess it's not an editor-problem.
- The crash happens in files in a project as well as single, independent files
- The crash happened in kdevelop 3.0.0beta1 and beta2, too
- Turning off syntax highlighting doesn't help

Here is the Backtrace of what happens in the case of the above shown file:

----------8<--------------------

(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...[New Thread 16384 (LWP 1658)]
[New Thread 32769 (LWP 1669)]
[New Thread 16386 (LWP 1670)]

0x41534c2b in waitpid () from /lib/libpthread.so.0
#0  0x41534c2b in waitpid () from /lib/libpthread.so.0
#1  0x40cafad4 in __JCR_LIST__ () from /usr/kde/3.1/lib/libkdecore.so.4
#2  0x41533a35 in __pthread_sighandler () from /lib/libpthread.so.0
#3  <signal handler called>
#4  0x4124449e in QGList::QGList(QGList const&) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#5  0x4689bc50 in CppCodeCompletion::completeText() ()
   from /usr/lib/kde3/libkdevcppsupport.so
#6  0x46897a84 in CppCodeCompletion::slotTimeout() ()
   from /usr/lib/kde3/libkdevcppsupport.so
#7  0x468a52d9 in CppCodeCompletion::qt_invoke(int, QUObject*) ()
   from /usr/lib/kde3/libkdevcppsupport.so
#8  0x40fa211c in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#9  0x40fa1f54 in QObject::activate_signal(int) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#10 0x412c22cb in QTimer::timeout() () from /usr/qt/3/lib/libqt-mt.so.3
#11 0x40fc30a2 in QTimer::event(QEvent*) () from /usr/qt/3/lib/libqt-mt.so.3
#12 0x40f46cff in QApplication::internalNotify(QObject*, QEvent*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#13 0x40f460cb in QApplication::notify(QObject*, QEvent*) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#14 0x40b9f52a in KApplication::notify(QObject*, QEvent*) ()
   from /usr/kde/3.1/lib/libkdecore.so.4
#15 0x40f366d5 in QEventLoop::activateTimers() ()
   from /usr/qt/3/lib/libqt-mt.so.3
#16 0x40ef30fd in QEventLoop::processEvents(unsigned) ()
   from /usr/qt/3/lib/libqt-mt.so.3
#17 0x40f5a3a8 in QEventLoop::enterLoop() () from /usr/qt/3/lib/libqt-mt.so.3
#18 0x40f5a258 in QEventLoop::exec() () from /usr/qt/3/lib/libqt-mt.so.3
#19 0x40f46f51 in QApplication::exec() () from /usr/qt/3/lib/libqt-mt.so.3
#20 0x08062bc8 in QGListIterator::~QGListIterator() ()
#21 0x4168fc3c in __libc_start_main () from /lib/libc.so.6

----------8<--------------------

I hope that this description is sufficient, if not, I am more than willing to give additional info.
Comment 1 tulkas 2004-01-21 11:30:59 UTC
Oops, I realised a bit too late that my kdevelop-version isn't shown there, it's kdevelop-3.0.0_rc1.
Comment 2 Jens Dagerbo 2004-01-21 12:45:02 UTC
Verified. 
Comment 3 Jens Dagerbo 2004-01-21 13:17:50 UTC
Subject: kdevelop/languages/cpp

CVS commit by dagerbo: 

Quick fix for bug 73116. 
The parser gets confused sometimes, better have a sanity check.

CCMAIL: 73116-done@bugs.kde.org


  M +7 -1      cppcodecompletion.cpp   1.142


--- kdevelop/languages/cpp/cppcodecompletion.cpp  #1.141:1.142
@@ -789,5 +789,11 @@ CppCodeCompletion::completeText( )
 
                     QStringList nested;
-                    QPtrList<ClassOrNamespaceNameAST> l = name->classOrNamespaceNameList();
+                        
+                    QPtrList<ClassOrNamespaceNameAST> l;
+                        if ( name )
+                        {
+                                l = name->classOrNamespaceNameList();
+                        }
+//                  QPtrList<ClassOrNamespaceNameAST> l = name->classOrNamespaceNameList();
                     QPtrListIterator<ClassOrNamespaceNameAST> nameIt( l );
                     while( nameIt.current() ){


Comment 4 dypang 2014-04-23 22:51:08 UTC
The same here. It does not always crash when I press the dot key, but it happens rather frequently and unexpectedly. It is really annoying. It has been around 2 months.
Comment 5 Kevin Funk 2014-04-24 06:53:48 UTC
@dypang: This bug report is over 10 years old(!). Please report your problem in a new one and attach a backtrace.