Bug 70135

Summary: Random crash editing large C++ files (10,000 line)
Product: [Applications] kdevelop Reporter: John A. Sullivan III <john.sullivan>
Component: generalAssignee: KDevelop Developers <kdevelop-devel>
Status: RESOLVED DUPLICATE    
Severity: crash    
Priority: NOR    
Version: 3.0.0b2   
Target Milestone: ---   
Platform: RedHat Enterprise Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description John A. Sullivan III 2003-12-11 15:50:09 UTC
Version:           v.3 beta2 (using KDE KDE 3.1)
Installed from:    RedHat RPMs
Compiler:          gcc 3.2.2-5 
OS:          Linux

I am coding on a PIII 750 with 256MB RAM.  Crashes are such a problem that I save every few words that I type.  It appears to be a problem only in the larger files.  I have not taken the time to narrow down the cause.  They seem to come in two flavors.

One seems to be related to auto-completion.  That may explain the correlation to file size if it is trying to process a very large number of remembered words.  Sometimes it appears to be struggling with auto-completion -- taking a long time to display what has been typed.  Sometimes it just crashes with no warning.

The other type almost seems to have something to do with the mouse pointer in the far left margin or typing at the margin.  This is far less frequent.

There are two other variants on these two flavors.
In one case, KDevelop just vanishes -- no trace anywhere.
In the other case, KDevelop is still running and is consuming an enormous amount of CPU processing time.  In fact, two processes are running but only one is spinning.  The other is idle.

Here is a backtrace:

[New Thread 16384 (LWP 2645)]
[New Thread 32769 (LWP 2675)]
[New Thread 16386 (LWP 2676)]
0x4142976a in waitpid () from /lib/i686/libpthread.so.0
#0  0x4142976a in waitpid () from /lib/i686/libpthread.so.0
#1  0x40a8857d in KCrash::defaultCrashHandler(int) ()
   from /usr/lib/libkdecore.so.4
#2  0x4142867e in __pthread_sighandler () from /lib/i686/libpthread.so.0
#3  <signal handler called>
#4  0x42365954 in KSharedPtr<TextLine>::operator=(KSharedPtr<TextLine> const&)
    () from /usr/lib/kde3/libkatepart.so
#5  0x422ee981 in KateBufBlock::flushStringList() ()
   from /usr/lib/kde3/libkatepart.so
#6  0x422ec418 in KateBuffer::checkDirtyMax() ()
   from /usr/lib/kde3/libkatepart.so
#7  0x422ec5b8 in KateBuffer::dirtyBlock(KateBufBlock*) ()
   from /usr/lib/kde3/libkatepart.so
#8  0x422ed52f in KateBuffer::updateHighlighting(unsigned, unsigned, bool) ()
   from /usr/lib/kde3/libkatepart.so
#9  0x422ed5e6 in KateBuffer::slotBufferUpdateHighlight(unsigned, unsigned) ()
   from /usr/lib/kde3/libkatepart.so
#10 0x422eba33 in KateBuffer::qt_invoke(int, QUObject*) ()
   from /usr/lib/kde3/libkatepart.so
#11 0x40edb0c9 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#12 0x422eb547 in KateBuffer::pleaseHighlight(unsigned, unsigned) ()
   from /usr/lib/kde3/libkatepart.so
#13 0x422ecde1 in KateBuffer::line(unsigned) ()
   from /usr/lib/kde3/libkatepart.so
#14 0x422eddd6 in KateBuffer::text() () from /usr/lib/kde3/libkatepart.so
#15 0x4230528f in KateDocument::text() const ()
   from /usr/lib/kde3/libkatepart.so
#16 0x41e4843f in KDevSourceProvider::contents(QString const&) ()
   from /usr/local/kde/lib/kde3/libkdevcppsupport.so
#17 0x41f755ea in Driver::parseFile(QString const&, bool, bool) ()
   from /usr/local/kde/lib/libkdevcppparser.so.0
#18 0x41e467de in BackgroundParser::parseFile(QString const&, bool, bool) ()
   from /usr/local/kde/lib/kde3/libkdevcppsupport.so
#19 0x41e47197 in BackgroundParser::run() ()
   from /usr/local/kde/lib/kde3/libkdevcppsupport.so
