Download it now!
Bug 95346 - XLSX file crashes LibreOffice calc when save or very slow and eats 600 MB to 2 GB of RAM
Summary: XLSX file crashes LibreOffice calc when save or very slow and eats 600 MB to ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected)
3.4.0 release
Hardware: All All
: high major
Assignee: Not Assigned
Keywords: haveBacktrace, perf
Depends on:
Blocks: XLSX Memory
  Show dependency treegraph
Reported: 2015-10-26 23:05 UTC by mcjarod
Modified: 2020-06-20 20:16 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:

confidencial finantial information (418.39 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2015-10-26 23:05 UTC, mcjarod
Callgrind output from master (2.70 MB, application/x-xz)
2018-09-24 15:51 UTC, Buovjaga
Perf flamegraph of saving (646.46 KB, image/svg+xml)
2019-04-19 11:42 UTC, Buovjaga
doc saved as ods in LO (357.48 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-03-10 22:18 UTC, paulystefan
perf flamegraph (99.08 KB, application/x-bzip)
2020-03-11 20:32 UTC, Julien Nabet

Note You need to log in before you can comment on or make changes to this bug.
Description mcjarod 2015-10-26 23:05:26 UTC
Created attachment 119985 [details]
confidencial finantial information

I have problems with the attachment file, with this file normally work (but with ms office), now I trying to make a change in LibreOffice and save it, but then LibreOffice crashes.
Comment 1 raal 2015-10-27 08:05:38 UTC
I can confirm with LO and LO Version (Build ID: 7545bee9c2a0782548772a21bc84a9dcc583b89); win7
I can confirm with LO Version:
Build ID: 233b9b0ec95069b5ce98aab942304459ca7344a8
Lo quickly eats 1,6GB of memory and doesn't respond.
Comment 2 Timur 2015-10-29 15:03:15 UTC Comment hidden (obsolete)
Comment 3 Timur 2017-08-08 10:31:40 UTC
Fix from bug 66668 didn't fix this one.
Comment 4 bdy 2017-08-10 14:36:13 UTC
Version: (x64), Build-ID: 7556cbc6811c9d992f4064ab9287069087d7f62c, Win10:

Does not crash, but is busy during save as „Microsoft Excel 2007-2013 XML“ for a while (1-2 minutes?)

Eats up more than 2.2 GBytes(!) of RAM while saving, then returns to normal behaviour an frees the RAM.

Obviously something need to be optimized.
Comment 5 Timur 2017-08-11 14:53:31 UTC
This is a circuclar reference file, but that's not a cause. XLSX without circ. fer. is also slow. Valgrind needed, I guess.
Comment 6 Buovjaga 2018-09-24 15:51:28 UTC
Created attachment 145140 [details]
Callgrind output from master

From saving

Arch Linux 64-bit
Build ID: 8b1501d80dc9d3f42c351c6e026fa737e116cae5
CPU threads: 8; OS: Linux 4.18; UI render: default; VCL: gtk3_kde5; 
Locale: fi-FI (fi_FI.UTF-8); Calc: threaded
Built on 23 September 2018
Comment 7 Buovjaga 2019-04-19 11:42:58 UTC
Created attachment 150884 [details]
Perf flamegraph of saving

Pretty nice plateaus in there

Arch Linux 64-bit
Build ID: 1fee3f1da6291bfbcd75455512726215d41b3e83
CPU threads: 8; OS: Linux 5.0; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded
Built on 18 April 2019
Comment 8 paulystefan 2020-03-10 22:18:56 UTC
Created attachment 158580 [details]
doc saved as ods in LO

doc saved as ods in LO x64 win 10-64

no problem here
Comment 9 Buovjaga 2020-03-11 05:44:04 UTC
Tested saving to XLSX (the original problem) and it only takes like 10 secs, so WFM is correct status.

Arch Linux 64-bit
Build ID: 08334285ec9c7d5356f4b89192a5fba6e6733328
CPU threads: 8; OS: Linux 5.5; UI render: default; VCL: kf5; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded
Built on 8 March 2020
Comment 10 Timur 2020-03-11 08:48:06 UTC
I have a slow Linux test system and it takes 50 secs with master a11c10a83f6fceae6cfb519725d06f8eaf1013fb of yesterday.
And oldest 7.0+ was 60 secs, just slightly better.
Saving from XLSX to XLSX.
I'll set New until retested.
Comment 11 Timur 2020-03-11 09:40:43 UTC
master 7.0+: 
real	0m54,719s
user	1m56,268s
sys	0m5,638s

master 7.0+ with file overwrite: 
real	0m57,447s
user	1m54,335s
sys	0m5,673s

oldest 7.0+ with file overwrite:
real	0m54,229s
user	1m48,155s
sys	0m5,854s

I guess those numbers confirm what I wrote ,please correct if not.
Comment 12 Julien Nabet 2020-03-11 20:32:47 UTC
Created attachment 158624 [details]
perf flamegraph

Here's a Flamegraph retrieved on pc Debian x86-64 with master sources updated today.
Comment 13 b. 2020-06-09 05:52:27 UTC
save as xlsx has a slow point of about 10 sec. with below ver, but no mem problem or crash, 

wouldn't have commented but if the document contains real world data - didn't test but looks like - id recommend to pull it back, in many states spreading of such private information is a verdict ... 

Build ID: 6a03b2a54143a9bc0c6d4c7f1...
CPU threads: 8; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: de-DE (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 14 paulystefan 2020-06-20 20:16:02 UTC
seems ok with also 10 sec

in 7.0.0 beta2 x64 in win 10 x64