Bug 151971 - Crash in: rtl_uString_alloc when using some Sounds Like (Japanese)" settings (steps in comment 7)
Summary: Crash in: rtl_uString_alloc when using some Sounds Like (Japanese)" settings ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.3.0.0.alpha1+
Hardware: x86-64 (AMD64) All
: medium critical
Assignee: Stephan Bergmann
URL:
Whiteboard: target:7.6.0 target:7.5.3 target:7.4.7
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Find&Replace-Dialog CJK-Japanese
  Show dependency treegraph
 
Reported: 2022-11-09 08:32 UTC by amberkenney
Modified: 2023-04-06 08:20 UTC (History)
3 users (show)

See Also:
Crash report or crash signature: ["rtl_uString_alloc","libc.so.6"]


Attachments
Figures (153.89 KB, application/pdf)
2022-11-10 04:53 UTC, amberkenney
Details

Note You need to log in before you can comment on or make changes to this bug.
Description amberkenney 2022-11-09 08:32:32 UTC
This bug was filed from the crash reporting server and is br-8bfcc26e-d7c9-4d20-9ab0-89a1f05a6a1b.
=========================================
Calc was aborted at pressing Replace button in the Find and Replace Dialog.
The following words, separated by TAB, were contents of five cells, pasted from Calc. 


L3	D / L3		L3	L3 D / L3


1. These cells were selected.
2. Show Find and Replace Dialog and with checking only selected cells.
3. Set L3 for Find text box.
4. Set L2 for Replace text box.
5. Press Replace button.
6. Calc Aborted.


-- Note --
1. Words did not specify the location of cell. There were just my created symbol for thinking my idea. No mean.
2. Language setting for Calc was Japanese, so, the name of "Find" or "Replace", etc, shown in actual Calc for English may not be same. It's my just expectation.
Comment 1 Julien Nabet 2022-11-09 08:41:19 UTC
Sorry but I don't understand what you mean with L3, D / L3...

if you got 4 cells, could it be just:
cell A1:test1
cell B1:test2
cell C1:test3
cell D1:test4
?

Would it be possible you attach an example file so we can select the 4 cells filled in your file and quickly see if we can reproduce this?
Comment 2 amberkenney 2022-11-09 10:39:42 UTC
Hi, Julien,

I'm very surprised for your very quick response. I have realized again that the dedicated efforts of the contributors are supporting for developing LibreOffice.

I have tested some simple examples, including your proposed, test1, test2.....
And, found that the setting of enable / disable for Similarity Search caused this issue.

1. If the CheckBox of Similarity Search was disable, Calc have always worked fine. (no abort.)
2. If the CheckBox of Similarity Search was enabled, in almost cases, Calc was aborted.

When the CheckBox of Similarity Search is enabled, the button for Options is displayed. The Dialog for Options are shown by this button. At Japanese language setting, many option setting checkBox are displayed. Enable/Disable of these CheckBoxes are changed without my operation depending on the dialog opening timing.
These phenomenon may suggest the usage of the library for Japanese Similarity Search  or the or the initialization of the dialog of the Options for Japanese Similarity Search have any issue.

I hope that this comment supports to increase stability of LibreOffice.

PS. It first time to post Bug Report, I can not decide how to change "Status" on this case. So, please change "Status" adequately on your site. 

Thank you,
Comment 3 Julien Nabet 2022-11-09 13:50:50 UTC
Ok I created a file with test1, test2... as I indicated in my previous comment.
Then I enabled "Similarity Search", then searched "test", I got a dialog box which displays the 4 results.
I also tried by using Japanese as UI and as Locale Setting but still no crash.

