Bug 114338 - Watermark crashes LibreOffice with some documents
Summary: Watermark crashes LibreOffice with some documents
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.4.3.2 release
Hardware: All All
: highest critical
Assignee: Not Assigned
URL:
Whiteboard: target:6.1.0 target:6.0.0.1
Keywords: haveBacktrace
Depends on:
Blocks:
 
Reported: 2017-12-08 11:02 UTC by bureautiquelibre
Modified: 2017-12-11 12:33 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
File that causes watermark crash (58.41 KB, application/vnd.oasis.opendocument.text)
2017-12-08 11:02 UTC, bureautiquelibre
Details
gdb backtrace (32.28 KB, text/x-log)
2017-12-08 12:11 UTC, Xisco Faulí
Details
error before crashing (4.40 KB, image/png)
2017-12-08 12:26 UTC, Xisco Faulí
Details
valgrind trace (48.00 KB, application/gzip)
2017-12-08 16:17 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bureautiquelibre 2017-12-08 11:02:52 UTC
Created attachment 138302 [details]
File that causes watermark crash

Steps to reproduce

1/ Load attachment document in writer
2/ Add watermark

Popup with message: LibreOffice Fatal Error - no text available

Press OK --> LibreOffice crash
Comment 1 Julien Nabet 2017-12-08 11:15:46 UTC
Can you give by step process?
Indeed, Googling about inserting watermark gives old links with obsolete step by step.
eg Format > Page > Background, there's no "Background" option.
Comment 2 Julien Nabet 2017-12-08 11:17:26 UTC
Forget my last comment, Format/watermark
Comment 3 Xisco Faulí 2017-12-08 12:09:50 UTC
Reproduced in

Version: 6.1.0.0.alpha0+
Build ID: 495ac1bc97f3deea8e13cb1a2b9f59d087873c3f
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk3; 
Locale: en-US (ca_ES.UTF-8); Calc: group threaded
Comment 4 Xisco Faulí 2017-12-08 12:11:24 UTC
Created attachment 138305 [details]
gdb backtrace
Comment 5 Xisco Faulí 2017-12-08 12:25:03 UTC
LibreOffice crashes since e01c6a3ba7c0e6a089769187ee1ad241aa862280 while inserting the watermark, before the document crashed at import time.
Adding Szymon Kłos as he implemented the watermark dialog in 5.4
Comment 6 Xisco Faulí 2017-12-08 12:26:14 UTC
Created attachment 138306 [details]
error before crashing

BTW, I get this error just before crashing...
Comment 7 Julien Nabet 2017-12-08 16:17:08 UTC
Created attachment 138312 [details]
valgrind trace

On pc Debian x86-64 with master sources updated yesterday, I could reproduce the crash but only when letting the watermark test non empty.
When it's empty, no crash.
(with gtk3 or gtk2 renderings)
Comment 8 Commit Notification 2017-12-09 09:19:25 UTC
Szymon Kłos committed a patch related to this issue.
It has been pushed to "master":

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

tdf#114338 don't crash on watermark insert w/ existing header

It will be available in 6.1.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 9 Commit Notification 2017-12-09 12:21:23 UTC
Szymon Kłos committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0622e5db4e330de000f1318540c85e3223f45b40&h=libreoffice-6-0

tdf#114338 don't crash on watermark insert w/ existing header

It will be available in 6.0.0.1.

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 10 Xisco Faulí 2017-12-11 12:14:11 UTC
Crash no longer reproduced in

Version: 6.1.0.0.alpha0+
Build ID: 3af500580b1c82eabd60335c9ebc458a3f68850c
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group threaded

Szymon Kłos, However, no watermark is inserted, is it expected? should I report a new issue for that?
Comment 11 Szymon Kłos 2017-12-11 12:33:21 UTC
I tested it in MSO and MSO also didn't insert Watermark in this case.
Because Watermark is a shape inside a header then if we have another content there already, we can remove old content or not insert watermark to prevent user from data loss. It was intentional, I wanted to have the same behaviour.

But now I tested it second time, MSO inserts Watermark only if I choose predefined one, using custom text it is not inserted. So you can create new bug for this.