Bug 99273 - FILESAVE: cant save attached docx
Summary: FILESAVE: cant save attached docx
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.0.3 release
Hardware: All All
: high critical
Assignee: Caolán McNamara
URL:
Whiteboard: interoperability target:5.2.3 target:...
Keywords: dataLoss, filter:docx, haveBacktrace
Depends on:
Blocks: WPSShapeTextImport-Change
  Show dependency treegraph
 
Reported: 2016-04-13 15:08 UTC by naberuz
Modified: 2020-05-31 01:17 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
file problem (98.79 KB, application/vnd.openxmlformats-officedocument.wordprocessingml)
2016-04-13 15:08 UTC, naberuz
Details
error popup (9.77 KB, image/png)
2016-04-13 15:13 UTC, naberuz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description naberuz 2016-04-13 15:08:01 UTC
Created attachment 124308 [details]
file problem
Comment 1 naberuz 2016-04-13 15:13:44 UTC
Created attachment 124309 [details]
error popup
Comment 2 raal 2016-04-13 15:20:22 UTC
I can confirm with Version: 5.2.0.0.alpha0+
Build ID: ef34535ceb60d7d63b8d8671e4c6e9e43ffbd17d
CPU Threads: 4; OS Version: Linux 4.2; UI Render: default; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-03-27_09:53:05
and 4.4
Comment 3 Aron Budea 2016-08-15 05:35:14 UTC
Reproduced with v4.4.0.3 / Windows 7 (it has some other visual issues as well that are gone in later releases).
Not reproduced with v4.3.0.4.
=> regression

Raising severity to critical, since the document can't be saved.
Comment 4 fiftyigfuci_f_mi 2016-08-17 15:22:49 UTC
The direct cause is a exception in SwXTextFrame::createTextCursor.

        if(!pNewStartNode || pNewStartNode != pOwnStartNode)
        {
            uno::RuntimeException aExcept;
            aExcept.Message = "no text available";
            throw aExcept;
        }

backtrace:
#0  0x00007fb4e54f48bd in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x00007fb4a04872cb in SwXTextFrame::createTextCursor (this=0x7fb498687618)
    at /libreoffice/sw/source/core/unocore/unoframe.cxx:3257
#2  0x00007fb4a0486ff9 in SwXTextFrame::CreateCursor (this=0x7fb498687618)
    at /libreoffice/sw/source/core/unocore/unoframe.cxx:3223
#3  0x00007fb4a05c041a in SwXText::getString (this=0x7fb498687658)
    at /libreoffice/sw/source/core/unocore/unotext.cxx:900
#4  0x00007fb4dc11b945 in XMLShapeExport::collectShapeAutoStyles (this=0x2e1fa90, xShape=...)
    at /libreoffice/xmloff/source/draw/shapeexport.cxx:307
#5  0x00007fb4dc34357c in XMLTextParagraphExport::exportAnyTextFrame (this=0x300e330, rTxtCntnt=..., eType=XMLTextParagraphExport::FrameType::Shape, 
    bAutoStyles=true, bIsProgress=false, bExportContent=true, pRangePropSet=0x0)
    at /libreoffice/xmloff/source/text/txtparae.cxx:2803
#6  0x00007fb4dc34a5f7 in XMLTextParagraphExport::exportShape (this=0x300e330, rTextContent=..., bAutoStyles=true, pRangePropSet=0x0)
    at /libreoffice/include/xmloff/txtparae.hxx:638
#7  0x00007fb4dc33e053 in XMLTextParagraphExport::exportTextContentEnumeration (this=0x300e330, rContEnum=..., bAutoStyles=true, rBaseSection=..., 
    bIsProgress=true, bExportParagraph=true, pRangePropSet=0x0, bExportLevels=true, eExtensionNS=TextPNS::ODF)
    at /libreoffice/xmloff/source/text/txtparae.cxx:1865
