[Solved] Writer hangs with big, complicated .odt document

Discuss the word processor
Locked
etienne_thijsse
Posts: 7
Joined: Thu Dec 23, 2021 4:55 pm

[Solved] Writer hangs with big, complicated .odt document

Post by etienne_thijsse »

I have a big, complicated .odt document, and when I try to edit in a specific chapter, writer hangs (or loops).
This happens on Windows 10, OO version 4.1.10 an 4.1.11.
It looks like the hang occurs when the nr of lines changes. I tried to move a section (using the Navigator, actually) to another chapter and it hung. Then I tried to delete the section (so as to re-insert it in that other section), and Writer hung. Then I tried deleting the section line by line, and it hung after some four linmes were left. Then I tried deleting some lines, insert a few empty lines in another section, and then delete the rest of the section, and that worked... but now it hangs when I delete those empty lines I inserted in that other section.
Interestingly, I can do all these things in other chapters... :crazy:
Except when I try to make a testdocument and delete everything that is not in this chapter, then it freezes up constantly ...
Last edited by Hagar Delest on Sun Dec 21, 2025 10:34 pm, edited 1 time in total.
Reason: tagged [Solved].
OpenOffice 4.1.11, Windows 10.
John_Ha
Volunteer
Posts: 9604
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Writer hangs

Post by John_Ha »

That is almost certainly working as designed.

If you have a large, complex document, especially one with images, footnotes and/or an index. What is happening is you are moving some text which causes a page spill which ripples through the entire document so that every subsequent page has to be laid out again. The index cannot be built until all pages have been laid out. See 11A. Why is my page count so high? Why does my page count keep changing? Why do white gaps appear in my document? in [Tutorial] Some useful hints on using images for some tips.

On Windows, the document freezes while the page being viewed is laid out and the unfreezes, allowing you to edit it, while laying out is done in the background. On Linux, it seems to freeze until laying out has completed.

A quick test is to open the document and observe the page count at bottom left. It will be quite unstable, mostly too high, while the document is being laid out. A long (thousand plus pages) could take up to 30 minutes to lay out. Alternatively, make a significant change and watch the AOO CPU usage in TaskManager. It will be high while the document is being laid out and will only fall to a low value After it has finished laying out.

A document which has been heavily edited also gets "tangled" - search the forum with tangled - and unresponsive. The cure is often to open a fresh, empty text document and File > Import ..., and pull in the document.
Last edited by John_Ha on Fri Feb 18, 2022 8:46 pm, edited 2 times in total.
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
Hagar Delest
Moderator
Posts: 33633
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Writer hangs with big, complicated .odt document

Post by Hagar Delest »

You can try LibreOffice to see if it behaves better. Else, the best would be to share the document so that e can have a look at it.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE 7 Gigi) and 25.2 portable on Windows 11.
etienne_thijsse
Posts: 7
Joined: Thu Dec 23, 2021 4:55 pm

Re: Writer hangs with big, complicated .odt document

Post by etienne_thijsse »

LibreOffice does behave better. But it has its own problems, printing does not work properly.

I am not buying that this is by design.
Especially seeing that LibreOffice does not have this problem. And that this problem only occurs in a specific range of the document. Not before that range and not after it; doing similar edits before that range would certainly cause the same "ripple"effect.

Sharing the document is not an option, it is copyrighted.

Anyway, I managed to work around it by adding some whitespace and page breaks here and there. Until it happens again, that is... after a while the problems keeps on re-appearing, necessitating adding more whitespace and page breaks (or removal of the ones I added before!)

The next time this happens I will try that import thing you mentioned, eventhough I do not believe for a second that this is "as designed", that would be really crappy design; I'll give that a try anyway.

