Bug 149509 - CRASH: inserting page break in content control
Summary: CRASH: inserting page break in content control
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:7.5.0 target:7.4.0.0.beta2
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2022-06-09 22:32 UTC by Xisco Faulí
Modified: 2022-06-13 12:24 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
sample file (21.83 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-06-09 22:32 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2022-06-09 22:32:29 UTC
Created attachment 180661 [details]
sample file

Steps to reproduce:
1. Open attached document
2. Insert page break

-> Crash

Reproduced in

Version: 7.4.0.0.alpha1+ / LibreOffice Community
Build ID: d4123356c61db269651e950a0a2cc93e6d801c90
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: x11
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded
Comment 1 Xisco Faulí 2022-06-09 22:33:10 UTC
author	Miklos Vajna <vmiklos@collabora.com>	2022-04-20 08:29:35 +0200
committer	Miklos Vajna <vmiklos@collabora.com>	2022-04-20 11:47:40 +0200
commit f2ab1375b266d7465ef31d06ec8f949c6b91d853 (patch)
tree cbc45f6929f5df75530310d4dbd6c2f10e25cd88
parent d5fb8d502e77c1dfc77b2c7bdda4bb1540f3ddaf (diff)
sw content controls: add initial DOCX import

Bisected with: bibisect-linux64-7.4

Adding Cc: to Miklos Vajna
Comment 2 Miklos Vajna 2022-06-10 11:18:38 UTC
Hm, opening this in a --enable-dbgutil build, we already crash on file open:

Thread 1 "soffice.bin" received signal SIGSEGV, Segmentation fault.
0x00007fffcc442ee1 in sw::CalcBreaks (rBreaks=std::__debug::vector of length 0, capacity 0, rPam=SwPaM = {...}, isOnlyFieldmarks=true) at /home/vmiklos/git/libreoffice/master/sw/source/core/doc/DocumentContentOperationsManager.cxx:591
591                                     assert(std::get<0>(startedFields.top())->IsCoveringPosition(SwPosition(rTextNode, i)));
(gdb) print startedFields
$1 = std::stack wrapping: std::__debug::deque with 1 element = {std::tuple containing = {[1] = 0x0, [2] = false, [3] = {m_value = 0}, [4] = 0}}

Let me try in a --enable-symbols build, but the fieldmark aspect of this document would be probably also interesting as a separate bug. The assert was added in commit 522ed1b685f5b7eb52efb9d874dfacc02bf82139 (ofz#18563 sw: fix 2 problems with field marks, 2019-12-06), although I guess the request is valid that we should not have a fieldmark separator without a started fieldmark.
Comment 3 Xisco Faulí 2022-06-10 11:35:29 UTC
oh, you are right. I didn't notice it because I used the bisect repository
Comment 4 Miklos Vajna 2022-06-10 12:13:32 UTC
Looking at the broader picture, inserting page breaks inside (inline) content controls should not be possible, the Word UI doesn't allow it, either. I'll fix this on our side.

(So let's keep this bug focused on page break insertion.)
Comment 5 Commit Notification 2022-06-13 06:10:54 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/aa5824b2a6df99ef9d788a8d37bdfa77582375c8

tdf#149509 sw content controls: reject page break insertion

It will be available in 7.5.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 6 Commit Notification 2022-06-13 12:24:12 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/a0db69e9e4cf2f7144dfc53fa32fb027c4b76f5f

tdf#149509 sw content controls: reject page break insertion

It will be available in 7.4.0.0.beta2.

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.