Kate hangs on spellcheck

Bug #58175 reported by Tom S.
4
Affects Status Importance Assigned to Milestone
kdebase (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: kate

Kate hangs on spellcheck (i.e. after selecting "Tools > Spelling", "Tools > Spelling (from cursor)" or "Tools > Spellcheck Selection") reporting:

ASSERT: "i <= nodes" in /usr/share/qt3/include/qvaluelist.h (373)

According to gdb via KDbg, this is asserted by:

QValueListPrivate<QString>::at () from /usr/lib/libkateinterfaces.so.0
KateSpell::spellcheck () from /usr/lib/kde3/libkatepart.so
KateSpell::spellcheck () from /usr/lib/kde3/libkatepart.so
KateSpell::qt_invoke () from /usr/lib/kde3/libkatepart.so
QObject::activate_signal () from /usr/lib/libqt-mt.so.3
...

The output of strace shows 23 */l10n/*/entry.desktop files being opened by a call to KGlobal::locale()->twoAlphaToCountryName() from KSpellConfig::interpret() before this Qt assertion failure. However, this is irrelevant (comment to follow).

System:

 * Kubuntu 6.06.1 LTS
 * AMD Athlon 64 Processor 4000+
 * kate 4:3.5.2-0ubuntu27
 * /usr/lib/aspell is on a LVM2 XFS partition

grep 'localechooser:' /var/log/installer/syslog
Aug 20 08:49:44 localechooser: Generating locales...
Aug 20 08:49:44 localechooser: en_AU.UTF-8...
Aug 20 08:49:46 localechooser: done
Aug 20 08:49:46 localechooser: Generation complete.
Aug 20 08:49:46 localechooser: Generating locales...
Aug 20 08:49:46 localechooser: en_AU.UTF-8...
Aug 20 08:49:46 localechooser: up-to-date
Aug 20 08:49:46 localechooser: en_US.UTF-8...
Aug 20 08:49:47 localechooser: done
Aug 20 08:49:47 localechooser: Generation complete.

env | grep 'LANG'
LANG=en_AU.UTF-8
LANGUAGE=en_AU:en

Revision history for this message
Tom S. (toms-internode) wrote :

Attaching minimal strace output.

Revision history for this message
Tom S. (toms-internode) wrote :

I should clarify that I haven't noticed any problems with aspell itself.

cat /home/user/.aspell.conf
add-dict-alias en_AU en_GB-ise-w_accents

aspell dump dicts
en
en-variant_0
en-variant_1
en-variant_2
en-w_accents
en-wo_accents
en_AU
en_CA
en_CA-w_accents
en_CA-wo_accents
en_GB
en_GB-ise
en_GB-ise-w_accents
en_GB-ise-wo_accents
en_GB-ize
en_GB-ize-w_accents
en_GB-ize-wo_accents
en_GB-w_accents
en_GB-wo_accents
en_US
en_US-w_accents
en_US-wo_accents

Tom S. (toms-internode)
description: updated
Revision history for this message
Tom S. (toms-internode) wrote :

Please ignore my spurious strace interpretation: with kdelibs-dbg and a debugging build of kate, I've stepped through KateSpell::spellcheck(const KateTextCursor &from, const KateTextCursor &to) in kdelibs-3.5.2/kate/part/katespell.cpp (line 86) past the assignment to KSpellConfig *ksc (line 109) and until the assignment to int enc (line 116).

An empty string is returned by m_view->doc()->encoding() with the result that enc is -1. The next kdDebug message (line 120) accesses ksEncodings[enc] and Qt complains that -1 (or i = 18446744073709551615 as it reports) is out of range.

At least that's how it seems to me - I'm afraid I wasn't able to patch kdelibs to confirm this (compilation fails with a missing remoteservice.moc... I guess I must be doing something wrong)! :o|

Anyway, at least this further debugging has identified a work-around: to explicitly set the encoding via "Tools > Encoding" (reselecting "Unicode (utf8)" does the trick) before invoking a spellcheck. Interestingly, it doesn't appear to matter whether "Settings > Configure Kate > Editor > Open/Save > File Format > Encoding" is "KDE Default" or "Unicode (utf8)".

Revision history for this message
Tom S. (toms-internode) wrote :
Revision history for this message
Yuriy Kozlov (yuriy-kozlov) wrote :

Since this was fixed in SVN in september, that fix is in kde 3.5.5 which is in Edgy, and packages are available for Dapper here: http://kubuntu.org/announcements/kde-355.php

Changed in kdebase:
status: Unconfirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.