Bug 100711 - Search & replace corrupts .xlsx file
Summary: Search & replace corrupts .xlsx file
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
Depends on:
Reported: 2016-07-01 06:39 UTC by Dan Dascalescu
Modified: 2018-03-02 10:06 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:

9400x from the other bug, with each character replaced by 'y' (2.60 MB, application/zip)
2016-07-01 06:39 UTC, Dan Dascalescu
Search and replace freezes (135.49 KB, image/png)
2016-08-03 07:37 UTC, Dan Dascalescu
Details freezes too (168.68 KB, image/png)
2016-08-03 07:42 UTC, Dan Dascalescu

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Dascalescu 2016-07-01 06:39:49 UTC
Created attachment 126018 [details]
9400x from the other bug, with each character replaced by 'y'

1. Open the 9400x.xlsx attached to bug 100709 in LibreCalc
2. Search and replace the '.' regular expression with 'y'
3. Save as 9400y.xlsx
4. Open the resulting file in Excel 2007. The following error will be shown:

> Excel found unreadable content in ... Do you want to recover the contents of this workbook?

The repairs long shows

> Repaired Part: /xl/worksheets/sheet1.xml part with XML error.  Load error. Line 2, column 250.

Inspecting the resulting file reveals that it's now 16MB, an increase of over 30x vs. the initial file, even though the replacement was a 1:1 character to character. sheet1.xml is 150MB in size (!).
Comment 1 V Stuart Foote 2016-07-01 14:20:23 UTC
Can not reproduce on Windows 10 Pro 64-bit en-US with
Version: (x64)
Build ID: fcbcb4963bda8633ba72bd2108ca1e802aad557d
CPU Threads: 8; OS Version: Windows 6.19; UI Render: GL; 
Locale: en-US (en_US)


1. open sample document (size 474KB)
2. <Ctrl>+H for Find and Replace dialog
3. Find "x", "match case" checked
4. other options "regular expressions" checked
5. replace "y"
6. Search in "Values"  <-- this is rather important for integrity of the OOXML
7. "Replace All"

About 20 seconds and all are replaced. Formatting intact each x changed to y.
Size 341KB

8. open in Office 2007, about 4 sec no issue formatting intact.
Comment 2 Joel Madero 2016-07-03 15:30:11 UTC
Hi Dan -

5.0 is EOL. Can you try with 5.1?
Comment 3 Joel Madero 2016-07-03 15:59:34 UTC
Windows 10
Build ID: d3bf12ecb743fc0d20e0be0c58ca359301eb705f
CPU Threads: 2; OS Version: Windows 6.2; UI Render: default; 
Locale: en-US (en_US)

Microsoft Office 2013

Cannot confirm. I'm going to go ahead and close this as WFM.

@Dan - please try with 5.1 or even 5.2 with a fresh profile. If you can still reproduce set back to UNCONFIRMED and leave a comment with your findings. Thanks!
Comment 4 Dan Dascalescu 2016-07-06 04:18:55 UTC
Before I try reproducing with a newer version, can you confirm that the resulting file is WAY larger than the original?
Comment 5 Dan Dascalescu 2016-08-03 07:37:39 UTC
Created attachment 126536 [details]
Search and replace freezes

I've just tried to reproduce in Version:, Build ID: 832d359930c86c7bfe5547e580d1bfadd917764

With Match case unchecked, and Search in Formulas, Calc freezes as shown in the screenshot. I've waited more than a minute and reproduced two out of two tries.
Comment 6 Dan Dascalescu 2016-08-03 07:39:36 UTC
Checked Match Case and set Search in to Values -> same type of freeze.
Comment 7 Dan Dascalescu 2016-08-03 07:42:39 UTC
Created attachment 126537 [details] freezes too
Comment 8 V Stuart Foote 2016-08-03 14:51:42 UTC
Please do not change version details--the field is for the "earliest" build where an issue is reproducible.
Comment 9 Dan Dascalescu 2016-08-03 17:32:13 UTC
@V Stuart - sorry, thought the bug was dismissed because 5.0 was EOL.
Comment 10 V Stuart Foote 2016-08-03 18:31:16 UTC
This still works for me,, and current master


Please see STR in comment 1 -- if significantly different steps, please clearly state what those steps are.
Comment 11 Aron Budea 2016-08-07 00:50:14 UTC
I also got a question, which OS does the freeze occur in? The OS field in the header is set to Windows, the screenshots are for Ubuntu, does it happen in both systems for you?
Comment 12 Buovjaga 2016-09-16 16:26:09 UTC
I can open even attachment 126018 [details] (created by Dan) in Excel 2013 just fine.
Comment 13 Xisco Faulí 2017-07-27 23:20:31 UTC Comment hidden (obsolete)
Comment 14 QA Administrators 2018-01-29 10:27:49 UTC Comment hidden (obsolete)
Comment 15 QA Administrators 2018-03-02 10:06:10 UTC
Dear Bug Submitter,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team