Issue 124513 - "Bad allocation" when opening file, caused by reference list
Summary: "Bad allocation" when opening file, caused by reference list
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: open-import (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC Windows, all
: P3 Major (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-26 07:11 UTC by Ulrich Margull
Modified: 2014-10-21 15:30 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.1.0-beta
Developer Difficulty: ---


Attachments
Stripped-down version of corrupted document (caused by reference list) (63.41 KB, application/vnd.oasis.opendocument.text)
2014-03-26 07:11 UTC, Ulrich Margull
no flags Details
replaced bad style-name values with Bibliography_20_1 (53.73 KB, application/vnd.oasis.opendocument.text)
2014-03-26 11:29 UTC, j.nitschke
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Ulrich Margull 2014-03-26 07:11:48 UTC
Created attachment 82978 [details]
Stripped-down version of corrupted document (caused by reference list)

The appended document crashes when opening with OO Writer 4.0.1, caused by the reference list. Document was edited in both OO and Libreoffice.
Comment 1 Oliver-Rainer Wittmann 2014-03-26 07:34:02 UTC
I can confirm this issue on Windows 7.

I reproduced the crash with OOo 3.0.0, OOo 3.3.0, AOO 3.4.0 and AOO 4.0.0

@Ulrich Margull:
Do you have some more information on how the document has been created?
Comment 2 Ulrich Margull 2014-03-26 08:00:59 UTC
Document history:
- it was created 10 yrs ago with OO 1.x (I think I remember 1.3), 180 pages, about 150 figures
- Lately, I modified it using Libreoffice.
- Then, I added the reference list (dont know whether this was done in Libreoffice or Openoffice). The reference list is connected to literature.odb, which in turn is connected to literature.ods

The document could still be opened in LibreOffice. So, I was able to find out that the reference list caused the crash. Removed the reference list from the big document (in LibreOffice), added a new reference list (in OO), and currently everything seems to be fine.

PS: Although LibreOffice could open the document, it would crash within 10 mins on the full (180 pages, 150 figures) document.
Comment 3 Edwin Sharp 2014-03-26 08:30:10 UTC
Confirmed with
AOO410m14(Build:9760)  -  Rev. 1573601
2014-03-03 17:47:48 (Mo, 03 Mrz 2014)
and
OpenOffice.org 2.4.3 
Win 7
Comment 4 j.nitschke 2014-03-26 09:18:54 UTC
dissecting the file:
content.xml has many lines like this (drastically shortened)
<text:index-entry-bibliography text:style-name="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 _5f_..._5f__5f..._5f_20_5f..._5f__5f_..._5f_30_5f_..._5f_" text:bibliography-data-field="identifier"/>

the style-name string is 21130 chars long

replacing the bogus style-name the file opens fine
Comment 5 j.nitschke 2014-03-26 09:34:49 UTC
I replaced the style-name value with "Bibliography_20_1"

opening and saving the file again with AOO 4.1 beta it changed to
"Bibliography_5f_20_5f_1"

so each save adds more stuff to the string till it can't be read anymore

that is 2 errors:
first faulty save
second the bad allocation when opened
Comment 6 j.nitschke 2014-03-26 11:29:19 UTC
Created attachment 82986 [details]
replaced bad style-name values with Bibliography_20_1

"_" -> "_5f_" replacement is done on saving

to check:
* cursor on the index:
* Insert -> Indexes and Tables ... -> Indexes and Tables ... -> Entries
* Mouse over the structure fields shows: 
  "Short name Character Style Bibliography_20_1"

save and reload file a few times -> repeat above steps
Comment 7 Louis Bushard 2014-10-21 15:30:25 UTC
"Bad Allocation". This happens to me frequently. I have new Lenovo Ultrabook with Windows 8.1. It has been happening ever since Open Office 4.x.x was released. It did not happen before. It frequently happens when I have a .ods file open and then I access the associated macro file. Once recovered, I do not get "Bad Allocation" when accessing the macro file