Bug 81522 - FILESAVE: can't save .docx after deleting header or footer
Summary: FILESAVE: can't save .docx after deleting header or footer
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: Other Windows (All)
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.1.0 target:7.0.1
Keywords: bibisected, bisected, filter:docx, regression
Depends on:
Blocks: DOCX-Header-Footer
  Show dependency treegraph
 
Reported: 2014-07-19 07:28 UTC by tommy27
Modified: 2020-11-04 14:47 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Demo-Hayden-Management-minimal.docx : reduced to chart and footer (23.78 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-08-11 11:53 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tommy27 2014-07-19 07:28:34 UTC
reproducible under Win7x64 using LibO 4.2.0.4, 4.2.5.2 and 4.4.0.0+ master (latest build). not reproducible with 4.1.0.4

Steps to reproduce the bug:
1. Open attachment 81684 [details]  (.docx)
2. Edit/Select All
3. Edit/Cut
4. click on header and open light blue header tab menu
5. select delete header and say yes
6. click on save button

EXPECTED BEHAVIOUR: .docx should be saved

CURRENT BEHAVIOUR:
a- Error dialog window appear saying:
Error saving the document Demo-Hayden-Management:
General Error. General input/output error.

b- LibO scrollbar also become unresponsive 
to restore it click on "x" close document button --> cancel

c- toolbar buttons greyed out (just in 4.4.x)
to restore them click on "x" close document button --> cancel

d- same issue if you try to delete footer instead of header

e- interestingly if you save file after step 3, close and reload it, then you can delete header or footer with no saving issue, while bug is still reproducible if you just save it and not reload it.
Comment 1 Luke 2014-07-21 07:03:46 UTC
Confirmed with :
Ubuntu 14.04 LTS 
3.13.0-30-generic x86_64
LibreOffice Version: 4.2.4.2
and LibreOffice Version: 4.4 self build of branch master

Following  tommy27's steps, I could not save as a .doc or .docx. 

I was able to save as .odf. Even after saving as .odf, I couldn't export as a .docx. However, restarting Writer,loading the .odf, and saving as .docx does seem to work.
Comment 2 Matthew Francis 2015-01-17 02:25:00 UTC
This starts somewhere after last41onmaster in the 43all bibisect repository

Setting Keywords: regression and Whiteboard: bibisectRequest
Comment 3 Rostislav 'R.Yu.' Okulov 2015-01-18 10:00:47 UTC
# bad: [423a84c4f7068853974887d98442bc2a2d0cc91b] source-hash-c15927f20d4727c3b8de68497b6949e72f9e6e9e
# good: [c2069a369d738078124812312d51f21ea1ce2421] source-hash-f160e4935c474a5293b3d3c11b3d538efb4767a0
git bisect start 'last43onmaster' 'last41onmaster'
# bad: [33ac6698e6d90d84f99d784b9553ee87eec27d6a] source-hash-732c0f929fc0229b6da37d4ec4b6de8994fcea46
git bisect bad 33ac6698e6d90d84f99d784b9553ee87eec27d6a
# good: [e3a648fdaa2bb87293750400b70ba590733a804a] source-hash-33526481788137d959f27ae32910127d1436c1a8
git bisect good e3a648fdaa2bb87293750400b70ba590733a804a
# good: [e3a648fdaa2bb87293750400b70ba590733a804a] source-hash-33526481788137d959f27ae32910127d1436c1a8
git bisect good e3a648fdaa2bb87293750400b70ba590733a804a
# good: [e3a648fdaa2bb87293750400b70ba590733a804a] source-hash-33526481788137d959f27ae32910127d1436c1a8
git bisect good e3a648fdaa2bb87293750400b70ba590733a804a
# good: [c2069a369d738078124812312d51f21ea1ce2421] source-hash-f160e4935c474a5293b3d3c11b3d538efb4767a0
git bisect good c2069a369d738078124812312d51f21ea1ce2421
# bad: [a1bd890a0802bd142798b7b601f370ca9c21426b] source-hash-04532617c7d264411563db24dc359326cc18eda7
git bisect bad a1bd890a0802bd142798b7b601f370ca9c21426b
# bad: [a1bd890a0802bd142798b7b601f370ca9c21426b] source-hash-04532617c7d264411563db24dc359326cc18eda7
git bisect bad a1bd890a0802bd142798b7b601f370ca9c21426b
# bad: [560f398ecbc305b65a32a4ba0b9e4444761db889] source-hash-dace560b350346b9f9a102ee602bb129a008bcfe
git bisect bad 560f398ecbc305b65a32a4ba0b9e4444761db889
# skip: [aba65c3e4c0df07e4909aeefb758cdb688242bf6] source-hash-827524abfb4b577d08276fde40929a9adfb7ff1a
git bisect skip aba65c3e4c0df07e4909aeefb758cdb688242bf6
# skip: [06793dd2acc5fe5c7dd3cecf09784c2d3426f33a] source-hash-2232781ad303864b79a3973b5b0eec40a859a701
git bisect skip 06793dd2acc5fe5c7dd3cecf09784c2d3426f33a
# skip: [79ff8e93eb0ddcebca4f814fc6883da8e1485c9f] source-hash-0bca15197461f9e0c6f28ce301c2fed2ec4b38cb
git bisect skip 79ff8e93eb0ddcebca4f814fc6883da8e1485c9f
# bad: [b5b034dfb3e4cd132c1e60a0283ff527ec92637a] source-hash-b95acb2bdcc6bc7c09a806157361c83142858d97
git bisect bad b5b034dfb3e4cd132c1e60a0283ff527ec92637a
# skip: [10fc65607493c257076c8af1b708839eb03d8d14] source-hash-1500aae993c0a8b4fa9a5bcec1bc6203f3bcff66
git bisect skip 10fc65607493c257076c8af1b708839eb03d8d14
# good: [ab05d0f440b5ac5f1f6481a70c9840292aafde2e] source-hash-f86404450621bbee6feaaee0f43f5e53d9501796
git bisect good ab05d0f440b5ac5f1f6481a70c9840292aafde2e
# only skipped commits left to test
# possible first bad commit: [b5b034dfb3e4cd132c1e60a0283ff527ec92637a] source-hash-b95acb2bdcc6bc7c09a806157361c83142858d97
# possible first bad commit: [06793dd2acc5fe5c7dd3cecf09784c2d3426f33a] source-hash-2232781ad303864b79a3973b5b0eec40a859a701
# possible first bad commit: [10fc65607493c257076c8af1b708839eb03d8d14] source-hash-1500aae993c0a8b4fa9a5bcec1bc6203f3bcff66

There are only 'skip'ped commits left to test.
The first bad commit could be any of: 06793dd2acc5fe5c7dd3cecf09784c2d3426f33a 10fc65607493c257076c8af1b708839eb03d8d14 b5b034dfb3e4cd132c1e60a0283ff527ec92637a
We cannot bisect more!
Comment 4 Matthew Francis 2015-01-29 01:45:45 UTC
The failure to save seems to have started at the below commit.

Adding Cc: to vinaya.mandke@synerzip.com; Could you possibly take a look at this? Thanks


commit 13e8e9e2fe32bc77058b5869c39948b683fb81ec
Author: Vinaya Mandke <vinaya.mandke@synerzip.com>
Date:   Tue Sep 17 18:54:21 2013 +0530

    fdo#40594 Fix for chart missing issue in Writer (for docx)
    
    1. Enabled parsing of chart in writer module.
    2. While parsing chart is read as ole2shape. Then converted into TextEmbedded object for chart.
    3. While exporting postponed chart writing after rpr tag.
    4. Generated unique id for each chart.
    5. Corrected content type of chart in export.
    
    Change-Id: I6a1ca0c34e03e17cc3dd8a183580132ea7af5c48
    Reviewed-on: https://gerrit.libreoffice.org/5976
    Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Comment 5 tommy27 2015-06-19 18:05:21 UTC
still reproducible using 5.1.0.0.alpha1+
Build ID: ba70050dc37f82306a8a3c5815372a4b9fff18fc
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-06-19_06:35:49
Locale: en-US (it_IT)

@Micheal Stahl 
can you take a look at this? bibisect data available.
Comment 6 Robinson Tryon (qubit) 2015-12-14 00:43:26 UTC Comment hidden (obsolete)
Comment 7 Luke 2015-12-17 10:16:52 UTC Comment hidden (no-value)
Comment 8 QA Administrators 2017-12-10 16:42:05 UTC Comment hidden (obsolete)
Comment 9 Luke 2018-08-09 04:35:34 UTC
Still repo in Version: 6.2.0.0.alpha0+
Build ID: 29306111ecaff2f66d4d53c990eef83cf97d1a65
Comment 10 Justin L 2018-08-11 11:53:28 UTC
Created attachment 144104 [details]
Demo-Hayden-Management-minimal.docx : reduced to chart and footer

confirmed that the LO 4.2 commit identified in comment 4 matches my own bibisect using the minimal example.

However, this is also the first time the OLE object shows up as well, so before there was nothing to "delete" since the document was empty. So not really a regression, just exposing another bug (unless simply handling the OLE object was done improperly).

Note that simply deleting the chart itself allows the save to occur. Something else needs to be deleted (?afterwards?) to trigger the error.

debugging output produces the following after the footer is also deleted.
warn:chart2:25477:25477:chart2/source/tools/LifeTime.cxx:122: This component is already disposed 
warn:svl.items:25477:25477:svl/source/items/itempool.cxx:398: old secondary pool: EditEngineItemPool of pool: XOutdevItemPool must be empty.
Comment 11 Justin L 2018-08-11 12:07:39 UTC
Some bad information in the previous comment.

The debug messages didn't come at the time of saving, but at the time of deleting (and also during file open.).

Also, the I/O error can also be triggered by *creating* a header after deleting the chart. And probably many other actions can trigger as well.
Comment 12 QA Administrators 2019-08-19 06:59:46 UTC Comment hidden (obsolete)
Comment 13 Rostislav 'R.Yu.' Okulov 2019-08-20 20:58:10 UTC
current behaviour is still here:

a- Error dialog window appear saying:
Error saving the document Demo-Hayden-Management:
General Error. General input/output error.

As expected.

Version: 6.3.0.4
ID: 057fc023c990d676a43019934386b85b21a9ee99
OS: Mac OS X 10.14.5
Comment 14 Justin L 2020-07-21 09:54:30 UTC
(In reply to Justin L from comment #10)
> warn:chart2:25477:25477:chart2/source/tools/LifeTime.cxx:122: This component
> is already disposed 
This error message can be seen already just during FILEOPEN and FILECLOSE.

The chart code is full of comments like //behave passive if already disposed or closed or throw exception @todo?

This particular notice seems to be be OK - old and new models wrapped around each other and cyclically disposing each other. Not that I know much about this, but it doesn't seem problematic to me...

> warn:svl.items:25477:25477:svl/source/items/itempool.cxx:398: 
> old secondary pool: EditEngineItemPool of pool: XOutdevItemPool must be empty
This error message also is seen during simply opening and closing the file.


The IO exception ultimately comes from
embeddedobj/source/commonembedding/embedobj.cxx:490: ::getCurrentState is disposed. Throwing DisposedException

proposed avoidance fix at gerrit.libreoffice.org/c/core/+/99129
Comment 15 Commit Notification 2020-07-22 15:28:45 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/91d1cd8687c00a639cb4ecc5759254c946efe4c1

tdf#81522 comphelper: just ignore disposed obj on save

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 16 Commit Notification 2020-07-30 11:26:30 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/a3285627b2a5171bf97c57738f494ad7ae50c545

tdf#81522 comphelper: just ignore disposed obj on save

It will be available in 7.0.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.