I tried doing the editing in LibreOffice and the printing with OpenOffice but, while LibreOffice can open the OpenOffice document without problems, OpenOffice cannot open the document again after LibreOffice has saved it. So that is a no-go. If it were not for LibreOffice's printing issues I would have moved to LibreOffice. I am not so happy with OpenOffice anymore.
OpenOffice 4.1.11, Windows 10.
User avatar
Zizi64
Volunteer
Posts: 11505
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Writer hangs with big, complicated .odt document

Post by Zizi64 »

But it has its own problems, printing does not work properly
What do you mean as "not work properly"?
LO printing works for me fine.
Which version of the LO are you using?

(Please create a new topic for this issue, because it is a different problem...)
Tibor Kovacs, Hungary; LO7.5.8/25.8.5.2 /Win7-10-11 x64Prof.
PortableApps: LO3.3.0-25.8.5.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.
User avatar
RoryOF
Moderator
Posts: 35210
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Writer hangs with big, complicated .odt document

Post by RoryOF »

A very complex document might better be edited as a Master Document in either OpenOffice or LibreOffice; this permits fairly speedy rearrangement of chapters, and editing of a chapter as a separate unit.

On some computer architectures, OpenOffice (I cannot speak for LibreOffice) can be very slow on large files (several thousand pages) when page structure is changed.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
etienne_thijsse
Posts: 7
Joined: Thu Dec 23, 2021 4:55 pm

Re: Writer hangs with big, complicated .odt document

Post by etienne_thijsse »

Since my question isn't about LibreOffice I did not elaborate on the printing problems, I just wanted to say LibreOffice is not an option for me.
But since you asked, the problem I have with LibreOffice (version 7.1) is printing with the "Generic / Text Only" printer driver. The output only contains 0xFF bytes (one per page it seems), nothing else. No text at all.

OpenOffice can do this without problem.

If the import trick mentioned earlier doesn't work I will investigate this Master document concept, I have not heard of that before. Thanks for the tip.
OpenOffice 4.1.11, Windows 10.
User avatar
Zizi64
Volunteer
Posts: 11505
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Writer hangs with big, complicated .odt document

Post by Zizi64 »

Please download and try to open Andrew Pitonyak's free macro book. Not for the macro informations, but it is a huge, and well structured ODF document created with AOO or LO.
If it works for you well, then (maybe) the structure of your document has some issues: Maybe it contains huge unoptimized images, converted styles and incompatible direct formatting properties, inherited from a M$ document, missing fonts, or others...

https://www.pitonyak.org/OOME_3_0.odt

https://www.pitonyak.org/oo.php
Tibor Kovacs, Hungary; LO7.5.8/25.8.5.2 /Win7-10-11 x64Prof.
PortableApps: LO3.3.0-25.8.5.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.
User avatar
RoryOF
Moderator
Posts: 35210
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Writer hangs with big, complicated .odt document

Post by RoryOF »

"Hang" is imprecise. I suggest you initiate an operation that causes "hang", then leave computer for a long time - overnight is good - to see if the "hang" is slow processing by the application.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
User avatar
keme
Volunteer
Posts: 3791
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Writer hangs with big, complicated .odt document

Post by keme »

etienne_thijsse wrote:[...]
Except when I try to make a testdocument and delete everything that is not in this chapter, then it freezes up constantly ...
A shot in the dark, if you want: try a "visit" to LibreOffice.
  • Make a copy of your document and open that in LibreOffice Writer.
  • Select menu item Tools - Options and then branch Load/save - General.
  • Select 1.2 for default save format (the simple one without specified "extended/compatibility" mode)
  • Save your document.
  • Open the copy again in OpenOffice Writer. See whether it behaves better.
This just might clean up incostistencies in your document. It may also mess up really bad if LO encounters unexpected elements.
Do it only on a copy, as specified. Do not perform this operation on your original work document!

Also, it may be possible to create some forensic material for us to examine:

Are you able to delete absolutely all content from that test document, or does that also make system freeze?

If you can delete all, submit that empty document as an attachment here. Even a document emptied of content may hold clues about what has happened to document structure.
User avatar
Hagar Delest
Moderator
Posts: 33633
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Writer hangs with big, complicated .odt document

