This bug is verified in 4.3 eg. just break in #0 SwTxtFrm::_AutoSpell (this=this@entry=0x7fffd8066000, pActNode=<optimized out>, rViewOpt=..., nActPos=8) at /data/opt/libreoffice/cp-4.3/sw/source/core/txtnode/txtedt.cxx:1388 and type: "testtest" into writer ... but it happens much less frequently since the spell-checking timeout is much slower. Essentially it seems we (incorrectly?) fail to mark the relevant node's "wrongdirty" flag - as we set it wrong: pNode->SetWrongDirty( COMPLETE_STRING != pNode->GetWrong()->GetBeginInv() ); So we get this idle handler continuously called. The slight down-side of this is that since we fixed the idle stack to actually execute idle handlers at top tilt - this now consumes 100% CPU time (not making progress) - and also blocks incoming UNO callers.
Michael Meeks committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=f645f21eb7c1fbf4addaeff19c1c3dd9c553431c tdf#92036 - work around writer spelling issue It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Michael Meeks committed a patch related to this issue. It has been pushed to "libreoffice-5-0": http://cgit.freedesktop.org/libreoffice/core/commit/?id=a0faaf32381d30ca9dd834511271b7f45299c74c&h=libreoffice-5-0 tdf#92036 - work around writer spelling issue It will be available in 5.0.0.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
I had noticed this and hinted at it in #38837. This is indeed an issue for large documents as the UI freezes for a second or two every so often (due to high cpu usage on the main thread). This issue exists in 4.4.4.3.
The issue in 4.4.4.x would be not quite so bad I think - since the idle handler wont' be nearly as active - but will still be consuming CPU. I guess it prolly depends how long the paragraph is there though ;-) with a multi-page mixed-language paragraph I imagine we could see this bite us in old versions too.
*** Bug 93261 has been marked as a duplicate of this bug. ***
Ashod Nakashian committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=032e251f0fb80bb2400804d13a2a954cdaedf605 tdf#92036 - Writer infinite spelling loop It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
i'm afraid the infinite loop is intentional: bool SwWrongList::Fresh( sal_Int32 &rStart, sal_Int32 &rEnd, sal_Int32 nPos, sal_Int32 nLen, sal_uInt16 nIndex, sal_Int32 nCursorPos ) { // length of word must be greater than 0 and cursor position must be outside the word bool bRet = nLen && ( nCursorPos > nPos + nLen || nCursorPos < nPos ); the shell cursor is positioned at the end of the word, and we don't add the word to the wrong-list yet so we don't annoy the user who doesn't want a word underlined in red that is still being typed in. so every iteration of the idle loop checks the paragraph again in the hope that the word is now complete, or the cursor has moved outside the paragraph. we can invalidate the paragraph easily when text is inserted (and we do), and we could invalidate the paragraph when the shell cursor moves to another one, but the moving away sounds a bit more difficult to detect.
Michael Stahl committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=4c91e94e892943ef5e031d65f6f42864233cb4cd tdf#92036: sw: fix idle spelling loop It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
more useful things to know: if you have a grammar checker enabled the grammar checking thread will call SwPageFrm::ValidateSpelling() via SwXFlatParagraphIterator::getNextPara() and that terminates the idle spelling loop. found a way to fix the idle spelling loop, even without relying on grammar checking.
Michael Stahl committed a patch related to this issue. It has been pushed to "libreoffice-5-0": http://cgit.freedesktop.org/libreoffice/core/commit/?id=e5544e485f8b82612a909568174b8ad142bed54e&h=libreoffice-5-0 tdf#92036: sw: fix idle spelling loop It will be available in 5.0.3. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.