Bug 105942 - Hang when trying to save with password protection a .docx which contains an image
Summary: Hang when trying to save with password protection a .docx which contains an...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3.0.3 release
Hardware: x86-64 (AMD64) All
: high critical
Assignee: Not Assigned
URL:
Whiteboard: target:5.4.0 target:5.3.4
Keywords: bibisected, bisected, haveBacktrace, perf, regression
Depends on:
Blocks:
 
Reported: 2017-02-11 15:43 UTC by Claudio
Modified: 2017-05-05 08:54 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
This will crash if saved with password (110.32 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-02-11 15:49 UTC, Claudio
Details
bts (38.20 KB, text/plain)
2017-02-12 15:00 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Claudio 2017-02-11 15:43:46 UTC
Description:
Saving a password protected .docx document with text only works properly.
Including and image (say a photo) in the document will hang on the save procedure.
The software will not respond until Windows 10 realize it is hanged and ask for killing or finding a solution.
The task can be killed with task manager.


Steps to Reproduce:
1. Create a document with one line text
2. add a photo in the next line
3. save as .docx and click pasword protection
4. Set password (used 123) and try to save


Actual Results:  
4. Sw will hang

Expected Results:
With hanged program after a while i kill it with Task Manager.
File is screwed but can be recovered.
Software should have encrypted and saved the file


Reproducible: Always

User Profile Reset: No
Used different accounts on the system with the same result.
SW just upgraded to 5.25 but was the same with previous versions

Additional Info:
The attached file crash the sw if "save as" and password is requested


User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0
Comment 1 Claudio 2017-02-11 15:49:48 UTC
Created attachment 131106 [details]
This will crash if saved with password
Comment 2 MM 2017-02-11 22:38:56 UTC
Confirmed with Version: 5.4.0.0.alpha0+
Build ID: 83e059af2203ec0cd15dea08cfa538555ba14bd7
CPU Threads: 2; OS Version: Linux 4.4; UI Render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-02-07_00:53:03
Locale: en-US (en_US.UTF-8); Calc: single

Doesn't crash, but hangs forever.
No problem if you select the picture and do: RMB > compress > png compression > OK. Then save.
Comment 3 Julien Nabet 2017-02-12 15:00:01 UTC
Created attachment 131137 [details]
bts

On pc Debian x86-64 with master sources updated today (+enable-dbgutil + gtk3), I don't reproduce the crash but have an hang.
I retrieved bts after I "ctrl-Ced" on gdb.
Comment 4 Xisco Faulí 2017-04-19 09:17:50 UTC
Regression introduced by:

author	Matúš Kukan <matus.kukan@collabora.com>	2014-11-12 20:25:55 (GMT)
committer	Matúš Kukan <matus.kukan@collabora.com>	2014-11-17 09:49:24 (GMT)
commit 0843ade74e5848c0babad509b10c334b01847be2 (patch)
tree ccdb2447873bae5728d498a50b52ffe3f052670b
parent d09b6209f1f374b6069089d8583c9ee373e3c1e5 (diff)
package: Do not bother with deflating jpeg images
It takes a lot of time and we can save ~1% of size if at all. Rather
store them uncompressed in the zip file.
With png, we can save a bit more, although it's still only about 4% - 8%?

Bisected with bibisect-44max
Comment 5 Xisco Faulí 2017-04-19 09:40:07 UTC
Patch submitted to gerrit: https://gerrit.libreoffice.org/#/c/36672/
Comment 6 Commit Notification 2017-04-27 21:46:09 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f8fdc6417b4d023b7c75485754a0ab1b164a69d6

tdf#105942 Don't hang when file is protected and compressed

It will be available in 5.4.0.

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 7 Commit Notification 2017-05-05 08:54:00 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=31e22b4bd961ed946bf8f0f4ccb330c699292ddb&h=libreoffice-5-3

tdf#105942 Don't hang when file is protected and compressed

It will be available in 5.3.4.

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.