Bug 95633 - Replace All hangs Writer (heap_corruption) in messy XML with redundant styles where Replace ‘italic’ finds non-existing italic
Summary: Replace All hangs Writer (heap_corruption) in messy XML with redundant styles...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All All
: low major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: haveBacktrace
Depends on:
Blocks: Find-Search
  Show dependency treegraph
 
Reported: 2015-11-06 12:13 UTC by pieter kristensen
Modified: 2021-06-28 14:01 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
File to test with (1.22 MB, application/vnd.oasis.opendocument.text)
2015-11-11 10:50 UTC, Buovjaga
Details
GDB trace of the crash with 5.4 master (27.65 KB, text/plain)
2017-02-18 19:16 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pieter kristensen 2015-11-06 12:13:55 UTC
Tried on Mac (LO Version: 4.4.5.2) and KDE (Version: 5.0.3.2) with same result.

Steps to reproduce:
1 - Edit - Find&Replace, cursor in ‘Search for’ field - Other options - Format - Font - Typeface ‘Italic’
2 - Find&Replace, cursor in ‘Replace with’ field - Other options - Format - Font Effects - Font color ‘Light red’
3 - Replace all

The length of the document seems to make a difference. The longer, the more chance of LO hanging, short documents don’t have this problem.

Below the ‘Search for’ field it says ‘Italic, normal’. Why ‘normal’? When we tried this sequence with ‘Bold’ instead of ‘Italic’, it just said ‘Bold’ and there was no problem with replacing.
Comment 1 A (Andy) 2015-11-06 18:56:40 UTC
For me not reproducible with LO 5.0.3.2, Win 8.1.

But the mentioned issue "Italic, normal" is for me also strange.
Comment 2 pieter kristensen 2015-11-06 19:26:47 UTC
perhaps your document was not big enough. You could try this one http://members.ziggo.nl/enouwens/permanente%20dingen/odt-docx/kubus.odt . Make one word italic and try to "find and replace" it by e.g. "red".

On my machine (LO 5.0.3.2.) it hanged LO again.
Comment 3 Buovjaga 2015-11-11 10:50:46 UTC
Created attachment 120477 [details]
File to test with
Comment 4 Buovjaga 2015-11-11 11:06:39 UTC
Reproduced with the example file.

Win 7 Pro 64-bit, Version: 5.0.3.2 (x64)
Build ID: e5f16313668ac592c1bfb310f4390624e3dbfb75
Locale: fi-FI (fi_FI)

Version: 5.1.0.0.alpha1+
Build ID: 6da681442b17c723f9408a806e8d2367441ad65a
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-11-07_23:13:46
Locale: fi-FI (fi_FI)

3.5.0
Comment 5 pieter kristensen 2015-11-11 15:11:30 UTC
We have been doing some experimenting and found that also when we "find" Bold and "replace" it by Bold and light red, LO hangs when we use the example text.
Comment 6 A (Andy) 2015-11-11 21:41:58 UTC
@Beluga: Thanks for the test document.

With this test document it is reproducible for me with LO 5.0.3.2, Win 8.1.

My experience: I have to wait a few seconds and then I get the dialog box "To proceed with this action, you must first turn off the 'undo' function. Do you want to turn off the 'undo' function?"

If I press yes, then LO hangs up.
Comment 7 Buovjaga 2017-02-18 19:16:17 UTC
Created attachment 131325 [details]
GDB trace of the crash with 5.4 master

Arch Linux 64-bit, KDE Plasma 5
Version: 5.4.0.0.alpha0+
Build ID: 7ec0500e20cf273d70c4fbddb4063b8f8295307c
CPU Threads: 8; OS Version: Linux 4.9; UI Render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on February 18th 2016
Comment 8 QA Administrators 2018-02-19 03:34:20 UTC Comment hidden (obsolete)
Comment 9 pieter kristensen 2018-02-19 06:40:22 UTC
tested on feb 19th 2018 (LO 6.0.1.0 linux). Bug is still prestent. LO hangs.
Comment 10 Timur 2018-02-19 12:52:38 UTC
Writer from LO version 3.3 finds wrong italic that's not really italic in "Twee blokjes" and "zitten goed, en de twee andere moeten worden verwisseld. Draai dan Y U en ga naar 4.3"
That text is <text:span text:style-name="T12">. 
But that text style name T12 doesn't exist. Looks like copied wrong with styles instead of text-only. 
Messy document. I set importance as Low.

Replace All hangs LO (heap_corruption). 

BTW, ‘Italic, normal’ seems to be just italic. ‘Italic, bold’ is bold italic.
Comment 11 pieter kristensen 2018-02-19 13:02:59 UTC
Pardon me friend if you took the effort of trying with any other document you would see the same behavior. It is your freedom to call the document messy and to set the priority low.
But this bug rapport is not only about this document.
Comment 12 Timur 2018-02-19 13:44:54 UTC
Thank you for following up. Please open .odt as .zip and see content.xml and styles.xml. But hang makes this a valid bug.
Comment 13 ploni 2018-08-03 15:47:17 UTC
I have the same issue when trying to replace a font with another one, I get the dialog box "To proceed with this action, you must first turn off the 'undo' function. Do you want to turn off the 'undo' function?" After I press yes, LO hangs up with 100% CPU load on one CPU. I left it running overnight and it remained the same until I killed it.

Version: 6.0.3.2
Build ID: 1:6.0.3-0ubuntu1
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); Calc: group
Comment 14 QA Administrators 2019-08-04 05:48:55 UTC Comment hidden (obsolete)
Comment 15 pieter kristensen 2019-08-04 05:58:06 UTC
Bug is still there. LO freezes totally.
Versie: 6.3.0.2
Build ID: 1:6.3.0~rc2-1
CPU-threads: 2; Besturingssysteem: Linux 4.19; UI-render: GL; VCL: kde5; 
Locale: nl-NL (nl_NL.UTF-8); UI-taal: nl-NL
Calc: threaded
Comment 16 Stéphane Guillou (stragu) 2021-06-28 13:58:58 UTC
I can't reproduce in current master:

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: f446a203fa2897bab8ae7686c948a8bf060675c6
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-06-24_15:16:38
Calc: threaded

I can't reproduce either in 7.2 beta1:

Version: 7.2.0.0.beta1 / LibreOffice Community
Build ID: c6974f7afec4cd5195617ae48c6ef9aacfe85ddd
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Or 7.0.6:

Version: 7.0.6.2
Build ID: 144abb84a525d8e30c9dbbefa69cbbf2d8d4ae3b
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

I can't see the word "normal" under the "Find" field.

Note that when testing, the search doesn't find any text in italics. If you want to see the effect of the search and replace, make some text italic first.
Comment 17 Stéphane Guillou (stragu) 2021-06-28 14:01:37 UTC
Apologies, noting that the use case that triggers the bug was that the search key is not found.
This does not change the WORKSFORME: all version I cited do work when the Italic search key is not found. The fix must have happened before LO 7.0.6