#8  0x00007fb4dc33f3b3 in XMLTextParagraphExport::exportParagraph (this=0x300e330, rTextContent=..., bAutoStyles=true, bIsProgress=true, bExportParagraph=true, 
    rPropSetHelper=..., eExtensionNS=TextPNS::ODF)
    at /libreoffice/xmloff/source/text/txtparae.cxx:2133
#9  0x00007fb4dc33dd0a in XMLTextParagraphExport::exportTextContentEnumeration (this=0x300e330, rContEnum=..., bAutoStyles=true, rBaseSection=..., 
    bIsProgress=true, bExportParagraph=true, pRangePropSet=0x0, bExportLevels=true, eExtensionNS=TextPNS::ODF)
    at /libreoffice/xmloff/source/text/txtparae.cxx:1818
#10 0x00007fb4dc33d4a4 in XMLTextParagraphExport::exportText (this=0x300e330, rText=..., bAutoStyles=true, bIsProgress=true, bExportParagraph=true, 
    eExtensionNS=TextPNS::ODF) at /libreoffice/xmloff/source/text/txtparae.cxx:1690
#11 0x00007fb4dc10b02c in XMLTextParagraphExport::collectTextAutoStyles (this=0x300e330, rText=..., bIsProgress=true, bExportParagraph=true)
    at /libreoffice/include/xmloff/txtparae.hxx:509
#12 0x00007fb4dc2e4537 in XMLTextMasterPageExport::exportHeaderFooterContent (this=0x1e58a70, rText=..., bAutoStyles=true, bExportParagraph=true)
    at /libreoffice/xmloff/source/text/XMLTextMasterPageExport.cxx:68
#13 0x00007fb4dc2e498c in XMLTextMasterPageExport::exportMasterPageContent (this=0x1e58a70, rPropSet=..., bAutoStyles=true)
    at /libreoffice/xmloff/source/text/XMLTextMasterPageExport.cxx:112
#14 0x00007fb4dc228b9e in XMLPageExport::exportStyle (this=0x1e58a70, rStyle=..., bAutoStyles=true)
    at /libreoffice/xmloff/source/style/XMLPageExport.cxx:107
#15 0x00007fb4dc229ae5 in XMLPageExport::exportStyles (this=0x1e58a70, bUsed=false, bAutoStyles=true)
    at /libreoffice/xmloff/source/style/XMLPageExport.cxx:208
#16 0x00007fb4a0700b56 in XMLPageExport::collectAutoStyles (this=0x1e58a70, bUsed=false)
    at /libreoffice/include/xmloff/XMLPageExport.hxx:90
#17 0x00007fb4a07001f0 in SwXMLExport::ExportAutoStyles_ (this=0x7fb4acc2fe10)
    at /libreoffice/sw/source/filter/xml/xmlfmte.cxx:197
#18 0x00007fb4dc0a1c12 in SvXMLExport::ImplExportAutoStyles (this=0x7fb4acc2fe10)
    at /libreoffice/xmloff/source/core/xmlexp.cxx:1185
#19 0x00007fb4dc0a2d1c in SvXMLExport::exportDoc (this=0x7fb4acc2fe10, eClass=xmloff::token::XML_TEXT)
    at /libreoffice/xmloff/source/core/xmlexp.cxx:1442
#20 0x00007fb4a06f384a in SwXMLExport::exportDoc (this=0x7fb4acc2fe10, eClass=xmloff::token::XML_TEXT)
    at /libreoffice/sw/source/filter/xml/xmlexp.cxx:297
#21 0x00007fb4dc09fdd1 in SvXMLExport::filter (this=0x7fb4acc2fe10, aDescriptor=...)
    at /libreoffice/xmloff/source/core/xmlexp.cxx:841
Comment 5 Aron Budea 2016-08-29 14:57:18 UTC Comment hidden (bibisection)
Comment 6 Aron Budea 2016-08-29 14:58:57 UTC
This regression has been introduced by the commit below, Miklos, can you please take a look?
 64c8b13f248fe7ea3808c7f8e62d0d656f170378 is the first bad commit
