Bug 81522 - FILESAVE: can't save .docx after deleting header or footer
Summary: FILESAVE: can't save .docx after deleting header or footer
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: Other Windows (All)
: medium normal
Assignee: Not Assigned
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: 2018-08-11 12:07 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:

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

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, and master (latest build). not reproducible with

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

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:
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:
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
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:
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.