Bug 103522

Summary: endless loop automatically saving document after changes with "record changes"
Product: LibreOffice Reporter: Ulrich Windl <u20230201>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED INVALID    
Severity: normal CC: u20230201
Priority: medium    
Version: 5.1.5.2 release   
Hardware: All   
OS: Windows (All)   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: Screen Shot (some areas obfuscated) showing Writer saving the document

Description Ulrich Windl 2016-10-26 13:29:28 UTC
(This is most likely not reproducible due to the nature of the bug)
From time to time with "record changes" on, Writer produced strange layout, but I could undo the specific change.
When I had cut some numbered sections (with images and legend inside) and inserting the sections at a different position, I redecided and cut the section again and inserted it at a different place. The sections had hyperlinks (inside the document) also.
After inserting the clipboard, the layout was wrong (like mixing a heading with the following text, and when trying to insert a paragraph break, another heading was inserted, even though the next format should have been body text). Soon after that Writer went into a loop when it continuously said it would save the document. I could not stop that loop! (Hoping not to loose an afternoon of writing work)...
Comment 1 Ulrich Windl 2016-10-26 13:42:56 UTC
Created attachment 128286 [details]
Screen Shot (some areas obfuscated) showing Writer saving the document

This screen shot shows Writer repeatedly saving the document. Between Section 4 and 5 is the problem described: Writer started a new section, even though the pasting had occurred above section 4.
Comment 2 Ulrich Windl 2016-10-26 13:48:39 UTC
Eventually I could select File->Exit, and Writer asked me whether to save the document. When I agreed, it said it couldn't save the document (some problem with content.xml). So I had to quit without saving.
When inspecting my profile directory, I found that Writer had created more than 1000 backup files of the document, all being size zero.
When restarting, all the changes I had made were gone!
(I didn't have such a frustrating experience since using WinWord 2.0 with Windows 3.1. Congratulations!)
Comment 3 Timur 2016-10-26 14:14:02 UTC
While it's surely frustrating, it can be solved only if reproducible, with the attached document and steps needed to recreate the problem.
It would be fine if you could follow: https://wiki.documentfoundation.org/How_to_get_a_backtrace_with_WinDbg
Or maybe run all the time (after LO or via script) in order to get a dump with: path-to\SYSINTERNALSSUITE\procdump.exe soffice.bin -h   path-to\soffice.bin.dmp
Comment 4 Ulrich Windl 2016-10-27 06:34:15 UTC
As said in the description, it was an afternoon of work that was lost. So most likely it is very hard to reproduce, especially as LibreOffice did not make a single usable automatic backup, so I don't have a "last valid state" before loosing all the changes.
I see multiple problems here:
1) LibreOffice does not produce a valid last automatic backup. All the backup files (more than 1000 created in one minute!) have size zero. Other program have quite better algorithms.

2) When creating an automatic backup fails, there is no message; instead saving is retried over and over.

3) When trying to save manually there is some message popup that neither helps the use, nor the developer, because it's lacking essential details.

4) The main problem seems that "record changes" has several issues, one of them is obviously destroying the internal document data structure, so Writer does crazy things, eventually being unable to save what is has.

While I try to reproduce 4) you could star fixing 1) to 3) ;-)
Comment 5 Ulrich Windl 2016-10-27 11:49:09 UTC
Working with the same document, I still could not reproduce the problem, but I noticed that with record changes the cursor changed position (by multiple pages) after some minor editing (like inserting a single sentence). Eventually Writer crashed when I pressed the right mouse button over an image. Fortunately there was a valid auto-save this time.
Comment 6 Timur 2016-10-27 15:04:51 UTC
Please understand this in invalid report for a bug. 
If you can write step-by-step procedure to reproduce and attach the document, feel free to reopen.