Post by Hagar Delest »

etienne_thijsse wrote:the problem I have with LibreOffice (version 7.1) is printing with the "Generic / Text Only" printer driver. The output only contains 0xFF bytes (one per page it seems), nothing else. No text at all.
As a workaround, you can export to PDF first and then print that file.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE 7 Gigi) and 25.2 portable on Windows 11.
etienne_thijsse
Posts: 7
Joined: Thu Dec 23, 2021 4:55 pm

Re: Writer hangs with big, complicated .odt document

Post by etienne_thijsse »

I'll try that LibreOffice trick when it happens again, maybe OpenOffice can read it when saved that way. Thanks for the tip.

Letting it run overnight to see if it eventually wil finish.. not sure how that knowledege will help me. It is still an unexceptable situation.. I am not going to wait several hours every time adding a line in that chapter causes OO to hang, even if I know it will eventually finish. I'll still kill it after say 15 minutes and try my workarounds again. (but I might just do this once, in the hope that after that it has magically fixed whatever was wrong so that the problem won't occur again...)

That macro document seems to work ... the navigator flickers a lot and pages move one or two lines up and down all by themselves... but there is no hang, its stays responsive and allows editing. When I close the document it becomes unresponsive for half a minute, but that's all. Nothing like the hang with my document...

Which I think confirms that the problem is something in that particular section of my document.
I use a Hebrew and greek font, but that is spread throughout the document, not just in this part, so I don't think that could be the problem. There are also pictures in the document, but not in this particular section.

Thanks for the suggestions, I have some more things to try next time this happens.
OpenOffice 4.1.11, Windows 10.
User avatar
Zizi64
Volunteer
Posts: 11505
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Writer hangs with big, complicated .odt document

Post by Zizi64 »

That macro document seems to work ... the navigator flickers a lot and pages move one or two lines up and down all by themselves...
Please share some information about the hardware. (Memory size, processor speed, etc...)
Tibor Kovacs, Hungary; LO7.5.8/25.8.5.2 /Win7-10-11 x64Prof.
PortableApps: LO3.3.0-25.8.5.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: 9604
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Writer hangs with big, complicated .odt document

Post by John_Ha »

etienne_thijsse wrote:I am not buying that this is by design.
I said "That is almost certainly working as designed" which means AOO is designed to layout and paginate huge, complex documents and this can take a long time - 30 minutes or more to complete.

See [Solved] AOO stops responding when opening this one document from the Tutorial you were pointed to.
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.
etienne_thijsse
Posts: 7
Joined: Thu Dec 23, 2021 4:55 pm

Re: Writer hangs with big, complicated .odt document

Post by etienne_thijsse »

In case anyone else has this problem and finds this post:

Four years after posting this I finally solved this problem (I think...)
In the mean time I have moved to a new laptop that is way faster than the one from four years ago. Some had suggested that I just wait it out, saying it wasn't really hanging but just slow. I tried that on this new faster laptop but alas, it really hangs.
Today I upgraded to version 4.1.16, hoping the problem would be fixed in this new version, but no, its not.
So I turned to AI :lol: to tell me what could be causing this. After lots of trial and error its conclusion was that it must be a bookmark that is bad.
I had the AI (Copilot) write me up a little C program that scans content.xml for bad bookmarks, and indeed, it found a number of them. But the first one I fixed in content.xml was already the culprit. After fixing that in the XML and rebuilding the TOC the hang that I could consistently reproduce is gone. Yeah, thanks AI :super: .

The problem with the bookmark was that there were two intertwined, like this:
<start-bookmark A>
<start-bookmark B>Header text<end-bookmark A>
<end-bookmark B>
So two where only one is expected, and not start-A - end-A followed by start-B - end-B but intertwined, start-A - start-B - end-A - end-B.
Its a really big document with a lot of bookmarks so finding this myself would have taken ages, the C program the AI gave me helped me a lot.

