Bug 156318 - LibreOffice hangs when floating table tries to break
Summary: LibreOffice hangs when floating table tries to break
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:24.2.0 target:7.6.2
Keywords:
Depends on:
Blocks: Writer-Tables
  Show dependency treegraph
 
Reported: 2023-07-16 22:33 UTC by Regina Henschel
Modified: 2023-09-05 08:00 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
example with floating table on one page (31.64 KB, application/vnd.oasis.opendocument.text)
2023-07-16 22:33 UTC, Regina Henschel
Details
Screenshot of rendering for me, after trying to repro 1) (98.23 KB, image/png)
2023-07-18 12:20 UTC, Miklos Vajna
Details
Screenshot of rendering for me, after trying to repro 2) (105.13 KB, image/png)
2023-07-18 12:23 UTC, Miklos Vajna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2023-07-16 22:33:00 UTC
Created attachment 188400 [details]
example with floating table on one page

The attached document has a floating table with settings "Keep inside text boundaries" and "Allow frame to split across pages". There is some dummy text on the right side of the frame, the frame is aligned left and has 50% width. Currently the frame is totally on the first page.
 
(1) Open attached document. Open the page properties and set top and bottom margin to 15mm. This makes the available space for text less high; the frame no longer fits on the page and the frame tries to break. => LibreOffice hangs.

(2) Open file again. Now mark all paragraphs in the table and assign paragraph style 'Body text'. That introduces a distance after. The rows become higher and the frame no longer fits on the page. Again LibreOffice hangs.

I have tested it in Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: fcbae818b793a9ee97a1b5ddc53902be7a2376f5
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: default; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

BTW, this is no import from Word but the file was generated in LibreOffice.
Comment 1 Miklos Vajna 2023-07-18 12:20:34 UTC
Thanks for the report!

> (1) Open attached document. Open the page properties and set top and bottom
> margin to 15mm. This makes the available space for text less high; the frame
> no longer fits on the page and the frame tries to break. => LibreOffice
> hangs.

A have bit newer build here at core.git 79ebf2c887411345709e11465d0c81b7b9e04d66. The commits between your hash and this one one are:
 8bd30999098567b3bdb84a6ca65c071952192932 tdf#120262 sw floattable: don't wrap text around fly when no content would fit 52d265c0d2f2638c386475e58c3ee489ccd3f06c sw floattable: fix lost floating table right before a hidden para from DOCX d59704b6b8c7e5395c0606fa01f37392afc4b2cd cool#6857 sw floattable: try harder to keep anchor text in the last follow 663db89378aa1f0425e795ef5d471f134e658dc4 sw floattable: make sure floattable after floattable gets own anch pos from DOC

perhaps one of these fixed the problem?

Will attach a screenshot.

> (2) Open file again. Now mark all paragraphs in the table and assign
> paragraph style 'Body text'. That introduces a distance after. The rows
> become higher and the frame no longer fits on the page. Again LibreOffice
> hangs.

Seems this works as well. Will attach a second screenshot.

> BTW, this is no import from Word but the file was generated in LibreOffice.

That is fine, my hope is to support creation, rendering, modification and deletion of these frames, not just existing floating tables from Word formats.
Comment 2 Miklos Vajna 2023-07-18 12:20:57 UTC
Created attachment 188435 [details]
Screenshot of rendering for me, after trying to repro 1)
Comment 3 Miklos Vajna 2023-07-18 12:23:24 UTC
Created attachment 188436 [details]
Screenshot of rendering for me, after trying to repro 2)

Somewhat unrelated: if you would like that I change the ODF markup (seeing the discussion on the dev mailing list thread), then it may be useful to do that sooner rather than later, so we won't have the problem that older and newer floating table bugzilla ODT documents use a different markup. Thanks.
Comment 4 Regina Henschel 2023-07-18 16:41:56 UTC
It still hangs for me with Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 6256d5fe2e7cb1bb002d5fe59527d3a3fbf6963f
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

That is the daily build from 2023-07-18.


(In reply to Miklos Vajna from comment #3)
> Somewhat unrelated: if you would like that I change the ODF markup (seeing
> the discussion on the dev mailing list thread), then it may be useful to do
> that sooner rather than later, so we won't have the problem that older and
> newer floating table bugzilla ODT documents use a different markup. Thanks.

I'll answer on the dev mailing list.
Comment 5 ysui2022 2023-07-20 04:52:39 UTC
I can't reproduce this with
Version: 7.5.4.2 (X86_64) / LibreOffice Community
Build ID: 36ccfdc35048b057fd9854c757a8b67ec53977b6
CPU threads: 8; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 6 Regina Henschel 2023-07-20 13:08:43 UTC
(In reply to ysui2022 from comment #5)
> I can't reproduce this with
> Version: 7.5.4.2 (X86_64) / LibreOffice Community
> Build ID: 36ccfdc35048b057fd9854c757a8b67ec53977b6
> CPU threads: 8; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL:
> win
> Locale: en-US (en_US); UI: en-US
> Calc: CL threaded

Floating tables that can continue on next page is a new feature in LibreOffice 7.6 and LibreOffice 24.2. You need a current daily build to test it.
Comment 7 raal 2023-08-15 22:58:23 UTC
No crash after step (1). Freeze/100% CPU after step (2)

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 4403b4e6bac19d89afded080d80de049aaa294ca
CPU threads: 4; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded
Comment 8 Miklos Vajna 2023-08-21 08:12:08 UTC
Hmm, really weird, I still can't reproduce the freeze.

Here is what I did:

1) clone https://bibisect.libreoffice.org/linux-64-24.2
2) check out the state that refers to commit 4403b4e6bac19d89afded080d80de049aaa294ca (it's currently the last commit in the repo)
3) perform the first scenario (increase top/bottom page margin to 15 mm) -> no hang
4) close the document without saving, open it again, perform the second scenario (select the table's paragraphs, set paragraph style to 'body text') -> again no hang

I also tried this with forcing the locale to cs_CZ.UTF-8, forcing the VCL mode to gtk3.
Comment 9 Aron Budea 2023-08-21 12:25:49 UTC
I can reproduce hang (1) only if
- the window is resized so only one page fits horizontally, and
- top and bottom margin is set to 2.5 cm.
Comment 10 Miklos Vajna 2023-08-22 07:10:10 UTC
Excellent, I can reproduce the scenario from comment 9. Thanks.
Comment 11 Commit Notification 2023-09-01 09:00:35 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7d4213b9f0253b323750acceca8f4edb9d1a7fc5

Related: tdf#156318 sw floattable: fix handling of vert orient == top

It will be available in 24.2.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 12 Miklos Vajna 2023-09-01 09:18:32 UTC
This fixes the hang, but the result is not yet fixed.
Comment 13 Commit Notification 2023-09-04 09:52:31 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/401c175d1bbe3c64e5dd96e3b23779999271cfb1

tdf#156318 sw floattable: fix follow text flow handling on interactive edit

It will be available in 24.2.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 14 Commit Notification 2023-09-04 15:26:16 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/38192482e552195a5c76a6e40fc3586cc6f0355c

Related: tdf#156318 sw floattable: fix handling of vert orient == top

It will be available in 7.6.2.

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 15 Commit Notification 2023-09-05 08:00:04 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/51a16c241ed31de4012ed4d3d8569ed8eb64adfb

tdf#156318 sw floattable: fix follow text flow handling on interactive edit

It will be available in 7.6.2.

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.