Vector<T> too long / bad allocation error

Discuss the spreadsheet application
Post Reply
SMH
Posts: 7
Joined: Tue Mar 05, 2019 10:34 pm

Vector<T> too long / bad allocation error

Post by SMH »

Hello,

I'm using Windows 8.1, with OO 4.1.6, however the issue first appeared with 4.1.5.

I'm at a loss how to fix this issue. I have a personal budget spreadsheet with a page for each month, and then at the end there is a sheet for the yearly budget that keeps track of the total monthly spending for each of the months.

When I hit = and then click on another sheet, Calc crashes with an error message, either "Vector<T> too long" (most often) or "bad allocation" (happens only sometimes). It does not always crash, just most of the time. I would say maybe 1/10 times or so it will actually function as normal and I can update my yearly budget tab without issue.

This is a new issue that has only recently started (at least since version 4.1.5). I have never had any issues updating my budget for all of last year.

Things I have tried:
* Updating to the newest OO version (4.1.6)
* Restarting my computer (and of course restarting OO many times)
* Switching the sheet causing the crash to the beginning of the sheets
* Renaming all of the sheets to not have any spaces or other whitespace, just underscores
* Opening the old file and performing Save As... and saving a new file under a different name
* Making a new user profile, several times
* Making a brand new file that has NO CONNECTION whatsoever to this budget file...it has only 3 sheets with all fake data and resulted in the same error with about the same frequency (ie about 1/10 times it works correctly)

I know from searching these forums that many people have been having this happen for many years but none of the suggestions I could find worked for me. This has never happened before. I have attached the fake data file that is having the same error in case it is useful. If anyone has any suggestions or test ideas I would greatly appreciate it. Thank you :)
Attachments
DataSheetTest.ods
(8.42 KiB) Downloaded 172 times
OpenOffice 4.1.6 on Windows 8.1
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Vector<T> too long / bad allocation error

Post by RusselB »

How much available memory do you have before and after opening the spreadsheet?
Your example caused no problems for my Windows 7 Pro system, running on a 2.5 Ghz quad core system with 8 G ram installed and 7.4G available with sample spreadsheet loaded
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Vector<T> too long / bad allocation error

Post by John_Ha »

Please describe in detail the exact keystroke and mouse sequence required to cause the uploaded file to crash. Say something like

1. Open file
2. Go to sheet ???
3. Left-click in cell ??
4. Type ??
5. ??
Result: ?????

Do a Google search with "Vector <T> too long" - it finds a solved Calc forum thread. Try File > Properties > General > Reset.

Even better, do the following to remove tangles from a heavily edited file by creating a new, untangled version:

1 File > New > Spreadsheet
2. In the new spreadsheet go Insert > Sheet from file. Now pull in all the sheets from the old file.
3. Save the new file.

Showing that a problem has been solved helps others searching so, if your problem is now solved, please view your first post in this thread and click the Edit button (top right in the post) and add [Solved] in front of the subject.
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.
SMH
Posts: 7
Joined: Tue Mar 05, 2019 10:34 pm

Re: Vector<T> too long / bad allocation error

Post by SMH »

@RusselB, do you mean memory as in the "memory" tab on Windows Task Manager or is there another place I should look? It was 67% before opening the file, 68% when this error occurs. I don't see an appreciable difference with my CPU, memory, or disk usage whether this error shows up or not.

I did search Google and was unable to locate any solved thread for Calc, @John_Ha. Could you please link me?

Here are reproducible steps. I will use my uploaded DataSheetTest for an example:
1. Open file.
2. Left click on AddData sheet.
3. Select any empty cell (for an example in my file, B4).
4. Hit the = (equals) key.
5. Left click on DataSheet2 or DataSheet1. The program will immediately pop up an alert box titled "OpenOffice 4.1.6 - Fatal Error" with the contents "vector<T> too long" or "bad allocation".
6. Left click "OK" on alert box. OpenOffice Calc closes.

After some more testing I would say while my original file still works 1/10 of the time, this test file I have uploaded actually works about half the time instead, so the error is less prevalent for whatever reason, but still occurring.
OpenOffice 4.1.6 on Windows 8.1
SMH
Posts: 7
Joined: Tue Mar 05, 2019 10:34 pm

Re: Vector<T> too long / bad allocation error

Post by SMH »

@John_Ha I think you may have edited your post afterwards or I may have missed your other suggestions:

I followed the File > Properties > General > Reset steps. No difference.

I followed your directions to make a new sheet and pull in all the sheets from this file. I saved it with a new filename, closed it, opened the file again and went through the same steps I outlined and got the same crash with "bad allocation".
OpenOffice 4.1.6 on Windows 8.1
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Vector<T> too long / bad allocation error

Post by RusselB »

