Bug 99225 - Formulas disappearing and shrinking, and enlarging (steps in Comment 14)
Summary: Formulas disappearing and shrinking, and enlarging (steps in Comment 14)
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.3.2 release
Hardware: All All
: high major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: dataLoss
: 45349 88859 113900 114399 139605 (view as bug list)
Depends on:
Blocks: Formula-Editor RTL-CTL
  Show dependency treegraph
 
Reported: 2016-04-11 12:59 UTC by Ben
Modified: 2021-06-24 19:06 UTC (History)
22 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of formulas disappearing (24.07 KB, image/png)
2016-04-11 12:59 UTC, Ben
Details
Second example without a tabld (33.90 KB, image/png)
2016-04-11 21:54 UTC, Ben
Details
The format menu (8.75 KB, image/png)
2016-04-11 21:55 UTC, Ben
Details
File that reproduces the problem (99.49 KB, application/vnd.oasis.opendocument.text)
2016-05-18 07:39 UTC, Ben
Details
a manually corrected version of "File that reproduces the problem" (126.43 KB, application/vnd.oasis.opendocument.text)
2018-09-17 19:12 UTC, Dina
Details
File with disappearing formulas(last one and 3rd to last) (91.65 KB, application/vnd.oasis.opendocument.text)
2019-12-01 17:52 UTC, Nicolas Santamaria
Details
File with disappeared formula(big white square near the end of the file) (253.63 KB, application/vnd.oasis.opendocument.text)
2020-04-10 15:44 UTC, bigicecream
Details
simplified file with problem with copy-paste of the second formula (19.89 KB, application/vnd.oasis.opendocument.text)
2020-09-10 16:37 UTC, mariusdavid
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ben 2016-04-11 12:59:35 UTC
Created attachment 124253 [details]
Screenshot of formulas disappearing

Hello,

I'm studying engineering and am using OpenOffice to write everything during class (very convenient! Really intuitive syntax!). The only problem is that the formulas disappear. I'm not exactly sure when the problem started. I have had it on two computers. I updated to the newest version, that didn't help so I downgraded to the 4.4.3 , the problem went away for a couple of hours and then came back.
This is making the use of LibreOffice near impossible, I would love a fix.
I'm attaching a screenshot which demonstrates the problem. It also exists in exactly the same way without a table. As you can see some of the formulas shrink, some lose proportions and get larger, and when I double click them the contents disappear both graphically and in the "command line" where you type the content so there's no way to restore them.

I would love a solution because I'm really enjoying LibreOffice.

Thanks,

Ben
Comment 1 V Stuart Foote 2016-04-11 16:18:15 UTC
Hey Ben,

Thanks for posting. We needs some additional details about your Windows version. 
Also, open a Math formula edit session and tell us what fonts show from the Format -> Fonts dialog. And also from the Tools -> Symbols dialog when selecting a symbol and using the Edit button--the Font value.

Also, what steps are you using to insert the formula into Writer.

From the screen shot it looks like you are working in a Table, and then are inserting a formula into a cell of a table.  Was the Table at its full size, or are you adding rows to the table as you go?

What about outside the table.  Are you inserting formulas there? And, do they remain intact as you continue to edit?

We need a set of steps to reproduce the issue reliably. And ideally, a test Writer .odt document, including all of the OLE formulas before they go missing--the minimal test case that when opened reliably recreates the loss of the formulas from the table cells.
Comment 2 Ben 2016-04-11 21:54:56 UTC
Created attachment 124261 [details]
Second example without a tabld
Comment 3 Ben 2016-04-11 21:55:14 UTC
Created attachment 124262 [details]
The format menu
Comment 4 Ben 2016-04-11 21:57:31 UTC
Thanks for the quick response,
I'm usually running Windows 8.1 but my computer is being fixed so right now it's Windows 10. I have the exact same problem on 8.1
Usually I don't work in a table, this was just an example.
It's hard to reproduce, it happens either when I insert a new formula or sometimes I just keep writing and it disappears. Other times I scroll up and the formulas are gone. I use the F2 shortcut to get to the formulas editor. When I installed Libre Office the default shortcut would just give me a sort of text field that didn't do anything. I changed it to Formula. No idea what's the different.
I don't see the Tools->Symbols but I'm attaching the Edit part.
The table isn't a major issue for me, I rarely have to work with tables, the problem is when it's in text.
I'm attaching another screenshot without a table and in the comments are the formulas.
I don't select symbols, I type everything by hand.

