Bug 58260 - autospell checker has a massive memory leak - again...
Summary: autospell checker has a massive memory leak - again...
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR major
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-08 23:41 UTC by Ed Tomlinson
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
kspellfix.diff (1.41 KB, text/x-diff)
2003-05-11 07:46 UTC, Don Sanders
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Tomlinson 2003-05-08 23:41:13 UTC
Version:           1.5.9 (using KDE 3.1.9)
Compiler:          gcc version 3.2.3
OS:          Linux (i586) release 2.5.69-mm1

inserting files with lots of spelling 'errors' ie. something like the output of a large ksymoops (lots of traceback and a long code section) triggers this leak.  Either I
find a serial terminal fast or wait 5 mins or so for the kernel to oom.  In either case
kde and X are not usable...

Is there any way to disable the AUTO spell checker?  If not, why not?  

TIA
Ed Tomlinson
Comment 1 Ed Tomlinson 2003-05-08 23:43:05 UTC
kde and kmail from orth's .deb.  Kmail reports 1.5.9 (using kde 3.1.90 (CVS >= 20030422)) 
Comment 2 Don Sanders 2003-05-11 04:17:15 UTC
Subject: Re:  New: autospell checker has a massive memory leak -        again...

On Friday 09 May 2003 07:41, Ed Tomlinson wrote:
...
> inserting files with lots of spelling 'errors' ie. something like
> the output of a large ksymoops (lots of traceback and a long code
> section) triggers this leak.  Either I find a serial terminal fast
> or wait 5 mins or so for the kernel to oom.  In either case kde and
> X are not usable...

I think I know what the problem is. Scott the kspell problem still 
exists as discussed in the attached message. Are you able to look at 
it? If not please let me know and I'll spend some time investigating 
further.

> Is there any way to disable the AUTO spell checker?  If not, why
> not?

I guess as-you-type spell checking should be disabled by default if 
the kspell problem isn't fixed.

Don.
Hi Scott,

Ran into a problem today with spell checking. I tried to forward a 
large document to someone, and when I was typing in the composer 
KMail became less and less responsive, until it was unusable.

I fired up gdb on the KMail process and found it had got into a loop 
recursively calling a chain of functions, here's the backtrace:

#3230 0x40612057 in KProcIO::controlledEmission ()
   from /space/sanders/testkde/bin/lib/libkdecore.so.4
#3231 0x40612016 in KProcIO::ackRead ()
   from /space/sanders/testkde/bin/lib/libkdecore.so.4
#3232 0x419a3bde in KSpell::check2 ()
   from /space/sanders/testkde/bin/lib/libkspell.so.4
---Type <return> to continue, or q <return> to quit---
#3233 0x419a5c0d in KSpell::qt_invoke ()
   from /space/sanders/testkde/bin/lib/libkspell.so.4
#3234 0x409dbef5 in QObject::activate_signal ()
   from /home/sanders/kde/head/qt-copy/lib/libqt-mt.so.3
#3235 0x406126a5 in KProcIO::readReady ()
   from /space/sanders/testkde/bin/lib/libkdecore.so.4
#3236 0x40612057 in KProcIO::controlledEmission ()
   from /space/sanders/testkde/bin/lib/libkdecore.so.4
#3237 0x40612016 in KProcIO::ackRead ()
   from /space/sanders/testkde/bin/lib/libkdecore.so.4
#3238 0x419a3bde in KSpell::check2 ()
   from /space/sanders/testkde/bin/lib/libkspell.so.4
#3239 0x419a5c0d in KSpell::qt_invoke ()
   from /space/sanders/testkde/bin/lib/libkspell.so.4
#3240 0x409dbef5 in QObject::activate_signal ()
   from /home/sanders/kde/head/qt-copy/lib/libqt-mt.so.3
#3241 0x406126a5 in KProcIO::readReady ()
   from /space/sanders/testkde/bin/lib/libkdecore.so.4
#3242 0x40612057 in KProcIO::controlledEmission ()
   from /space/sanders/testkde/bin/lib/libkdecore.so.4

and so on ....

So there seems to be some kind of hard to reproduce race condition 
here between kspell and kprocio.

Scanning the kspell source quickly I see that unlike every other 
OUTPUT there's no matching NOOUTPUT for the OUTPUT(check2). I'm 
wondering if this is perhaps related somehow but I don't really have 
anything deep here.

Don.

Comment 3 Don Sanders 2003-05-11 07:46:56 UTC
Subject: Re:  New: autospell checker has a massive memory leak -        again...

On Sunday 11 May 2003 12:30, Don Sanders wrote:
> On Friday 09 May 2003 07:41, Ed Tomlinson wrote:
> ...
>
> > inserting files with lots of spelling 'errors' ie. something like
> > the output of a large ksymoops (lots of traceback and a long code
> > section) triggers this leak.  Either I find a serial terminal
> > fast or wait 5 mins or so for the kernel to oom.  In either case
> > kde and X are not usable...
>
> I think I know what the problem is. Scott the kspell problem still
> exists as discussed in the attached message. Are you able to look
> at it? If not please let me know and I'll spend some time
> investigating further.
>
> > Is there any way to disable the AUTO spell checker?  If not, why
> > not?
>
> I guess as-you-type spell checking should be disabled by default if
> the kspell problem isn't fixed.

Scott the following patch seems to fix the problem, it just prevents 
the check2 method from being called recursively.

Can you check that it looks ok and if so apply? I'm working on the 
last stable release of kdelibs rather than HEAD.

Don.


Created an attachment (id=1517)
kspellfix.diff
Comment 4 Stephan Kulow 2003-05-19 16:01:35 UTC
the patch is in CVS and there were no more complaints