Created attachment 152373 [details] Backtrace of the assertion error If I try to search for a string that ends with a dot the offline help viewer crashes with an assertion error. In the non debug build I get a "There is no such topic" dialog when doing the same. To reproduce: 1. Open the offline help browser. 2. Go to the Search tab. 3. Enter "foo." and press the Find button. The console shows this output: soffice.bin: /home/gabor/src/core/sal/rtl/strtmpl.cxx:1378: void rtl_uString_newFromSubString(rtl_uString**, const rtl_uString*, sal_Int32, sal_Int32): Assertion `false' failed. Happens in: Version: 6.4.0.0.alpha0+ Build ID: ab5f341efd144adb6b7d0e00fece76a2153acd10 CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; Locale: hu-HU (hu_HU.UTF-8); UI-Language: en-US Calc: threaded There is no assertion error when searching for "foo" or "foo.a" but there is one if searching for ".foo". Also this happens with basically any non alphanumeric characters at the beginning or end of the string: .,"+-%=?! all can reproduce the problematic behavior.
On Win10 with master sources updated today, I could reproduce this. Adding some traces on PrepareSearchString method in sfx2/source/appl/newhelp.cxx, I got: before loop rSearchString=foo. loop aBoundary.startPos=0 aBoundary.endPos=3 loop aBoundary.startPos=4 aBoundary.endPos=0
This straightforward patch seems a good fix: diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 8f6ccd8af2be..8595cd436aef 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -207,7 +207,7 @@ namespace sfx2 Boundary aBoundary = xBreak->getWordBoundary( rSearchString, nStartPos, aLocale, WordType::ANYWORD_IGNOREWHITESPACES, true ); - while ( aBoundary.startPos != aBoundary.endPos ) + while ( aBoundary.endPos && aBoundary.startPos != aBoundary.endPos ) { nStartPos = aBoundary.endPos; OUString sSearchToken( rSearchString.copy( Gabor: I'll be able to submit it on gerrit review only after my daytime job so if you want to give it a try or submit it to review, don't hesitate!
Patch submitted to review here: https://gerrit.libreoffice.org/#/c/74716/
Julien Nabet committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/0328e0af9532d5ab26840cf58b9dcbb69bb8c33d%5E%21 tdf#126071: fix assertion with offline help viewer It will be available in 6.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Patches on gerrit review for 6.3: https://gerrit.libreoffice.org/#/c/74845/ for 6.2: https://gerrit.libreoffice.org/#/c/74846/
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-6-3": https://git.libreoffice.org/core/+/03ef64befed26a03b35d6e977649face888f41a5%5E%21 tdf#126071: fix assertion with offline help viewer It will be available in 6.3.0.1. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-6-2": https://git.libreoffice.org/core/+/cb1c5ae7af997d7643da97235caf95789ba09416%5E%21 tdf#126071: fix assertion with offline help viewer It will be available in 6.2.6. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.