Thanks,

Ben
Comment 5 V Stuart Foote 2016-04-11 22:50:56 UTC
Ben,

Please turn-off OpenGL rendering to see if formula rendering is more stable using the default graphics rendering and system driver.  

Done from Tools -> Options -> View: "Use OpenGL for all rendering" checkbox. And then restart LibreOffice.
Comment 6 Ben 2016-04-12 07:20:45 UTC
It's already off. Is there anything else I can try?
Comment 7 Ben 2016-04-13 06:57:44 UTC
Hi,
I've noticed today that it happens a lot (shrinking, enlarging or disappearing altogether) when I create a new formula. Is there any more info I can give?
Comment 8 Buovjaga 2016-04-29 14:37:39 UTC
Could not reproduce.
So, does this happen consistently with new documents or only on some existing document? If it is only with a certain document, you have to attach it.

Win 8.1 32-bit
Version: 5.2.0.0.alpha1+
Build ID: 16777b6bb0267c2b0602f1007a1e1fecac81329b
CPU Threads: 4; OS Version: Windows 6.2; UI Render: default; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2016-04-29_05:45:00
Locale: fi-FI (fi_FI)
Comment 9 Ben 2016-05-01 13:44:02 UTC
Hello,

It happens with all documents, both new and ones I'm editing. I've noticed that it happens often when I edit a formula on the same line/page
Comment 10 Ben 2016-05-03 21:15:12 UTC
Hello,
Might it have something to do with the fact that I often write in Hebrew? Maybe the change from "right to left" to "left to right" is causing it?
Comment 11 Ben 2016-05-11 22:36:33 UTC
Anybody? This is driving me crazy
Comment 12 V Stuart Foote 2016-05-11 23:36:06 UTC
Sure it could be the local LtR and RtL conflicting, but we are still waiting for a sample document and reliable consistent Steps to Reproduce the issue.

The simple the test case and STR the more likely we can tease out the issue you are having by duplicating on another system/locale.
Comment 13 Ben 2016-05-18 07:39:12 UTC
Created attachment 125137 [details]
File that reproduces the problem
Comment 14 Ben 2016-05-18 07:40:04 UTC
I have finally managed to create a situation where the error is reproducible. If you try to edit the formula with S_1 at the bottom the content disappears.

