[Solved] Calc crashes on adding multiple chart objects to spreadsheet

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
John23
Posts: 13
Joined: Tue Feb 16, 2021 10:24 pm

[Solved] Calc crashes on adding multiple chart objects to spreadsheet

Post by John23 »

Hi everyone,

I'm having troubles with generation of report that contains multiple charts.
The amount of charts on one sheet could be up to 500.

At some point during generation, when Libre Office Calc reaches around 1500 Mb of used RAM, application crashes with message:
"soffice(13348) has encountered an error and will be terminated..."

And I get following errors in log file:
"[mscx_uno bridge error] UNO type of C++ exception unknown: "std.bad_alloc", RTTI-name=".?AVbad_alloc@std@@"!"

I have tried three versions of LibreOffice x64 (7.4.0, 7.3.6, 7.2.7) to open this report but it crashes when Calc is reaching around 350 Mb of used RAM.
Tried setting max limits for cache related options in Expert Configuration settings.
Didn't help.

What could be done in this case?
Thanks.
Last edited by John23 on Mon Sep 19, 2022 7:47 pm, edited 2 times in total.
LibreOffice 7.2.7 x64 on Windows 10 x64
JeJe
Volunteer
Posts: 2763
Joined: Wed Mar 09, 2016 2:40 pm

Re: Calc crashes on adding multiple chart objects to spreadsheet

Post by JeJe »

Have you tried saving as an .ods file first?
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
John23
Posts: 13
Joined: Tue Feb 16, 2021 10:24 pm

Re: Calc crashes on adding multiple chart objects to spreadsheet

Post by John23 »

Opened report in Excel and saved as .ods.
Was able to open new .ods report with LibreOffice.

It took up to 20 sec to fully load but at least there is no crash.
Thanks for the tip.

Received this warning during opening with default LibreOffice settings:
image_2022-09-13_165747739.png
image_2022-09-13_165747739.png (4.68 KiB) Viewed 1518 times
A bit weird as I have up to 15 columns and a lot of rows.

Then I successfully saved opened .ods document as .xlsx as I have requirement to save as .xlsx.
And failed to open this new xlsx document.
---------------------------------------------------------------------------------------------

However I still cannot generate report using API as it crashes during building somewhere at 75% of the way.
Not reaching the point where I could try and save document.
LibreOffice 7.2.7 x64 on Windows 10 x64
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Calc crashes on adding multiple chart objects to spreadsheet

Post by John_Ha »

I have seen the "maximum columns" error before.

Excel has more columns than AOO or LO. If you format a complete row in Excel the saved format data includes the maximum column number which is larger than AOO or LO can handle. When LO reads that maximum column number it throws the error.

Just reformat the row(s) so that only the columns you need are formatted. Perhaps easiest is to copy the cells or columns you need and paste them into a new sheet.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
John23
Posts: 13
Joined: Tue Feb 16, 2021 10:24 pm

Re: Calc crashes on adding multiple chart objects to spreadsheet

Post by John23 »

Thanks for the suggestion.

Actually I don't need to work with old report (built using MS Excel) as I'm planning to generate one using UNO API.
Was added as a reference mainly.
Looks like LO is not crashing when opening ods report of the same complexity with ~500 charts.
Still cannot generate and save such report though.

Now I'm trying to generate report with document being hidden.
It appears that LO consumes less memory so it might be able to stay within the RAM limit.
When the report is ready I could try and save it in ods/xslx format and show it.

However it looks like that there is no point in saving in xslx as user won't be able to open this report later due to crash.
LibreOffice 7.2.7 x64 on Windows 10 x64
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Calc crashes on adding multiple chart objects to spreadsheet

Post by Villeroy »

What is a report? Where do the reported data come from? Do you mean database report?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
John23
Posts: 13
Joined: Tue Feb 16, 2021 10:24 pm

Re: Calc crashes on adding multiple chart objects to spreadsheet

Post by John23 »

By report I mean regular spreadsheet with charts and tables with data for these charts.
There is no DB involved at least at the moment the spreadsheet is generated.
Data comes from the list of values calculated and populated by .Net app logic.
Each chart is small and simple. The issue is about the amount of these charts.
LibreOffice 7.2.7 x64 on Windows 10 x64
John23
Posts: 13
Joined: Tue Feb 16, 2021 10:24 pm

Re: Calc crashes on adding multiple chart objects to spreadsheet

Post by John23 »

I was able to bypass the issue mentioned in the main post.

1. I'm building spreadsheet document in hidden mode and showing it to user when it is ready.
Tested adding 1000 chart objects to the spreadsheet and there was no crash.
When I tested adding 2000 objects it crashed somewhere at 1.5K.
In my case I'm working with 500 objects so that will do.

2. Second issue was crash during saving generated document as xslx and opening xslx file.
Bypassed this by switching to ods.
JeJe, thanks for the tip.

I guess this post could be marked as solved.
LibreOffice 7.2.7 x64 on Windows 10 x64
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Calc crashes on adding multiple chart objects to spreadsheet

Post by Villeroy »

Alternative approach with one chart and many exchangable data sets: https://forum.openoffice.org/en/forum/d ... hp?id=3004
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply