Bug 102093 - Kdevelop crashes when a type a single character in the CTags plugin's lookup text box
Summary: Kdevelop crashes when a type a single character in the CTags plugin's lookup ...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: CTags (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-21 15:45 UTC by Vadym Krevs
Modified: 2005-07-23 16:47 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
ctags index file (440 bytes, text/plain)
2005-07-02 00:18 UTC, Maciej Witaszek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vadym Krevs 2005-03-21 15:45:53 UTC
Version:           unknown (using KDE 3.4.0 Level "a" , SUSE 9.2 UNSUPPORTED)
Compiler:          gcc version 3.3.4 (pre 3.3.5 20040809)
OS:                Linux (x86_64) release 2.6.8-24.11-smp

I've regenerated the CTags database for a 10K file C/C++ project, and tried using the CTags plugin to search for the symbol "ServerProcess". As soon as I typed a capital S (while Shift was pressed), KDevelop crashed with the stack trace shown below. Havign restarted, I tried typing in a lowercase s - nothing crashes. As soon as I typed an uppercase S again, Kdeveloper crashed again. Tried deleting and regenerating the CTags database - no joy. Tried searching for other uppercase letters - no crashes.


Using host libthread_db library "/lib64/tls/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 182988493600 (LWP 1149)]
[New Thread 1075837280 (LWP 1483)]
[Thread debugging using libthread_db enabled]
[New Thread 182988493600 (LWP 1149)]
[New Thread 1075837280 (LWP 1483)]
[Thread debugging using libthread_db enabled]
[New Thread 182988493600 (LWP 1149)]
[New Thread 1075837280 (LWP 1483)]
[KCrash handler]
#3  0x0000002a9fd9cb60 in parseTagLine ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#4  0x0000002a9fd9cdcd in readNext ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#5  0x0000002a9fd9ce0b in tagsNext ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#6  0x0000002a9fd9ce65 in tagsFindNext ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#7  0x0000002a9fda0bce in Tags::numberOfMatches ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#8  0x0000002a9fda0bfe in Tags::numberOfPartialMatches ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#9  0x0000002a9fda0c2c in CTags2Widget::calculateHitCount ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#10 0x0000002a9fda1579 in CTags2Widget::line_edit_changed_delayed ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#11 0x0000002a9fd9dd74 in CTags2WidgetBase::qt_invoke ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#12 0x0000002a9fda2d14 in CTags2Widget::qt_invoke ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#13 0x0000002a98f5e909 in QObject::activate_signal ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#14 0x0000002a98f5eb95 in QObject::activate_signal ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#15 0x0000002a99246395 in QLineEdit::textChanged ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#16 0x0000002a990165b5 in QLineEditPrivate::finishChange ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#17 0x0000002a99016e0c in QLineEdit::insert ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#18 0x0000002a99017720 in QLineEdit::keyPressEvent ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#19 0x0000002a98f8d5ed in QWidget::event ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#20 0x0000002a99016b57 in QLineEdit::event ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#21 0x0000002a98f06c2d in QApplication::internalNotify ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#22 0x0000002a98f08949 in QApplication::notify ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#23 0x0000002a9837134c in KApplication::notify ()
   from /opt/kde3/lib64/libkdecore.so.4
#24 0x0000002a98ea4a83 in QETWidget::translateKeyEvent ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#25 0x0000002a98eafeef in QApplication::x11ProcessEvent ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#26 0x0000002a98ebe653 in QEventLoop::processEvents ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#27 0x0000002a98f1c2f1 in QEventLoop::enterLoop ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#28 0x0000002a98f1c162 in QEventLoop::exec ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#29 0x0000002a98f08475 in QApplication::exec ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#30 0x000000000040808d in main ()

Using host libthread_db library "/lib64/tls/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 182988493600 (LWP 1149)]
[New Thread 1075837280 (LWP 1483)]
[Thread debugging using libthread_db enabled]
[New Thread 182988493600 (LWP 1149)]
[New Thread 1075837280 (LWP 1483)]
[Thread debugging using libthread_db enabled]
[New Thread 182988493600 (LWP 1149)]
[New Thread 1075837280 (LWP 1483)]
[KCrash handler]
#3  0x0000002a9fd9cb60 in parseTagLine ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#4  0x0000002a9fd9cdcd in readNext ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#5  0x0000002a9fd9ce0b in tagsNext ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#6  0x0000002a9fd9ce65 in tagsFindNext ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#7  0x0000002a9fda0bce in Tags::numberOfMatches ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#8  0x0000002a9fda0bfe in Tags::numberOfPartialMatches ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#9  0x0000002a9fda0c2c in CTags2Widget::calculateHitCount ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#10 0x0000002a9fda1579 in CTags2Widget::line_edit_changed_delayed ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#11 0x0000002a9fd9dd74 in CTags2WidgetBase::qt_invoke ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#12 0x0000002a9fda2d14 in CTags2Widget::qt_invoke ()
   from /opt/kde3/lib64/kde3/libkdevctags2.so