commit 64c8b13f248fe7ea3808c7f8e62d0d656f170378
Author: Matthew Francis <mjay.francis@gmail.com>
Date:   Sat Mar 14 21:42:08 2015 +0800

    source-hash-d379d18666aa42031359ca8eb34b0021960347ae
    
    commit d379d18666aa42031359ca8eb34b0021960347ae
    Author:     Miklos Vajna <vmiklos@collabora.co.uk>
    AuthorDate: Wed Jun 18 11:57:31 2014 +0200
    Commit:     Miklos Vajna <vmiklos@collabora.co.uk>
    CommitDate: Wed Jun 18 12:09:15 2014 +0200
    
        oox: import WPS shape with text as shape with textbox
    
        This allows having real shapes (like having rounded corners) and complex
        content (like containing a table) at the same time.
    
        WPS shapes are wrappers around drawingML markup in DOCX files, so this
        only affects the DOCX import.
    
        Change-Id: Iad1c1c61233be1c17efa1821e680927aa9587215
Comment 7 Matúš Kukan 2016-09-08 12:30:49 UTC
Works for me with LibreOffice build from master commit 5e9982668224345f901631d664985e823530e05a.
Could you please check if it's already fixed in daily builds?
Comment 8 Aron Budea 2016-09-09 00:51:59 UTC
I can check in a few days. In the meantime adding other reports related to this commit.
Comment 9 Carlo 2016-09-18 17:41:17 UTC
Reproducible with LO 5.2.2.1 (x64) under Window 10.
Comment 10 Aron Budea 2016-09-18 23:46:40 UTC
Indeed, the error during save is not there anymore in master build. I did a reverse bibisect, and the following commit fixed it:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=fb045517532aababc06fb4b1112def53b03d9144

crashtesting: assert on export of tdf99571-1.docx to docx


Caolán, do you think it's safe to backport this commit to 5.2/5.1?

Let's keep this report open until the underlying issue is resolved. Reducing importance, since the file can be saved now.
Comment 11 Caolán McNamara 2016-09-19 09:19:59 UTC
Yes, we can safely backport that. Set to fixed, cause fixed in master and backports in gerrit for review now
Comment 12 fiftyigfuci_f_mi 2016-09-20 02:49:33 UTC
Reopend because still the error messagebox pops up when save as ODF.

I confirmed that the error has disappeared when saved as Word format in my master build.
but saving as ODF format still has the problem.

>Error saving the document Especificacion- Requerimientos-v1:
>Write Error.
>Error in writing sub-document styles.xml.

Ubuntu 16.04 x64
Comment 13 Aron Budea 2016-09-20 03:52:26 UTC
Darn, that's too bad. Still, good catch.
There's also data loss when saving and reloading as DOCX.

We might be onto something here, as others reported errors with the same error message recently, but we weren't able to reproduce them (see newly added bug reports in See Also field).

Resetting importance to high/critical. Also removing regression-related keywords: while the file could be saved in 4.3, it didn't load properly back then, either, even upon first load.
Comment 14 Commit Notification 2016-09-20 10:30:20 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=097f34e6411248856cfc78ffe80571aa2a876bff&h=libreoffice-5-2

Resolves: tdf#99273 can't save specific docx

It will be available in 5.2.3.

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

Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2016-09-23 13:45:30 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=fa5830d02cec81921235357f4ed0372d104cf89e&h=libreoffice-5-1

Resolves: tdf#99273 can't save specific docx

It will be available in 5.1.6.

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

Affected users are encouraged to test the fix and report feedback.
Comment 16 Miklos Vajna 2016-09-23 18:55:10 UTC
Please open a new follow-up bugreport for the ODF save problem, the summary of this bug is clearly about not being able to "save", not "save as odf".
Comment 17 Aron Budea 2016-09-23 22:43:25 UTC
Follow-up reports bug 102466 and bug 102479 opened as requested.