Bug 200493 - spellchecker crashes kdevelop during shutdown
Summary: spellchecker crashes kdevelop during shutdown
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Unmaintained
Component: kspell (show other bugs)
Version: SVN
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Zack Rusin
URL:
Keywords:
: 200250 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-07-17 01:04 UTC by Andreas Pakulat
Modified: 2020-12-07 15:15 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Pakulat 2009-07-17 01:04:53 UTC
Recent kdelibs (r998008) here, on each exit of KDevelop I get a crash from the spell-checking stuff.

Backtrace:
#0  QHash<str_enchant_dict*, int>::duplicateNode (node=0x7000018, newNode=0xbc89940) at /usr/local/include/QtCore/qhash.h:214
#1  0xf6bc6673 in QHashData::detach_helper (this=0xbe22758,
    node_duplicate=0xe57d04f0 <QHash<str_enchant_dict*, int>::duplicateNode(QHashData::Node*, void*)>, nodeSize=16)
    at /home/andreas/src/kde-qt/src/corelib/tools/qhash.cpp:207
#2  0xe57cf782 in QSpellEnchantClient::removeDictRef (this=0xb2fc6f0, dict=0xd40fa00) at /usr/local/include/QtCore/qhash.h:565
#3  0xe57ce214 in ~QSpellEnchantDict (this=0xd414850, __in_chrg=<value optimized out>)
    at /home/andreas/src/kdelibs/sonnet/plugins/enchant/enchantdict.cpp:45
#4  0xf7dfd3a1 in ~Speller (this=0xcc36df4, __in_chrg=<value optimized out>) at /home/andreas/src/kdelibs/kdecore/sonnet/speller.cpp:42
#5  0xf7e01a7c in ~BackgroundEngine (this=0xcc36de8, __in_chrg=<value optimized out>)
    at /home/andreas/src/kdelibs/kdecore/sonnet/backgroundengine.cpp:40
#6  0xf6cc4d5a in QObjectPrivate::deleteChildren (this=0xd411210) at /home/andreas/src/kde-qt/src/corelib/kernel/qobject.cpp:1846
#7  0xf6ccda1a in ~QObject (this=0xb896e30, __in_chrg=<value optimized out>)
    at /home/andreas/src/kde-qt/src/corelib/kernel/qobject.cpp:836
#8  0xf7e00f9c in ~BackgroundChecker (this=0xb896e30, __in_chrg=<value optimized out>)
    at /home/andreas/src/kdelibs/kdecore/sonnet/backgroundchecker.cpp:65
#9  0xf6cc4d5a in QObjectPrivate::deleteChildren (this=0xd415250) at /home/andreas/src/kde-qt/src/corelib/kernel/qobject.cpp:1846
#10 0xf6ccda1a in ~QObject (this=0xd411be8, __in_chrg=<value optimized out>)
    at /home/andreas/src/kde-qt/src/corelib/kernel/qobject.cpp:836
#11 0xe5956160 in ~KateOnTheFlyChecker (this=0xd411be8, __in_chrg=<value optimized out>)
    at /home/andreas/src/kdelibs/kate/spellcheck/ontheflycheck.cpp:70
#12 0xe59597f1 in ~KateSpellCheckManager (this=0xb35bbc0, __in_chrg=<value optimized out>)
    at /home/andreas/src/kdelibs/kate/spellcheck/spellcheck.cpp:51
#13 0xe599ef07 in ~KateGlobal (this=0xbfa75c0, __in_chrg=<value optimized out>)
    at /home/andreas/src/kdelibs/kate/utils/kateglobal.cpp:205
#14 0xe5971b30 in ~KateFactory (this=0xb5d36c0, __in_chrg=<value optimized out>)
    at /home/andreas/src/kdelibs/kate/utils/kateglobal.h:170
#15 0xf6cd14b3 in QObjectCleanupHandler::clear (this=0x9f430c8)
    at /home/andreas/src/kde-qt/src/corelib/kernel/qobjectcleanuphandler.cpp:140