#20 0x40e71c78 in QProc::~QProc() () from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#21 0x41423a21 in pthread_start_thread () from /lib/i686/libpthread.so.0
Comment 1 Amilcar do Carmo Lucas 2003-12-11 17:51:35 UTC
This bt looks Kate to me!
Comment 2 Christoph Cullmann 2003-12-11 18:00:18 UTC
sorry, but you should keep in mind: none of your editor parts is threadsafe, therefor: take care what you do with them from threads ;) if the background parser no longer uses threads, sorry, reassign it back
Comment 3 John A. Sullivan III 2003-12-11 19:54:13 UTC
I may have been misleading about the CPU spinning.  It just crashed again on me and the KDevelop process was spinning but I did not close the crash screen that popped up as I normally do. I let it run to get another backtrace. Once the backtrace finished running, the CPU quieted down.  I am running the latest KDE for RedHat 9.0 (updated regularly via Ximian Red-Carpet.  Here is the backtrace:

[New Thread 16384 (LWP 2873)]
[New Thread 32769 (LWP 2901)]
[New Thread 16386 (LWP 2902)]
0x4142976a in waitpid () from /lib/i686/libpthread.so.0
#0  0x4142976a in waitpid () from /lib/i686/libpthread.so.0
#1  0x40a8857d in KCrash::defaultCrashHandler(int) ()
   from /usr/lib/libkdecore.so.4
#2  0x4142867e in __pthread_sighandler () from /lib/i686/libpthread.so.0
#3  <signal handler called>
#4  0x422eec9b in KateBufBlock::line(unsigned) ()
   from /usr/lib/kde3/libkatepart.so
#5  0x422ecf9f in KateBuffer::needHighlight(KateBufBlock*, unsigned, unsigned)
    () from /usr/lib/kde3/libkatepart.so
#6  0x422ed4fe in KateBuffer::updateHighlighting(unsigned, unsigned, bool) ()
   from /usr/lib/kde3/libkatepart.so
#7  0x422ed5e6 in KateBuffer::slotBufferUpdateHighlight(unsigned, unsigned) ()
   from /usr/lib/kde3/libkatepart.so
#8  0x422eba33 in KateBuffer::qt_invoke(int, QUObject*) ()
   from /usr/lib/kde3/libkatepart.so
#9  0x40edb0c9 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#10 0x422eb547 in KateBuffer::pleaseHighlight(unsigned, unsigned) ()
   from /usr/lib/kde3/libkatepart.so
#11 0x422ecde1 in KateBuffer::line(unsigned) ()
   from /usr/lib/kde3/libkatepart.so
#12 0x422eddd6 in KateBuffer::text() () from /usr/lib/kde3/libkatepart.so
#13 0x4230528f in KateDocument::text() const ()
   from /usr/lib/kde3/libkatepart.so
#14 0x41e4843f in KDevSourceProvider::contents(QString const&) ()
   from /usr/local/kde/lib/kde3/libkdevcppsupport.so
#15 0x41f755ea in Driver::parseFile(QString const&, bool, bool) ()
   from /usr/local/kde/lib/libkdevcppparser.so.0
#16 0x41e467de in BackgroundParser::parseFile(QString const&, bool, bool) ()
   from /usr/local/kde/lib/kde3/libkdevcppsupport.so
#17 0x41e47197 in BackgroundParser::run() ()
   from /usr/local/kde/lib/kde3/libkdevcppsupport.so
#18 0x40e71c78 in QProc::~QProc() () from /usr/lib/qt-3.1/lib/libqt-mt.so.3
#19 0x41423a21 in pthread_start_thread () from /lib/i686/libpthread.so.0
Comment 4 Hamish Rodda 2003-12-12 00:14:22 UTC
From the backtrace it looks to me like Kate from KDE 3.1 requests highlighting on text delivered by the EditInterface.  From a quick review of the 3.2 code, this doesn't happen, so I would advise that you upgrade your kate to 3.2, or replace all calls to KateBuffer::line(unsigned) inside KateBuffer::text() with KateBuffer::plainLine(unsigned)...
Comment 5 Jens Dagerbo 2003-12-16 23:52:54 UTC
John, if you have happen to have started to build from CVS.. please update to latest and see if the problem is solved for you. This could perhaps, maybe, possibly be fixed now. :)
Comment 6 Jens Dagerbo 2003-12-17 00:52:41 UTC
Hmm.. I just realized we have two of these.. Closing as dupe.

*** This bug has been marked as a duplicate of 62137 ***