If anyone is interested in that C program I'll post the code.
OpenOffice 4.1.11, Windows 10.
User avatar
MrProgrammer
Moderator
Posts: 5432
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Writer hangs with big, complicated .odt document

Post by MrProgrammer »

etienne_thijsse wrote: Sun Dec 21, 2025 7:56 pm So two where only one is expected, and not start-A - end-A followed by start-B - end-B but intertwined, start-A - start-B - end-A - end-B.
I would say that:
• content.xml is damaged, and
• neither OpenOffice nor LibreOffice has diagnosed this error duirng open.

etienne_thijsse wrote: Sun Dec 21, 2025 7:56 pm After fixing that in the XML and rebuilding the TOC the hang that I could consistently reproduce is gone.
That is excellent news.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
etienne_thijsse
Posts: 7
Joined: Thu Dec 23, 2021 4:55 pm

Re: [Solved] Writer hangs with big, complicated .odt document

Post by etienne_thijsse »

I noticed there is a side effect of my editing the XML directly though... :(
Writer has added spaces around all references to bookmarks, endnote numbers and chapter headings.
I can get rid of most of these with some global search and replaces, but not all.
But at least no more hang :D
OpenOffice 4.1.11, Windows 10.
User avatar
RoryOF
Moderator
Posts: 35210
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] Writer hangs with big, complicated .odt document

Post by RoryOF »

Another possibility might be to put content.xml through an xml file checker.

Direct editing of an OpenOffice xml file can lead to disaster; it is always wise to have a backup.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
etienne_thijsse
Posts: 7
Joined: Thu Dec 23, 2021 4:55 pm

Re: [Solved] Writer hangs with big, complicated .odt document

Post by etienne_thijsse »

Another possibility might be to put content.xml through an xml file checker.
I had it go through one, the XML was ok it said.
But it's a generic XML validator that only verifies the XML is valid, it can't spot OpenOffice specific problems.
It would be nice if there was a tool specifically for OpenOffice Writer content.xml, that would have saved me four years having to work around this. Do you know of one? If not then my little AI generated C program will have to do.

(BTW, I did all my editing on a copy first, and only made that copy the main document when all my tests with bookmarks and the TOC turned out fine. The original document I still have, just in case)
OpenOffice 4.1.11, Windows 10.
JeJe
Volunteer
Posts: 3132
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Solved] Writer hangs with big, complicated .odt document

Post by JeJe »

A regex search on the content.xml can find all the bookmark start and ends. Testing there's none out of sequence would just require going through the search result.
bookmark-start text:name=.*?(?=\/)|bookmark-end text:name=.*?(?=\/)
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
floris v
Volunteer
Posts: 4638
Joined: Wed Nov 28, 2007 1:21 pm
Location: Netherlands

Re: [Solved] Writer hangs with big, complicated .odt document

Post by floris v »

JeJe wrote: Mon Dec 22, 2025 6:53 pm A regex search on the content.xml can find all the bookmark start and ends. Testing there's none out of sequence would just require going through the search result.
bookmark-start text:name=.*?(?=\/)|bookmark-end text:name=.*?(?=\/)
The problem with that is that you have to know what the problem is. It might be other wrongly placed close tags that cause OO or LO to hang.
LibreOffice 25.8.4.2 on Ubuntu Linux
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
John_Ha
Volunteer
Posts: 9604
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Writer hangs

Post by John_Ha »

I repeat my earlier advice. The XML checker which reads files being brought into AOO seems somewhat better than any checking performed when an open file is written. Pulling the faulty file into a new, empty document would probably have solved the problem.
John_Ha wrote: Thu Dec 23, 2021 8:39 pm A document which has been heavily edited also gets "tangled" - search the forum with tangled - and unresponsive. The cure is often to open a fresh, empty text document and File > Import ..., and pull in the document.
Search with tangled for 156 similar posts.
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.
Locked