Bug 113657 - impress crashes when trying to format - char an empty paragraph
Summary: impress crashes when trying to format - char an empty paragraph
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
4.1 all versions
Hardware: All All
: high major
Assignee: Julien Nabet
URL:
Whiteboard: target:6.0.0 target:5.4.4
Keywords: bibisected, bisected, haveBacktrace, regression
: 113940 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-11-05 09:46 UTC by Christian Boltz
Modified: 2022-09-01 14:07 UTC (History)
3 users (show)

See Also:
Crash report or crash signature: ["FontPrevWin_Impl::DrawPrev(OutputDevice &,Printer *,Point &,SvxFont const &)"]


Attachments
gdb backtrace (38.16 KB, text/plain)
2017-11-05 12:13 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Boltz 2017-11-05 09:46:54 UTC
I found an easily reproducible crash in LibreOffice Impress.

Reproducer:
- create a new impress document
- click cancel in the template selection dialog
- type the following in a textbox: x<return><return>y
- press cursor-left
- press shift + cursor-left to select the linebreak / paragraph
- open the format - char dialog and watch LibreOffice crashing

This is reproducable in (at least) 6.0.0.0 alpha0+ and 5.4.1.2
Comment 1 Xisco Faulí 2017-11-05 11:56:24 UTC
Thanks for reporting this issue.
Reproduced in

- Version: 6.0.0.0.alpha1+
Build ID: 6070dec9ca9a15587a2aece81f9ae1ab5ac0f8c4
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

- Version: 5.2.0.0.alpha1+
Build ID: 5b168b3fa568e48e795234dc5fa454bf24c9805e
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; 
Locale: ca-ES (ca_ES.UTF-8)

- Version: 4.3.0.0.alpha1+
Build ID: c15927f20d4727c3b8de68497b6949e72f9e6e9e

- Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)

but not in

- LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 2 Xisco Faulí 2017-11-05 12:13:51 UTC
Created attachment 137538 [details]
gdb backtrace
Comment 4 Xisco Faulí 2017-11-05 12:35:48 UTC
Regression introduced by:

author	Michael Stahl <mstahl@redhat.com>	2012-10-14 19:10:38 (GMT)
committer	Michael Stahl <mstahl@redhat.com>	2012-10-14 19:14:25 (GMT)
commit 3d1f4649ee72dd85e1d994ac2bdccc3147830bbd (patch)
tree c74d2babd65a26f364db5e0262fff2c1c2f28c55
parent 86b6bf6e53c234e3df951ebb08513b0d4fc47a14 (diff)
FontPrevWin_Impl::CheckScript(): assert that there is text:
If there is no preview text here then aTextWidth will have no entries
and we crash when writing to the non-existing first element.
aText should come from the current SfxViewShell, from the font name
(unless that is ambiguous, e.g. a selection of text with multiple
fonts), or the Window text (Window::GetText(), whatever that is).

Adding Cc: to Michael Stahl
Comment 5 Julien Nabet 2017-11-08 22:23:01 UTC
Michael: as you may have seen, I put you in cc for reviewing https://gerrit.libreoffice.org/#/c/44513/

(let's increase the importance of the bugtracker since it's a crash + regression)
Comment 6 Xisco Faulí 2017-11-21 16:34:02 UTC
*** Bug 113940 has been marked as a duplicate of this bug. ***
Comment 7 Commit Notification 2017-11-23 14:17:12 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

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

tdf#113657: fix crash when trying to format empty paragraph

It will be available in 6.0.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 8 Julien Nabet 2017-11-23 14:36:41 UTC
Let's put this one to FIXED
For 5.4, the patch is on gerrit:
https://gerrit.libreoffice.org/#/c/45151/
Comment 9 Commit Notification 2017-11-24 18:40:58 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=479719b1f53cb5f44bbcc57e75dad1aae604cd20&h=libreoffice-5-4

tdf#113657: fix crash when trying to format empty paragraph

It will be available in 5.4.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.