Bug 107935 - Crash when transforming a malformed docx to pdf when LibreOffice running as server or from the command line
Summary: Crash when transforming a malformed docx to pdf when LibreOffice running as s...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-18 16:30 UTC by Martin Mueller
Modified: 2017-05-24 19:10 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
malformed docx (21.09 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-05-18 16:31 UTC, Martin Mueller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mueller 2017-05-18 16:30:53 UTC
Description:
We are using LibreOffice for some transformations. A malformed docx transformation to pdf can cause a crash for the LibreOffice instance on macOS (not on Windows and Linux).

I will try to attach the faulty file. The faulty part can than be found in
problemFootnotes.docx\word\numbering.xml

Please have a look on our internally Jira
https://issues.alfresco.com/jira/browse/ACE-5792

Steps to Reproduce:
1.Install Alfresco Trial configured with using LibreOffice
2.Go in Share and create a new site
3.In documentLibrary upload the faulty file

Actual Results:  
LibreOffice crashes

Expected Results:
LibreOffice shouldn't crash


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36
Comment 1 Martin Mueller 2017-05-18 16:31:43 UTC
Created attachment 133390 [details]
malformed docx
Comment 2 Martin Mueller 2017-05-18 16:58:40 UTC
We are using Jodconverter connects to LibreOffice through TCP and sends control commands to it.
Comment 3 Julien Nabet 2017-05-18 18:30:48 UTC
I don't understand, I gave a try on Debian x86-64 with master sources updated today, LO doesn't crash, it just:
- displays an error message
- interrupt the opening of the file
Comment 4 Martin Mueller 2017-05-19 08:43:49 UTC
For us it is only on macOS.
Comment 5 Alex Thurgood 2017-05-22 07:45:23 UTC
I get the following message when attempting to open the file:


File format error found at 
SAXParseException: '[ line 2]: Extra content at the end of the document
', Stream '', Line 2, Column 1084(row,col).

and LO refuses to load the document, but it doesn't crash.


Tested on 

Version: 5.3.3.2
Build ID: 3d9a8b4b4e538a85e0782bd6c2d430bafe583448
CPU Threads: 2; OS Version: Mac OS X 10.12.4; UI Render: default; Layout Engine: new; 
Locale: fr-FR (fr_FR.UTF-8); Calc: group


Perhaps it is the combination of Alfresco and the document that causes the problem ?
Comment 6 Alex Thurgood 2017-05-22 07:47:12 UTC
No crash either with :

Version: 5.4.0.0.alpha1+
Build ID: 5ac9c1ce61c516800cef503662d80d92394fb3f9
CPU threads: 2; OS: Mac OS X 10.12.4; UI render: default; 
Locale: fr-FR (fr_FR.UTF-8); Calc: group
Comment 7 Alex Thurgood 2017-05-22 07:56:30 UTC
FWIW, Microsoft Word for Mac refuses to open the file too, but does at least suggest to try and repare it.
Comment 8 Alex Thurgood 2017-05-22 08:03:57 UTC
From the terminal with LODev54:


ns1:core alex$ ./instdir/LibreOfficeDev.app/Contents/MacOS/soffice --convert-to pdf /Users/alex/Downloads/problemFootnotes.docx 
warn:sal.osl.pipe:44048:1:sal/osl/unx/pipe.cxx:393: shutdown() failed: Socket is not connected
warn:sal.osl.pipe:44048:3:sal/osl/unx/pipe.cxx:434: accept() failed: Software caused connection abort
warn:opencl:44048:1:desktop/source/app/opencl.cxx:138: Failed to initialize OpenCL for test
0x18ae51a88:createUnknownChildContext:b:Sources
0x18ae51b48:start unknown element:b:Sources
0x18ae51b48:end unknown element:b:Sources
Error: source file could not be loaded
warn:sal.osl.pipe:44048:1:sal/osl/unx/pipe.cxx:393: shutdown() failed: Socket is not connected
warn:sal.osl.pipe:44048:3:sal/osl/unx/pipe.cxx:434: accept() failed: Software caused connection abort
Comment 9 Alex Thurgood 2017-05-22 08:09:22 UTC
With the writer_pdf filter :

ns1:core alex$ ./instdir/LibreOfficeDev.app/Contents/MacOS/soffice --convert-to pdf:writer_pdf_Export /Users/alex/Downloads/problemFootnotes.docx 
0x18b557968:createUnknownChildContext:b:Sources
0x18b557a28:start unknown element:b:Sources
0x18b557a28:end unknown element:b:Sources
Error: source file could not be loaded
warn:sal.osl.pipe:45126:1:sal/osl/unx/pipe.cxx:393: shutdown() failed: Socket is not connected
warn:sal.osl.pipe:45126:3:sal/osl/unx/pipe.cxx:434: accept() failed: Software caused connection abort
Comment 10 Martin Mueller 2017-05-24 16:49:35 UTC
Thank you very much for your investigations so far.
We found out that some of our versions still using a to old LO version (4.4.5) upgrading to 5.2.1 or newer did the trick.

So this ticket can be closed and thanks again.

Regards Martin
Comment 11 Julien Nabet 2017-05-24 19:10:29 UTC
Thank you Martin for your feedback, let's put this one to WFM then.