#13 0x0000002a98f5e909 in QObject::activate_signal ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#14 0x0000002a98f5eb95 in QObject::activate_signal ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#15 0x0000002a99246395 in QLineEdit::textChanged ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#16 0x0000002a990165b5 in QLineEditPrivate::finishChange ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#17 0x0000002a99016e0c in QLineEdit::insert ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#18 0x0000002a99017720 in QLineEdit::keyPressEvent ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#19 0x0000002a98f8d5ed in QWidget::event ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#20 0x0000002a99016b57 in QLineEdit::event ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#21 0x0000002a98f06c2d in QApplication::internalNotify ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#22 0x0000002a98f08949 in QApplication::notify ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#23 0x0000002a9837134c in KApplication::notify ()
   from /opt/kde3/lib64/libkdecore.so.4
#24 0x0000002a98ea4a83 in QETWidget::translateKeyEvent ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#25 0x0000002a98eafeef in QApplication::x11ProcessEvent ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#26 0x0000002a98ebe653 in QEventLoop::processEvents ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#27 0x0000002a98f1c2f1 in QEventLoop::enterLoop ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#28 0x0000002a98f1c162 in QEventLoop::exec ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#29 0x0000002a98f08475 in QApplication::exec ()
   from /usr/lib/qt3/lib64//libqt-mt.so.3
#30 0x000000000040808d in main ()
Comment 1 Jens Dagerbo 2005-03-22 10:19:26 UTC
Hmm..

Does it work at all and the crash is a special case? Do you have any hits from the lowercase 's'? Is the problem specific to this project, or does the same problem occur on all projects? Can you look up the "ServerProcess" string via the context menu without crashing?

What exuberant-ctags version are you using? Are you using a custom tags database creation command?
Comment 2 Vadym Krevs 2005-03-24 14:38:32 UTC
Hi Jens. Thanks for the prompt response. 

It works most of the time. The crash seems to be a special case - thought I've only checked about 10 letters of the English alphabet :-) The project gives 1570 hits for the lowercase 's'. The crash occurs in all projects that I've got - represent 3 successive releases of the same applications, and are thus roughly the same in size/structure (~10K files). Looking up "ServerProcess" via the context menu works like a treat. And I do not use a custom tags database creation command - - just whatever is the default for Kdevelop 3.2.0.

$ ctags --version
Exuberant Ctags 5.5.4, Copyright (C) 1996-2003 Darren Hiebert
  Compiled: Oct  2 2004, 02:56:44
  Addresses: <dhiebert@users.sourceforge.net>, http://ctags.sourceforge.net
  Optional compiled features: +wildcards, +regex

Comment 3 Maciej Witaszek 2005-07-02 00:18:12 UTC
Created attachment 11649 [details]
ctags index file
Comment 4 Maciej Witaszek 2005-07-02 00:33:44 UTC
Hi.
I confirme a bug with ctags, but it depends on content of index file generated by ctags rather than number of tags. I have a project with 17k files, ctags index file has 700k rows. I see a crash only which letters: T, C, M. Other words work well.
I attache a ctag index with only one tag (started with T letter) that cause kdeveloper to crash. The problem is with two backslashes ("\\") in the tag row. If I remove them kdevelop works well.
Comment 5 Jens Dagerbo 2005-07-06 23:27:20 UTC
Wow, a perfect testcase! :)

Debugging through the crash confirms what would be suspected from the posted backtrace: The bug is in the readtags.c file supplied by Exuberant Ctags which we use to read its database.

It should be easy to stop the bug from crashing us now, but it will leave the lookup algorithm "lossy". The real problem here is that Exuberant Ctags creates a database that it itself finds to contain "invalid patterns".
Comment 6 Jens Dagerbo 2005-07-07 01:47:50 UTC
Maciej, could you please paste full source line that results in that entry in the ctags database? I'm curious to see what causes ctags to generate faulty entries.

Comment 7 Jens Dagerbo 2005-07-23 16:47:33 UTC
Fixed (workaround) with SVN commit 437861 in trunk.