@SMH: While the percentages look good, they would be more relevant if I knew how much RAM was installed on your system. As you are using Windows 8.1, press the Windows key on your keyboard, then right click on Computer (possibly My Computer), then select Properties. In the section marked System look at the line Installed RAM and report back the number beside usable.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
SMH
Posts: 7
Joined: Tue Mar 05, 2019 10:34 pm

Re: Vector<T> too long / bad allocation error

Post by SMH »

@RusselB thank you. My installed ram is 6GB, 5.86GB usable.
OpenOffice 4.1.6 on Windows 8.1
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Vector<T> too long / bad allocation error

Post by RusselB »

That's plenty of memory for the sample sheet, so I'm at a loss to explain why you are getting the Vector <T> message with the sample sheet.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Vector<T> too long / bad allocation error

Post by John_Ha »

See viewtopic.php?f=9&t=76315. I provided the fixes it suggested above.

Your sample spreadsheet is fine for me following your instructions.

The Google search is "Vector <T> too long"
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.
SMH
Posts: 7
Joined: Tue Mar 05, 2019 10:34 pm

Re: Vector<T> too long / bad allocation error

Post by SMH »

@John_Ha, thank you but I have tried all of the fixes provided in that thread except for trying out different builds of Windows (which I am not too keen on trying) and starting in safe mode. I will try that now.

Was that the thread you mentioned earlier? You also linked me to a Google search but I have only seen one thread where this issue was said to be resolved, and I tried those fixes with no luck.
OpenOffice 4.1.6 on Windows 8.1
SMH
Posts: 7
Joined: Tue Mar 05, 2019 10:34 pm

Re: Vector<T> too long / bad allocation error

Post by SMH »

@John_Ha I just tested the file in safe mode and it continues to throw the same error.

I read a lot more and even downloaded the OO repository off GitHub to peek around in for fun but I'm at a loss. I'm not terribly familiar with C++ and I'm a beginner developer so it's all pretty over my head. Perhaps I will take this over to the Apache OO Buglist and see if I can get anywhere?
OpenOffice 4.1.6 on Windows 8.1
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Vector<T> too long / bad allocation error

Post by John_Ha »

I don't know what to advise. I now see that only one of the posts in the AOO thread(s) I linked to was marked solved and I provided you with those solutions.

Points are:

1. It seems to be an error thrown up by the C (C++?) language
2. Many applications report it - AOO, LO, NotePad++, Tableau, PathOfExile, Autodesk etc so it is not unique to AOO
3. Reading some of the other program reports suggests it is often cleared by manipulating the user data so it may be user data induced

You have done all the recommended things: File > Properties > General > Reset; created a new, untangled version; and reset the profile (note you should have been asked for your user details when you did).

You could try LO. You could try cutting data from the spreadsheet until you find what seems to be causing it. Try splitting the spreadsheet into several smaller spreadsheets. Searching this forum with Vector<T> too long gets these results and some are similar to your problem

Without sight of the actual spreadsheet it is difficult to advise further. See viewtopic.php?f=74&t=8289#p59232 for how to anonymise the data allowing you to upload it (or send it to me - use the Email icon to right of any of my posts).

So I am going to have to echo line three of your original post, namely "I am at a loss ..."

Sorry!
Attachments
Clipboard01.gif
Clipboard01.gif (10.06 KiB) Viewed 6937 times
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.
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Vector<T> too long / bad allocation error

Post by John_Ha »

See [Solved] Referencing Sheets, one of the threads found by the forum search above, where Ziz64 says
The reason of this behavior is that
- the cells have Data Validity setting: "Decimal",
- and the Auto Input feature wants fill the cell with date like TEXTS (based on a cell content above)
when I type in only one number into these cells.

Possible solutions (workarounds):
- Switch OFF the Auto Input feature,
- or switch OFF the Data Validity feature,
- or try to use numeric Date values on the Date rows.
Several other threads in the search have different workarounds which have been shown to work. eg see Bad allocation ; etc. with TeamViewer and AOO's Support assistive technology as causes.

It has been suggested to me that it "often seems to be something to do with an equals sign (or possibly a sequence of equals) being misinterpreted in the underlying C++ code". That ties in with your method to reproduce: type an = in a cell, and then click another Sheet Name; and it's random (and does it with some cells and not others??); and also with Ziz64's analysis of what Auto Input and Data Validity are expecting.

Showing that a problem has been solved helps others searching so, if your problem is now solved, please view your first post in this thread and click the Edit button (top right in the post) and add [Solved] in front of the subject.
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.
SMH
Posts: 7
Joined: Tue Mar 05, 2019 10:34 pm

Re: Vector<T> too long / bad allocation error

Post by SMH »

@John_Ha thank you for your help but none of the suggestions in that thread have changed anything. Here is what I've tried from the thread:

1. Turning OO assistive technology off (and restarting the program).
2. Specifically going into registrymodifications.xcu and changing the [Accessibility] value mentioned in the thread to false.
2. I see no way to disable data validity, but it was set to "all values", and I changed it manually to "whole numbers"; no difference.
3. Turning off auto input.
4. I do not run TeamViewer (and starting in safe mode did not fix the issue).

I think I may have not been clear earlier. It is not that some cells will cause a crash and not others. Using the same cell (in my example, B4 on the AddData sheet) and the same method each time to test which I outlined above, sometimes it will be successful (ie it correctly selects the other sheets and adds the cells with no error) and sometimes it will crash. There seems to me to be no rhyme or reason as to why.

Thank you for your help. :)
OpenOffice 4.1.6 on Windows 8.1
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Vector<T> too long / bad allocation error

Post by RusselB »

I just finished trying the sample on my 3 machines, using both OpenOffice and LibreOffice on each. One uses Windows 7 Pro, another uses Windows 7 Ultimate, and the last runs Windows 95. I even used the Windows 3.1 simulator on the 95 machine to try it in that. No problems with OpenOffice in any of those configurations, and LibreOffice had no problems with the exception of the 3.1 simulator..The LibreOffice installation wouldn't start under the 3.1 simulator, so a different problem.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Vector<T> too long / bad allocation error

Post by John_Ha »

I don't think we can do any more without seeing the actual original file.
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.
User avatar
Zizi64
Volunteer
Posts: 11358
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Vector<T> too long / bad allocation error

Post by Zizi64 »

Here are reproducible steps. I will use my uploaded DataSheetTest for an example:
1. Open file.
2. Left click on AddData sheet.
3. Select any empty cell (for an example in my file, B4).
4. Hit the = (equals) key.
5. Left click on DataSheet2 or DataSheet1. The program will immediately pop up an alert box titled "OpenOffice 4.1.6 - Fatal Error" with the contents "vector<T> too long" or "bad allocation".
6. Left click "OK" on alert box. OpenOffice Calc closes.
I just filled-in your attached file with the described method downto the row 30, without any problem in my AOO 4.1.5 winPenpack portable version.

Tips:
- Try to delete (reset) the user profile of your AOO
- Try a portable version of the AOO or LO (the portable versions work with theirs own user profile settings.)

If all of the tried versions work wrongly for you, then the root of the problem is located in your operating system, or in the hardware (memory) of your PC.


What a Visual C++ version/s/ is/are installed on your PC? How to determine it:
https://community.esri.com/docs/DOC-113 ... e-versions

Maybe some newer installation of the AOO or any other software has changed the older one.

Here is a list from my PC:
Visual c.png
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Vector<T> too long / bad allocation error

Post by John_Ha »

It is quite possible for a program to work on one PC but to fail on a different PC where everything else (program, operating system, configuration, data etc) is identical and I have had personal experience of such a program. One reason this can happen is a race hazard in the code and I believe this is what was causing the problem I was experiencing.

Assume Process_1 is running and it owns Resource_A. Process_2 is also running and, part way through, it needs Resource_B, so takes ownership of it. A little later Process_2 requires Resource_A so it has to pause waiting for Resource_A to be released.

Meanwhile Process_1 runs on and it now needs Resource_B to continue but Resource_B is owned by Process_2. Process_1 therefore pauses waiting for Resource_B to be released.

The program is now hanged.

The race occurs as: can Process_1 get Resource_B before Process_2 attempts to get it?

On some PCs, with given cache size, cache and memory latency and bandwidth, disk performance, Process_1 get Resource_B and the program runs successfully. On other PCs, where cache size, cache and memory latency and bandwidth and disk performance are different, Process_1 does not get Resource_B and the program hangs.

This is, of course, bad programming as no process should be launched until it has reserved all the resources it needs to run to completion.
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.
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Vector<T> too long / bad allocation error

Post by John_Ha »

Search the Calc forum with bad allocation.

I quickly found that it seems to be a bug which only affects very large files - see Issue 125006 - Calc Consistently crashing, usually with "Fatal Error - Bad Allocation"

You might like to switch to LibreOffice and see if LO is better as it is almost certain never to be fixed in AOO - it was reported in 2014.
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.
richfan
Posts: 1
Joined: Thu Feb 04, 2021 2:15 pm

Re: Vector<T> too long / bad allocation error

Post by richfan »

This is a very old thread but in case it helps anyone else who searches for it, I came across this problem and found a very easy workaround.

I was trying to use a formula as
"=JAN.D36+FEB.D36+MAR.D36" etc, where the JAN etc were the sheet names, but I kept getting either Fatal Error with message Vector<T> Too long or Bad Allocation

I simply changed the foruma to have a leading zero and it worked
"=0+JAN.D36+FEB.D36+MAR.D36"

Hope this helps someone else.
OpenOffice 4.1.8 on Windows 10 Pro 64-bit
Post Reply