Bug 124384 - LO shouldn't crash when opening DOCX (even if MSO cannot open or warns about unreadable content)
Summary: LO shouldn't crash when opening DOCX (even if MSO cannot open or warns about ...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.2.2.2 release
Hardware: All All
: high major
Assignee: Serge Krot (CIB)
URL:
Whiteboard: target:6.3.0 target:6.2.3
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2019-03-28 07:23 UTC by Andrew Bromwich
Modified: 2019-04-02 08:57 UTC (History)
3 users (show)

See Also:
Crash report or crash signature: ["writerfilter::dmapper::DomainMapper_Impl::SetSdt(bool)"]


Attachments
Opening file causes application error (opens fine in MS Word) (95.29 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-03-28 07:26 UTC, Andrew Bromwich
Details
Opening in libre v6 causes Application Error (36.56 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-03-28 08:27 UTC, Andrew Bromwich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Bromwich 2019-03-28 07:23:31 UTC
Description:
In Microsoft Word the document opens and displays content as expected.

In Libre 5.4.5.1 the document opens, but only shows the content (removed) up to the first <w:sdt> tag

In Libre 6.2.2.2 the document does not open and Libre reports "Application Error"

Steps to Reproduce:
1. Reproducible by opening the file with head (view it), or by trying to `cat` the contents


Actual Results:
Application Error - exit

Expected Results:
Display the document


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Comment 1 Andrew Bromwich 2019-03-28 07:26:33 UTC
Created attachment 150336 [details]
Opening file causes application error (opens fine in MS Word)

I have removed all contents from the `document.xml` except for the parts that cause the application error.
Comment 2 Mike Kaganski 2019-03-28 07:37:58 UTC
Crashreport for Version: 6.2.2.2 (x64)
Build ID: 2b840030fec2aae0fd2658d8d4f9548af4e3518d
CPU threads: 12; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: CL

http://crashreport.libreoffice.org/stats/crash_details/31898198-1651-4d77-89db-48bad7e76420

But opening the attachment 150336 [details] with Word 2016 also gives an error:

> Word experienced an error trying to open the file.
> Try these suggestions.
> * Check the file permissions for the document on drive.
> * Make sure there is sufficient free memory and disk space.
> * Open the file with the Text Recovery converter.
> (D:\...\libre-application-error.docx)

So the document is corrupted (possibly as a result of "removing all contents from the `document.xml` except for the parts that cause the application error"?). Please check and attach a valid document, since it's unreasonable to test something that might turn out to be a different problem.
Comment 3 Andrew Bromwich 2019-03-28 07:42:35 UTC
Thanks for the heads up Mike. Sorry, I may have cut back too much in trying to isolate the issue. I've only got Libre 5 and 6 locally but will update the document with a slightly less cut back version that has been tested to load etc in Word asap.

Apologies
Comment 4 Andrew Bromwich 2019-03-28 08:27:26 UTC
Created attachment 150342 [details]
Opening in libre v6 causes Application Error
Comment 6 Xisco Faulí 2019-03-28 10:33:03 UTC
Regression introduced by:

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

author	Serge Krot <Serge.Krot@cib.de>	2018-12-06 19:11:58 +0100
committer	Thorsten Behrens <Thorsten.Behrens@CIB.de>	2019-01-09 22:30:08 +0100
commit ff4f2ba3242d303f7f238a7a142440f1f4b1f288 (patch)
tree e26084095041d94378b9189ea026da22b8e456b6
parent f22f28e722a8a2efdc42bddba80a3a43025a61fd (diff)
sw: DOCX: recognize TOC title during import

Bisected with: bibisect-linux64-6.3 

Adding Cc: to Serge Krot
Comment 7 Timur 2019-03-28 10:43:31 UTC
Attachment 150336 [details] cannot be open in MSO with "experienced error",  attachment 150342 [details] in MSO warns about unreadable content and recovers some. LO shouldn't crash though.
Comment 8 Xisco Faulí 2019-03-28 12:04:02 UTC
(In reply to Timur from comment #7)
> Attachment 150336 [details] cannot be open in MSO with "experienced error", 
> attachment 150342 [details] in MSO warns about unreadable content and
> recovers some. LO shouldn't crash though.

Lowering severity then...
Comment 9 Commit Notification 2019-03-29 10:21:11 UTC
Serge Krot committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/8a76b845e0376fd39014d6180c78b863f373633f%5E%21

tdf#124384 sw DOCX: fix crash during bibliography loading

It will be available in 6.3.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 10 Commit Notification 2019-03-29 21:26:38 UTC
Serge Krot committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/ad6f0e2dc8bc9ed9f12e57c4dd94e11f439e9c5f%5E%21

tdf#124384 sw DOCX: fix crash during bibliography loading

It will be available in 6.2.4.

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 11 Xisco Faulí 2019-04-01 09:22:54 UTC
Verified in

Version: 6.3.0.0.alpha0+
Build ID: 107fd82751c35818152eabd45bdf882972d3c100
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

@Serge Krot, thanks for the quick fix !!
Comment 12 Commit Notification 2019-04-01 15:44:31 UTC
Serge Krot committed a patch related to this issue.
It has been pushed to "libreoffice-6-2-3":

https://git.libreoffice.org/core/+/84f419917baf2318f126016def5b989dc9cb7bf7%5E%21

tdf#124384 sw DOCX: fix crash during bibliography loading

It will be available in 6.2.3.

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.