Bug 158837 - Crash in: int rtl::str::indexOfStr_WithLength<char16_t>(char16_t const*, int, char16_t const*, int)
Summary: Crash in: int rtl::str::indexOfStr_WithLength<char16_t>(char16_t const*, int,...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: All All
: medium critical
Assignee: Not Assigned
URL:
Whiteboard: target:24.8.0 target:24.2.0.2 target:...
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Hyphenation
  Show dependency treegraph
 
Reported: 2023-12-22 20:16 UTC by Alain Viret
Modified: 2023-12-27 10:21 UTC (History)
3 users (show)

See Also:
Crash report or crash signature: ["int rtl::str::indexOfStr_WithLength<char16_t>(char16_t const*, int, char16_t const*, int)"]


Attachments
SIGSEGV with the Skip button of the Hyphenation window (30.24 KB, application/vnd.oasis.opendocument.text)
2023-12-22 20:16 UTC, Alain Viret
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alain Viret 2023-12-22 20:16:46 UTC
Created attachment 191573 [details]
SIGSEGV with the Skip button of the Hyphenation window

Hello,

This bug was filed from the crash reporting server and is br-7bfa5b15-21f7-4159-84e8-1404ea069ed0.
=========================================
To reproduce it, open the Test8.odt document, choose the menu: Tools – Language... – Hyphenation (French, Switzerland) and then use the button "Skip" two times, the crash arrives at the third click on "Skip".

Regards,
 Alain
Comment 1 Stéphane Guillou (stragu) 2023-12-22 22:26:29 UTC
Thank you for the report, Alain.
Reproduced in recent trunk build:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 0cd74b5be297f638d455b9b267462192f2e6620c
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Also in:
- 7.5.9: https://crashreport.libreoffice.org/stats/crash_details/51e810be-1d58-4453-b6ae-e4419e756e3a
- 7.4.7: https://crashreport.libreoffice.org/stats/crash_details/1e63a611-eec2-4879-8572-74353865662f

In 7.2 and 7.3, freezes for a while, then crashes, with no crash report.

In 7.1, completes the hyhenation with no crash -> regression.

Bibisected with linux-64-7.2 to first bad build commit [a66be57ea0fafe95d70cd7685620f61b8d504b58] which points to:

commit 5ebccaa07589383653dbd65e58204a82dd3cde09
author	Noel Grandin 	Sat Apr 10 17:27:08 2021 +0200
committer	Noel Grandin 	Sat Apr 10 20:57:16 2021 +0200
use std lib for O[U]String indexOfStr
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113923

Noel, can you please have a look?
Comment 2 Commit Notification 2023-12-24 19:46:34 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a89a42e55f2b154c8b276fe08fcf02c4b9fc0945

tdf#158837 hyphenation crash in: int rtl::str::indexOfStr_WithLength

It will be available in 24.8.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.
Comment 3 Commit Notification 2023-12-26 16:42:20 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/7af18a423634595dd5ea13d35283e906e46a1662

tdf#158837 hyphenation crash in: int rtl::str::indexOfStr_WithLength

It will be available in 24.2.0.2.

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.
Comment 4 Alain Viret 2023-12-27 09:25:04 UTC
Hello,

No more crash in the 24.8.0 (build: https://git.libreoffice.org/core/+log/40617d867346956588ac023511f31210107217f4).

Thanks for the fix !

Greetings,
 Alain
Comment 5 Stéphane Guillou (stragu) 2023-12-27 09:52:42 UTC
(In reply to Alain Viret from comment #4)
> No more crash in the 24.8.0
Let's mark as "verified" then. Thank you both!
Comment 6 Commit Notification 2023-12-27 10:21:57 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/3ec7b568bf8158ce7e6ba5336ce8af52d7a79d5f

tdf#158837 hyphenation crash in: int rtl::str::indexOfStr_WithLength

It will be available in 7.6.5.

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.