Thanks!
Comment 15 Buovjaga 2016-05-18 10:05:13 UTC
(In reply to Ben from comment #13)
> Created attachment 125137 [details]
> File that reproduces the problem

Yep, repro by double-clicking on the second to last formula (on page 3).

Win 7 Pro 64-bit Version: 5.2.0.0.alpha1+
Build ID: f688acfdae00ebdd891737e533d54368810185e1
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2016-05-18_00:11:31
Locale: fi-FI (fi_FI)
Comment 16 V Stuart Foote 2016-05-18 10:43:28 UTC
Hmm, yes something is not correct.

Open the ODT archive, and the content.xml for at least OLE objects 32 -> 35 contain only a MathML <display> <block>, but no actual StarMath markup! OLE object 31 and 36 are correct.

Looking in the ObjectReplacements directory, each math formula OLE object does register an SVM meta (and is why the formulas still render onto the canvas).

But where did the StarMath content for each OLE go?  And are they "disappearing" while editing because the rendered SVM meta are flushed out of the ObejctReplacements directory when an empty OLE is reparsed?
Comment 17 Ben 2016-05-18 11:15:10 UTC
They disappear either when I double click a formula or sometimes when I edit the documents, for example adding spaces or if I move a line or a part of a line down.
I'm not sure what the rest of what you said means, is there any more info I could provide?
Comment 18 V Stuart Foote 2016-05-18 11:51:22 UTC
@Ben, 

Sorry, comment was for the devs as I was digging into the Writer ODT document archive where the Math formulas are all Object Linked Embedded (OLE). Problem is that the temporary images created of the files are present for each OLE (the StarView metafiles found in the ObjectReplacements directory) but the actual formulas are deleted from, or are not being written to, their respective ODF formula objects!

Meaning when the page refreshes in some fashion, rereading the formulas from the embedded objects, since the formula object is empty when parsed the resulting meta image is blank and the formula disappears from the document canvas.

Moving forward we need to figure out why the StarMath formulas are not being written back into their respective objects. Or are being written and then cleared on a subsequent rewrite.

The sample document helped confirm there is an issue, but we still have to reproduce it. This is likely a cache and memory management issue for your OS and build of LibreOffice.

Lets see if one of the devs picks it up and has specifics for you.

You may need you to update to current LibreOffice release 5.1.3.2 and retest. 

Also, you might check if a periodic <Ctrl>+S forced save (writing any pending updates to the formula objects back to their containers) reduces the frequency of losing the formulas from the document page.

In fact, lets make that a needinfo: 
1. While taking notes into writer and inserting formula objects do you save the document with a <Ctrl>+S? 
2. If so how often?
3. And does loss of formulas seem to occur during that save process?
4. Do you have the LibreOffice AutoSave function enabled? (Tools -> Options -> Load/Save -> General) 
5. Does the AutoSave seem to cause loss of the formulas?

Please answer those questions and set back to NEW.
Comment 19 Regina Henschel 2016-05-18 15:14:37 UTC
Hi Ben, please go to Tools > Options > LibreOffice > Memory and increase "Cache for Inserted Objects". For technical texts you should use a large number, 600 for example.
Comment 20 Ben 2016-05-22 14:30:00 UTC
Hi,
The auto save function is on, every 10 minutes. I don't see a correlation between saving and the formulas disappearing. I save it manually every 5 minutes or so.
I tried increasing the cache to 500MB, the problem still occurs.
Anything else I can try? (I'm also turning off the auto save just to be sure, I'll tell you if it changes anything)
Comment 21 Ben 2016-05-22 14:38:49 UTC
Turning off the auto save didn't help, it just happened again
Comment 22 Regina Henschel 2016-05-22 14:58:01 UTC Comment hidden (obsolete)
Comment 23 Buovjaga 2016-05-22 15:00:41 UTC
(In reply to Regina Henschel from comment #22)
> Hi Ben, do you have change tracking enabled? If yes, please try with change
> tracking off.

I didn't have it enabled and I could repro in comment 15
Comment 24 Regina Henschel 2016-05-22 15:28:42 UTC
Hi Buovjaga, the attached document has actually no formulas stored. But having such document does not mean to "reproduce" the bug. The problem is to reproduce an environment, which results in not storing the formulas.

Hi Ben, another candidate are the comments. Do you see the same problem in documents without any comment?
Comment 25 Ben 2016-05-23 09:27:03 UTC
Hi Regina,
I started storing the formulas in comments because they were disappearing, the problem was there before. I don't have track changes enabled
Comment 26 Buovjaga 2016-12-20 14:16:09 UTC
*** Bug 45349 has been marked as a duplicate of this bug. ***
Comment 27 Buovjaga 2016-12-20 14:17:00 UTC
*** Bug 88859 has been marked as a duplicate of this bug. ***
Comment 28 Omer Zak 2017-11-12 14:24:15 UTC
Still happens in:

Version: 6.0.0.0.alpha1+
Build ID: 5d12237d79f289a1dcf8e07aa03df329e136f078
CPU threads: 8; OS: Linux 4.9; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.utf8); Calc: group

OS: Debian 64bit Stretch (Debian 9.2, with some backported packages)
Comment 29 Abo 2017-11-20 12:57:04 UTC
Still happens in: 
Version: 5.3.3.2
Build ID: 3d9a8b4b4e538a85e0782bd6c2d430bafe583448
Threads CPU : 2; Version de l'OS :Windows 6.2; UI Render : par défaut; Moteur de mise en page : nouveau; 
Locale : fr-FR (fr_FR); Calc: group

I use a portable version of libreoffice on windows, but also the last version from ubuntu package at home, and I still have this random bug on both version.

If I can help, it often happens when there is a lot of formulas in the same document (maybe more than 15 ?). Then when we edit a formula and quit the formula editor, it sometimes destroys another formula without any logic of the formula choice. So the formula image is very bad and small, and if we try to reedit this formula, formula editor is empty.

No use of hebrew in my case, so it's not due to text alignment.

Thanks for your work.
Comment 30 Buovjaga 2017-11-20 13:03:20 UTC
*** Bug 113900 has been marked as a duplicate of this bug. ***
Comment 31 Buovjaga 2017-12-25 19:21:39 UTC
*** Bug 114399 has been marked as a duplicate of this bug. ***
Comment 32 Daniel Löb 2018-02-18 10:16:32 UTC
Still happens in:

Version: 6.0.1.1
Build ID: 6.0.1-1
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: kde4; 
Locale: de-DE (en_US.UTF-8); Calc: group

No OpenGl.

Unfortunately, I have not managed to build a minimal example yet.

However: The probability of this happening increases significantly when copying and pasting combinations of text and formulas. Interestingly, the formulas in the copied original also disappear irreversibly.

In addition, I'd like to point out that bug 45349, which has been marked as a duplicate of this bug is six years old now. It seems this bug has existed in every version since 2012.

So maybe the problem is in a part of the code that has not been touched much in all that time?
Comment 33 Lior Kaplan 2018-09-17 18:41:07 UTC
Just clicked on a formula to edit and it disappeared. 

Version: 6.1.1.1
Build ID: 1:6.1.1~rc1-2

Debian GNU/Linux on amd64
Comment 34 Dina 2018-09-17 19:12:51 UTC Comment hidden (obsolete)
Comment 35 Dina 2018-09-17 19:42:49 UTC
(In reply to Dina from comment #34)
> Created attachment 144957 [details]
> a manually corrected version of "File that reproduces the problem"
> 
> In LibreOffice 6.1.1.2, when I tried to edit the odf file from Ben's
> attachment manually (i.e. try to edit every formula, and if it disappeared,
> to copy the text from the comment in Ben's file to the equation editor) and
> saved the result, the formulas look fine (except the letter "alpha" in the
> second row of the table is a bit squashed).
> 
> Maybe there is a defect in Ben's file...

P.S. OS: Lubuntu 18.04.1 32bit
LibreOffice Version: 6.1.1.2
Build ID: 1:6.1.1~rc2-0ubuntu0.18.04.1
Comment 36 fogagut 2018-09-29 11:46:15 UTC
I'm experiencing this bug even more frequently since updating from version 5 to 6. It's getting worse and making the program nigh unusable for me for any equation editing, which constitutes the largest portion of my LibreOffice usage.

Does anyone have any alternative programs similar to the equation editor in Libre that I can use in the meantime? (Not interested in LaTex editing.)
Comment 37 Adrien 2019-01-28 19:26:04 UTC
I get the same issues with the formula sometimes being totally cleared out, or just one part is removed. This is very disturbing.

It happened with a previous machine running Debian, the same happens now with another machine running Windows. I am currently using the latest version of LibreOffice 6.1.3.2 (x64).
Comment 38 Adrien 2019-01-28 22:04:22 UTC
I updated to version 6.1.4.2 (x64) and didn't encounter any problem after a couple of hours of usage. Could it be that this bug has been fixed?
Comment 39 Buovjaga 2019-01-29 07:09:06 UTC
(In reply to Buovjaga from comment #15)
> (In reply to Ben from comment #13)
> > Created attachment 125137 [details]
> > File that reproduces the problem
> 
> Yep, repro by double-clicking on the second to last formula (on page 3).
> 
> Win 7 Pro 64-bit Version: 5.2.0.0.alpha1+
> Build ID: f688acfdae00ebdd891737e533d54368810185e1
> CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
> TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2016-05-18_00:11:31
> Locale: fi-FI (fi_FI)

Still repro.

Arch Linux 64-bit
Version: 6.3.0.0.alpha0+
Build ID: 68bdea37d79793bc8dff4672c2d360be3554b041
CPU threads: 8; OS: Linux 4.20; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded
Built on 28 January 2019
Comment 40 Chris O 2019-03-24 09:46:33 UTC
(In reply to Adrien from comment #38)
> I updated to version 6.1.4.2 (x64) and didn't encounter any problem after a
> couple of hours of usage. Could it be that this bug has been fixed?

Still reproduce on:

Version: 6.2.0.2
Build ID: 1:6.2.0~rc2-1
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk2; 
Locale: en-GB (en_GB.UTF-8); UI-Language: en-GB
Calc: threaded

From Debian repo, no openGL enabled.

Has occurred on every version I have tried over the past year.

I am writing documents with excess of 1,000 small formulas.

Seems to happen more often when the formula window is open and also may be related to temporary files.

Any tips?
Comment 41 kep3144 2019-06-27 18:23:01 UTC
I'm getting the same problem on debian. Equations are disappearing sometimes. This is really annoying. I have to copy all equation's source into a separate text file to have a backup of the equations :-(
Comment 42 Chris O 2019-07-03 15:02:43 UTC Comment hidden (obsolete)
Comment 43 Chris O 2019-07-03 15:03:55 UTC
(In reply to Chris O from comment #42)
> Hi,
> This is still easily producible on 6.3.0~beta2.
> 
> I have found copying formula objects and then editing them worsens the
> problem.
> 
> I also get "General Input Output Error" messagebox when saving the corrupted
> file, causing me to loose my files!
> 
> Very annoying bug!

PS: it also seems to be worsened when creating/editing .docx files
Comment 44 hnoquinteros 2019-11-05 07:11:00 UTC
Hi everybody. It's my first post here.

I'm getting the same problem on ArchLinux x86_64 Kernel 5.3.8-arch1-1 LibreOffice 6.3.2.2 regional es_AR.UTF-8 document in ODT

I experienced the same problem for years. Sometimes after editing an equation a previous equation disappears or collapses.

The problem is much more serious when copying whole tables, created with the shortcut "núm"+F3 containing several equations.

I'm not sure but I think if the document is saved just after editing each equation, the problem appears less frequent. However, sometimes it's not possible to work even to save just after and equations simply disappear or return to an previous version after be edited.

I'm getting these messages by console output: "QXcbClipboard: Cannot transfer data, no data available" , "Can find no compliant libebook client libraries" "QXcbClipboard::setMimeData: Cannot set X11 selection owner"
Comment 45 Nicolas Santamaria 2019-12-01 17:52:11 UTC
Created attachment 156224 [details]
File with disappearing formulas(last one and 3rd to last)

Just another example, the file was created using writer 6.0.2(I believe, the version included in the distro, updated) in kubuntu 18.04 if its relevant.
The last and 3rd to last formula disappear.
I tried opening with 6.3.3.2 and the same thing happens.
This bug happens relatively often when you have a couple of formulas.
Comment 46 Chameleon 2019-12-30 11:42:33 UTC
Whow.
I am here to report the bug, but it is already reported.
As I can see, this bug exists for many years.
I am not totally sure, but I believe this bug appears only when you copy paste a formula, but not every time. If you create a new formula, (I believe) the bug does not appear.

I read the comments. Many people suggest OpenGL  on/off and such things.

They are wrong. Content of formula KILLED BADLY from program. Only a thumbnail of formula exists. Contents inside formula are rollback to the contents of the origin formula (of copy-paste).

Stretching happens (I believe) because object has dimensions and if thumbnail of formula update with corrupted formula contents, then does not fit well in current object dimensions.
Comment 47 onurb 2020-04-10 15:02:13 UTC
Hi,
Still occurring now, in LO 6.3.5.2 on Windows 10 v18363 with a "fresh" install (10 days) of windows & all apps.
Version : 6.3.5.2 (x64)
Build ID : dd0751754f11728f69b42ee2af66670068624673
Threads CPU : 4; OS : Windows 10.0; UI Render : par défaut; VCL: win; 
Locale : fr-FR (fr_FR); Langue IHM : fr-FR
Calc: threaded

As analysed in 2016, i tried to open "manualy" (7zip & notepad++) a file (where some formula are disappearing as soon as i try to edit it) to see how are stored those formulas: they are empty ...  
The content.xml of the OLE object is just 2 ligns:
<?xml version="1.0" encoding="UTF-8"?>
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"/>

I don't see "memory" option in this version of LO
OpenGL is checked, but it's writen "actually desactivated"
No addons installed (except defaults)
Auto-save is ON (10min)

-> i finally found memory options (Options ... LibreOffice .. Advanced ... Expert configuration)
* org.openoffice.Office.Common - Cache - GraphicManager: TotalCacheSize = 4*10^8 ~ 381Mo
* org.openoffice.Office.Common - Cache - GraphicManager: ObjectCacheSize = 126*10^5 ~12Mo

There are ~35 formulas in the file, and with 4 screeshots pasted in.
I was working with an "unsaved/unamed" file (and also 8 others opened files in LO, text & calc)

I will try saving my work at the begining ... and short saving time (by CTRL+S), and perhaps increase cache options ? (but which values ?) 

Is-there someone still working at this issue ?
Comment 48 bigicecream 2020-04-10 15:44:45 UTC
Created attachment 159469 [details]
File with disappeared formula(big white square near the end of the file)

My problem is very similar but in my case, I get white square in the size of the formula and when trying the formula it resized back to a size of empty formula.
Comment 49 bigicecream 2020-04-10 15:57:46 UTC
OS: Manjaro Linux x86_64 
Kernel: 5.4.30-1-MANJARO 
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US

I get the same result but In a little different way: After a while, I get white square in the size of the formula and when trying to edit the formula, It resized back to a size of an empty formula and all the content of the formula block disappeared.

I attached my file
Comment 50 Telesto 2020-07-21 12:39:31 UTC Comment hidden (obsolete)
Comment 51 dante19031999 2020-07-21 14:04:38 UTC
(In reply to Telesto from comment #50)
> Is this still an issue?
> I do reproduce it with the attached files; but if they content is stored
> it's lost, so empty.
> 
> Does still happen with newly created files?

Yes at least on stable releases, do not use dev releases.
But if there's no patch it's almost impossible it's solved by look.
Comment 52 PvSwie 2020-08-19 08:51:56 UTC
Formulas disappear for me as well but they also move. I have a larger doc (like 60 pages) which I have been working on for quite some time. It has one page with 8 formulas.
I created this page with formulas one day long time ago.
An unknown time later I noticed:
- Some formulas did no longer show. Instead the box with the formula showed something like 'object n'. So I was missing several formulas. I do not remember whether the were boxes in between or at the end
- Some boxes were filled with the wrong formula. Formulas had shifted from one box to another. I do not remember but would not be surprised if they moved up.
- Today, many edits later, the final formula box became 'object 8'. Where the other formulas could be double clicked to edit them this one could not. Looking at the object properties the description contained formula. The object property name was 'Object10'. The previous (still correct) formula shows Object9. I have no clue as to why the box shows 'object 8' where the name property is object10. I had to create a new formula to fix things.

I am running Ubuntu 18.04.1 LTS which embeds LO writer version 6.0.7.3.

I am not allowed to share the document but might be convinced to perform some tests.
Comment 53 mariusdavid 2020-09-10 16:37:14 UTC
Created attachment 165375 [details]
simplified file with problem with copy-paste of the second formula

I have the same problem on NixOS:
Version : 6.3.5.2
Build ID : 30(Build:2)
Threads CPU : 8; OS : Linux 5.7; UI Render : par défaut; VCL: gtk3; 
Locale : fr-FR (fr_FR.UTF-8); Langue IHM : fr-FR
Calc: threaded

This file is interesing. It come from a math class, and I figured that it produce different result each time I paste a copy of the second formula. Sometime, it display formula, and sometime, it instanciate object with "Object X" in red. Each time I copy it, the number either increment or is replaced by a formula. I hope this may help you to find the issue.
Comment 54 Moritz Hedtke 2021-02-23 14:27:46 UTC
I would personally like this to get the highest priority as this practically is a data loss bug. Also then it would show up in https://wiki.documentfoundation.org/QA/Most_Annoying_Bugs which may help getting this fixed faster.

The way that *should* work to reproduce this is creating a new Writer document and start writing some formulas, headlines, paragraphs, undoing and maybe frequent saving. Specifically I don't think that copying matters. I also used chapter numbering but I don't know if that matters.

Also I have the suspicion that reproducing does not work with debugging builds but I'm not sure.
Comment 55 dante19031999 2021-02-23 22:11:34 UTC
This bug has already been annoying me some time and got some patterns.
Maybe they can help extrapolate the bug location.
- Most of the corruptions become visible after closing the document and reopening it.
- The longer you use writer the highest is the probability of suffering it.
- The more formulas you use the highest is the probability of suffering it.
- Once the first corruption is produced the following formulas are very susceptible of getting corrupted (generally 4-10 next formulas).
- If the formula is corrupted and rewrite it you are almost sure to lose it again.
- After the first reopen of the file the probability of existing formulas to corrupt is very small.

With highest probability it means it occurs more often, the ratio of errors increase.

(In reply to Moritz Hedtke from comment #54)

> Also I have the suspicion that reproducing does not work with debugging builds but I'm not sure.
Impossible. The not corrupted formulas after the first reload of the document have to low probability of corruption. Once in a century I guess you'll see an error of resource not available or something like that.

> I would personally like this to get the highest priority as this practically is a data loss bug.
Completely agree. If my memory is not wrong there was some kind of unspoken rule which said that MABS required at least 10 duplicates. Still far away. 

By the way, stills here on 7.1.0
Comment 56 Regina Henschel 2021-02-23 23:36:44 UTC
If you see wrong sized formulas after reopen, it is very likely, that the object is already damaged and you see only the replacement image. If you double click the object, the command window of the formula editor is empty. So there is no way to repair the broken file but re-entering the formulas.

I assume, that you know, when working on a USB-stick, you first need to close the file and LibreOffice and then use the "eject" property of the operating system before removing the stick. The operating systems needs some time to write all things to the stick.

You should intermediately use File > Save a copy while working on the file, to generate backups.

We had such problems long time ago in OpenOffice.org, if the document had many formulas and the PC had a small RAM.

You can try whether increasing the OLE cache helps to become Writer more stable. Currently it is set to 20 objects, your file has 36. The setting is in Tools > Options > LibreOffice > Advanced > Open Expert Configuration. Search for Cache. In branch org.openoffice.Office.Common > Cache double-click the line Writer. Then you can change the value. OK. Restart.

BTW: You have enabled writing additional info to file for comparison. If you do not really need it, you should disable it. It only makes the structure of the file unclear and hinders the use of paragraph and character styles. The setting is in Tools > Options > Writer > Comparison.
Comment 57 Buovjaga 2021-03-18 07:16:59 UTC
*** Bug 88859 has been marked as a duplicate of this bug. ***
Comment 58 Antoni Aloy Torrens 2021-05-15 22:28:50 UTC
*** Bug 139605 has been marked as a duplicate of this bug. ***
Comment 59 Alon 2021-06-16 12:19:10 UTC
two thing:
first, there is someone claimnig to have a workaround(?). please see
https://ask.libreoffice.org/en/question/17773/formulas-disappearing-or-shrinking-in-lo-writer-documents/?answer=273126#post-id-273126

second, tl;dr:
I have an idea of writing a macro to redesign the addition of formulas to a LO document (as an SVG image object). The pseudo-algorithem is down in this message. Please have a look at it and tell me how stupid I am for suggesting this.


I have very little time and very little knowladge of coding, but I have an idea to bypass the "normal" way of inserting formulas, thus allowing to "draw a formula in the "Libreoffice Math" tool, exporting it and using it as SVG object (inline with text).
I don't know enough to be able to create this type of macro myself, but I'll start by writing a pseudo-algorithm here. You are more than wellcome to give notes and help with the writing of the actual macro. in addition, if this can be done as an online code collaboration thing (again, I know very little about these things), don't hasitate to help.

The pseudo-algorithm:
1. creat an inline with text object.
2. name the object "FSVGObj#n", where n is an integer, a changing number according to the number of such objects in the document.
3. open LO Math and wait for user input.
4. when user finishes writing formula, he\she should have a button for continuing the process
5. the formula should be exported to PDF in a temporary location
6. using inkscape (should be installed) convert the PDF to SVG
7. editing the svg as text to keep the text in the buttom of the PDF (the actual code in the formula editor) as an SVG comment(i.e. <!--...-->)
8. removing al the rest of the pdf (i.e. the frames, and titles etc.), kipping only the actual formula
9. Resize page to content using inkscape
10. insert svg to the aforementioned object ("FSVGObj#n")
11. if one is to update a formula, the code for the formula editor should be availible in the commented part of the svg assosiated with the object.
Comment 60 V Stuart Foote 2021-06-16 14:07:40 UTC
(In reply to Alon from comment #59)

This is decidedly off topic to this issue, which is about memory management of the the OLE formula objects. 

IMHO the most effective work around is to prepare formulas external to Writer as individual ODF Formula documents, or better as Math Markup Language 2.0 files (the Math formula editor saves to both, and Writer reads either)--and insert them as objects. 

They'd be preserved outside the Writer ODF Text archive, rather than in-line as formula objects where content is being dropped. Only requires small changes to work flow but protects your formula work.

As to using format other than the ODF Formula/StarMath/MathML to hold the formula--that is already well exercised in extension:

https://extensions.libreoffice.org/en/extensions/show/texmaths-1