#16 0xf6cd1647 in ~QObjectCleanupHandler (this=0x9f430c8, __in_chrg=<value optimized out>)
    at /home/andreas/src/kde-qt/src/corelib/kernel/qobjectcleanuphandler.cpp:86
#17 0xf7ea09c5 in destroy () at /home/andreas/src/kdelibs/kdecore/util/kpluginfactory.cpp:29
#18 0xf7d432bb in ~KCleanUpGlobalStatic (this=0xf7ef2e14, __in_chrg=<value optimized out>)
---Type <return> to continue, or q <return> to quit---
    at /home/andreas/src/kdelibs/kdecore/kernel/kglobal.h:62
#19 0xf5c960e9 in exit () from /lib/libc.so.6
#20 0xf5c7d77d in __libc_start_main () from /lib/libc.so.6
#21 0x0804bd51 in _start () at ../sysdeps/i386/elf/start.S:119
Comment 1 Michel Ludwig 2009-07-17 10:21:46 UTC
With revision 998207 of kdelibs/kdevplatform/kdevelop and with one open .cpp file, I cannot reproduce the crash. KDevelop doesn't terminate properly, though. I get a constant stream of

kdevelop(29166)/kdevelop (cpp support) UIBlockTester::lockup: ui is blocking
Comment 2 Andreas Pakulat 2009-07-17 11:16:28 UTC
Still reproduceable here with kdelibs r998175. I also get a warning about 1 dictionary not being free'd during shutdown.

I've had 2 projects opened and parsed by kdevelop and one file open from one of the projects.
Comment 3 Michel Ludwig 2009-07-17 12:11:57 UTC
Ok, I've installed enchant and now I get the warning, but still no crash. Anyway, this looks like a Sonnet issue to me.

Does it also crash for you in Kate/KWrite?
Comment 4 Andreas Pakulat 2009-07-17 12:29:26 UTC
No, kate doesn't crash. I'm wondering wether the problem is order of cleanup of global statics... KDevelop has a couple more than kate I'm guessing. Still very annoying, is there a way to disable the spellchecker, code-wise? As I won't be diving into the sonnet code, we might have to disable creation of the on-the-fly-spellchecker in kdevelop if nobody else can fix this.
Comment 5 Michel Ludwig 2009-07-17 14:53:28 UTC
Once I disable the CPP language support, termination doesn't block anymore and
I get the crash as well.

I've just committed a fix which ensures that no Sonnet-related object is
created as long as no spell checking is taking place. This should help until
the real problem is fixed. I'll try and see what I can do about it.
Comment 6 Andreas Pakulat 2009-07-17 17:37:46 UTC
(In reply to comment #5)
> Once I disable the CPP language support, termination doesn't block anymore and
> I get the crash as well.

Hmm, that shouldn't be needed of course...

> I've just committed a fix which ensures that no Sonnet-related object is
> created as long as no spell checking is taking place. This should help until
> the real problem is fixed. I'll try and see what I can do about it.

Thanks a lot, I'll re-assign this to sonnet then.
Comment 7 Michel Ludwig 2009-07-26 21:40:23 UTC
In revision 1002673 I've now changed the way how Sonnet::Speller objects are handled. More specifically, they are destroyed whenever documents are deleted. It seems that this fixes the problems with KDevelop.
Comment 8 Christoph Feck 2010-01-26 06:06:07 UTC
*** Bug 200250 has been marked as a duplicate of this bug. ***
Comment 9 Justin Zobel 2020-12-07 05:08:54 UTC
Thank you for the report, Andreas.

As it has been a while since this was reported, can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved.

I have set the bug status to "needsinfo" pending your response, please change back to "reported" or "resolved/worksforme" when you respond, thank you.
Comment 10 Andreas Pakulat 2020-12-07 15:15:29 UTC
Lets assume this has been fixed, it appears I did not retest the last fix 11 years ago but I wouldn't be able to retest this these days anymore anyway.