Either it's Windows specific or I missed something.
You talked about "Dialog options", what are the options checked?
Would it be possible to have a screenshot?
What's the search string you used?
Comment 4 Eike Rathke 2022-11-09 14:48:21 UTC
Please also copy&paste the info from Help -> About (there's a clipboard button to copy); as Japanese language was mentioned, this may be related to the Japanese locale, so the exact settings of the Find&Replace dialog including the Options expanded are important, as those determine the actual transliteration loaded (which the backtrace hints is involved in the crash).
Comment 5 amberkenney 2022-11-10 04:53:48 UTC
Created attachment 183513 [details]
Figures

In my last comment, "Similarity Search" was suggested the cause of Calc aborted. The further tests were performed and I found issue,
	a. Whether the program aborts depends on Options settings for "Similarity Search"
	

The followings are the test procedures and results.



1. Test File

Only two cells are set as followings.
A1: test1
B1: test2



2. Option Dialog of "Similarity Search"
Refer attached pdf file: Report for Similarity Search - Only Figure .pdf

I have one of options as checked one by one, set “Find string” as test1 and press “Find” button in Find&Search dialog. ("Similarity Search" was always enabled.) When three items, surrounded in Blue square in Figure1, were checked, Calc works properly. But, when one of items, surrounded in Red square, is checked, Calc was aborted.
The combination of Checked items have not been tested because 2^19 trials were necessary. 

After aborted, started Calc and showed Option dialog box. The ALL items in Option dialog box were checked. The settings of options might be store as Calc itself properties, not stored in .ods file since the settings of Option dialog always shows that at which last Calc was closed, not depends on loaded .ods file.

I propose that no item checked or only Case-sensitive checked is as default at aborted because Calc will be always aborted at performing search in FInd&Search dialog if without changing "Similarity Search" Options or disable "Similarity Search".


3. “Find” function in ToolStrip
Automatic (Calc software) setting for Options settings for "Similarity Search" lets this issue complex. In “Find” function in ToolStrip, which located at the bottom of Calc. (see Figure3). When press “Up” or “Down”  icon and search string successfully, Options settings for "Similarity Search" automatically changed to Only Case sensitive Check box is enabled and others are disabled. (see Figure 2) After is successful search, "Similarity Search" seems to be working properly until watching Option Dialog for "Similarity Search".



4. “Find” function message
It may be a small issue. But I notice that a strange message is shown during above tests.
Note that Shown messages in the following procedures are my translations to English from Japaneses, so there may be different in English version. I’m not sure that same issue occurs in your OS and software conditions. 


Only two cells are set as followings.
A1: test1
B1: test2

Procedure 1
a. Set “test1” as the string for “Find” in “Find” function ToolStrip.
b. Place cursor in any cell except A1.
c. Press “Up” or “Down” icon one time.
d. Selected cell move to A1.
e. Press “Down” icon and shows “no string was found.” with changing the background color to Red. => should be shown as “reached to the end of the sheet”.
f. Press “Up” icon and shows “reached to the end of the sheet”.

Procedure 2
a. Set “test2” as the string for “Find” in “Find” function ToolStrip.
b. Place cursor in any cell.
c. Press “Up” or “Down” icon one time.
d. Selected cell move to A2.
e. Press “Down” icon and shows “reached to the end of the sheet”.
f. Press “Up” icon and shows “reached to the end of the sheet”.




5. Version information of my Calc
Version: 7.4.2.3 (x64) / LibreOffice Community
Build ID: 382eef1f22670f7f4118c8c2dd222ec7ad009daf
CPU threads: 12; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: threaded
Comment 6 Julien Nabet 2022-11-10 15:54:07 UTC
Thank you for the extra details.
I checked dialog options, all checkboxes were already checked.
I can't reproduce the crash/abort here so can't help here=>uncc myself + put back to UNCONFIRMED since I don't have more questions.
Comment 7 Stéphane Guillou (stragu) 2023-04-03 21:49:57 UTC
Crash reproduced with:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d36145d7cf6ca4d6072d4ab0a709bb8fe866336c
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: threaded

and:

Version: 7.3.7.2 / LibreOffice Community
Build ID: e114eadc50a9ff8d8c8a0567d6da8f454beeb84f
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: threaded

But not in:

Version: 7.2.7.2 / LibreOffice Community
Build ID: 8d71d29d553c0f7dcbfa38fbfda25ee34cce99a2
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: threaded

So it's a regression in 7.3.

Steps to reproduce:
After installing the ja langpack and running LO with the environment variable LC_ALL="ja_JP":

1. Open Calc
2. Open Find and Replace dialog
3. Tick "Sounds like (Japanese)"
4. Click on "Sounds" to open dialog. Tick an extra setting highlighted in red in Amber's PDF, for example "Ignore > Punctuation character", click OK.
5. Type "test" in search box, click "Find next"

Results: Crash. Next time the "Sounds" dialog is opened, all options are ticked. 

Crash report: https://crashreport.libreoffice.org/stats/crash_details/16eacbb9-4588-48f8-b8bf-d224514a1a79
Comment 8 Stéphane Guillou (stragu) 2023-04-03 22:04:41 UTC
Bibisected in linux-64-7.3 repo to first bad commit 889b8ec958910846789e960b4ca30e8a79464092 which points to core commit:

commit 04af4e4f55f3ef319a78edd4d0109e2e7eba90b6
author	Stephan Bergmann <sbergman@redhat.com>	Mon Sep 06 16:53:29 2021 +0200
committer	Stephan Bergmann <sbergman@redhat.com>	Thu Oct 14 19:50:30 2021 +0200
[API CHANGE] Fix all bad UNOIDL identifiers across offapi
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121725

Stephan, can you please have a look?
Comment 9 Commit Notification 2023-04-04 12:22:30 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/456a146b9eb643655ae2bd336740e8c5536913aa

tdf#151971: Fix used implementation names of transliteration services

It will be available in 7.6.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 10 Commit Notification 2023-04-04 15:55:02 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

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

tdf#151971: Fix used implementation names of transliteration services

It will be available in 7.5.3.

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 11 Commit Notification 2023-04-06 08:20:49 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

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

tdf#151971: Fix used implementation names of transliteration services

It will be available in 7.4.7.

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.