Bug 156306 - tagged PDF export of odt document runs in a loop (hangs)
Summary: tagged PDF export of odt document runs in a loop (hangs)
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
7.6.0.2 rc
Hardware: x86-64 (AMD64) All
: high major
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:24.2.0 target:7.6.1 target:7.6...
Keywords: accessibility, bibisectRequest, filter:pdf, regression
: 157607 (view as bug list)
Depends on:
Blocks: PDF-Accessibility
  Show dependency treegraph
 
Reported: 2023-07-15 21:44 UTC by Stefan_Lange_KA@T-Online.de
Modified: 2023-12-12 03:54 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
zip file with 4 odt documents to show the problem (932.57 KB, application/x-zip-compressed)
2023-07-15 21:44 UTC, Stefan_Lange_KA@T-Online.de
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan_Lange_KA@T-Online.de 2023-07-15 21:44:18 UTC
Created attachment 188389 [details]
zip file with 4 odt documents to show the problem

odt documents with some special properties (I don't know what) cannot be exported to pdf via "Directly export as PDF" because LibreOffice hangs resp. starts to run in a loop: uses cpu and doesn't answer. 
I noticed the problem after the test of Bug 154035 when I have changed a large document and wanted export it to pdf.

The behavior was first found in
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 693411e60c6bbd1c2ef25490cc3902f6b2461682
CPU threads: 4; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: threaded

In the previous build for Windows64
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 375d423573cf237fb082ed2b4908d8067036d8b2
CPU threads: 4; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: threaded
the problem wasn't present yet.

Documents to show the problem:
Because of the size of my large document (about 130 MB because of many images within) I have created the smaller version "Alte Fotoapparate V6.4.1_pdf_export_hangs.odt".
To narrow down the cause of the error I have stepwise reduced the style elements in this document (removed images and footer line, changed headers to "Standard" etc.) until remained "Test_document_pdf_export_hangs.odt".

Reproducing the problem: 
- open one of the documents
    Alte Fotoapparate V6.4.1_pdf_export_hangs.odt or
    Test_document_pdf_export_hangs.odt or
    Test_document_(coloured)_pdf_export_hangs.odt
  from  the attached zip file
- try to export the document to pdf via "Directly export to PDF"
- Result: LibreOffice hangs resp. loops (runs and uses cpu, but doesn't answer or end)

When in the documents "Test_document_pdf_export_hangs.odt" or the coloured version "Test_document_(coloured)_pdf_export_hangs.odt" the coloured section is removed one gets the document "Test_document_shortened_pdf_export_OK.odt. This document can be exported to pdf without any problems.
Therefore I suppose the cause of the problem is in the coloured section.
Comment 1 Stefan_Lange_KA@T-Online.de 2023-07-27 13:19:59 UTC
New test with current build
The behavior (pdf export hangs with my test documents) can be reproduced with
Version: 7.6.1.0.0+ (X86_64) / LibreOffice Community
Build ID: fe3ceb5c6ac1fcd52f0c2b20dcfc4d2505aedfe5
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: CL threaded
(published in /daily/libreoffice-7-6/Win-x86_64@tb77-TDF/2023-07-27_01.45.53/)

With the previous Win64 build
Version: 7.6.0.1.0+ (X86_64) / LibreOffice Community
Build ID: b3f4e37ea6d8da69ce190f4826d7ec985142c83f
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: CL threaded
(published in /daily/libreoffice-7-6/Win-x86_64@tb77-TDF/2023-07-25_13.20.04/)
pdf export was still OK

In fe3ceb5c6ac1fcd52f0c2b20dcfc4d2505aedfe5 I see two changes related to pdf export:
30bb38b tdf#154982 drawinglayer,svx,sw,vcl: PDF export: hell flys and shapes... 
4bebff3 tdf#154982 vcl: PDF Export: split BeginStructureElement

To fix this bug has high priority at least for me - more than the already done fix of Bug 154035. Bug 154035 has disturbed and work was unconvenient with it but there was a workaround but not until now for the behavior decribed in this bug report.
If the behavior remains in LO 7.6.1 or would be inserted in LO 7.6.0 I cannot use these versions in my daily job.
Comment 2 Stéphane Guillou (stragu) 2023-07-29 22:52:22 UTC
Thank you for the report, Stefan!

Not reproduced in:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 46d7119b8be03968017e59d882e5671350304e15
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Reproduced in recent master build:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e26aeb882dd236adf19679d5df9b7ba5da1ed226
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

I can't bibisect this range just yet, but copying Michael in case he has an idea.
Comment 3 Stéphane Guillou (stragu) 2023-07-29 22:57:04 UTC
Confirmed that it is related to tagged PDF: if turned off in the PDF export dialog, no hang.
Comment 4 Stefan_Lange_KA@T-Online.de 2023-07-30 19:29:25 UTC
(In reply to Stéphane Guillou (stragu) from comment #3)
> Confirmed that it is related to tagged PDF: if turned off in the PDF export
> dialog, no hang.

This is a very good and for me useful information, many thanks! First I did not know what setting in the german version of PDF export dialog concerns tagged PDF but in trys I have found it is the setting "Indiziertes PDF". I have switched it off and the export to PDF works - my problem seems to be solved.
Currently I have no idea why the setting was switched on. Maybe I have switched it on when I started to export documents with a table of contents because the setting "Gliederung exportieren" (Export strcture [?]) is currently switched on too. But it seems both settings are not needed for a working table of contents in the exported PDF document - and it becomes significantly smaller.
Comment 5 Stéphane Guillou (stragu) 2023-07-31 09:34:03 UTC
(In reply to Stefan_Lange_KA@T-Online.de from comment #4)
> Currently I have no idea why the setting was switched on.

This is the new default since LO 7.6 for improved accessibility of exported documents, see https://wiki.documentfoundation.org/ReleaseNotes/7.6#PDF and bug 39667.
Comment 6 Commit Notification 2023-08-02 16:55:48 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/16aa870598d00eb3e6ac15435fef080d3b87cbc1

tdf#156306 sw: PDF export: duplicate structure element from ...

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 7 Michael Stahl (allotropia) 2023-08-02 16:56:11 UTC
fixed on master
Comment 8 Commit Notification 2023-08-03 12:01:27 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/74eafad84463d097adc8fe680f57b2c9039e0a56

tdf#156306 sw: PDF export: duplicate structure element from ...

It will be available in 7.6.1.

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 9 Stefan_Lange_KA@T-Online.de 2023-08-03 17:41:14 UTC
(In reply to Commit Notification from comment #6)
> Michael Stahl committed a patch related to this issue.
> It has been pushed to "master":
> 
> https://git.libreoffice.org/core/commit/
> 16aa870598d00eb3e6ac15435fef080d3b87cbc1
> 
> tdf#156306 sw: PDF export: duplicate structure element from ...
> 
> 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.

I have succesfully tested export of tagged PDF with
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 34387332173782498acd4998c7c665d04ebc3c7d
CPU threads: 4; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE

LO didn't hang at tagged PDF export an the document was succesfully exported.
Comment 10 Commit Notification 2023-08-08 16:12:57 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-6-0":

https://git.libreoffice.org/core/commit/1815e2efc6a780a18be721eb9680b014b58357b3

tdf#156306 sw: PDF export: duplicate structure element from ...

It will be available in 7.6.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 11 Stefan_Lange_KA@T-Online.de 2023-08-08 20:46:06 UTC
I have succesfully also tested with
Version: 7.6.1.0.0+ (X86_64) / LibreOffice Community
Build ID: 96df79630b936c4b908c57c76bac5ee58e2db5ad
CPU threads: 4; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: threaded

LO didn't hang at tagged PDF export an the document was succesfully exported.

to the test with LO 7.6.0:
I assume this test will be possible only with LO 7.6.0 rc3 when it is published. I don't know, where resp. wether at all daily builds for LO 7.6.0 are available at this time.
Comment 12 Stéphane Guillou (stragu) 2023-08-09 13:56:53 UTC
Thank you for verifying the fix, Stefan! You can mark reports as "verified - fixed" when you do that (I've just done it).
7.6.0.3 will be available in a few days, you can see planned release schedules on the wiki: https://wiki.documentfoundation.org/ReleasePlan/7.6
Comment 13 Stefan_Lange_KA@T-Online.de 2023-08-11 16:22:02 UTC
Succesfully tested with
Version: 7.6.0.3 (X86_64) / LibreOffice Community
Build ID: 69edd8b8ebc41d00b4de3915dc82f8f0fc3b6265
CPU threads: 4; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: threaded

Document was correctly exported to tagged PDF without hangig resp. running in a loop.
Comment 14 Commit Notification 2023-08-31 18:17:05 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

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

tdf#156306 sw: PDF export: another implicit structure element

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 15 Commit Notification 2023-09-01 08:24:29 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

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

tdf#156306 sw: PDF export: refactor, split out BeginTagImpl()

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 16 Stefan_Lange_KA@T-Online.de 2023-09-01 08:45:01 UTC
(In reply to Commit Notification from comment #14)
> Michael Stahl committed a patch related to this issue.
> It has been pushed to "master":
> 
> https://git.libreoffice.org/core/commit/
> cd57d3c5743ca4ed4cf59eaabaee551c085d430c
> 
> tdf#156306 sw: PDF export: another implicit structure element
> 
> 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.
I have succesfully tested export of tagged PDF with
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d88779fc86385dde1215fd28b78a69eacc6b4f97
CPU threads: 4; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: threaded

LO didn't hang at tagged PDF export and the document was succesfully exported.

But I have tested also with the build before the patch was comitted
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 695ae365dcab7c7dd59b39411299c5c200081885
CPU threads: 4; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: threaded
and I see no essential differences nor in the behavior of LO nor in the exported pdf documents.
Comment 17 Stefan_Lange_KA@T-Online.de 2023-09-01 09:00:00 UTC
Seems there are several patches needed to fix the problem completely.
Are there special aspects I have to watch in the tests except LO works and doesn't hang and the exported documents can be opened by Acrobat Reader?
Comment 18 Stefan_Lange_KA@T-Online.de 2023-09-05 21:30:48 UTC
(In reply to Commit Notification from comment #15)
> Michael Stahl committed a patch related to this issue.
> It has been pushed to "master":
> 
> https://git.libreoffice.org/core/commit/
> 7aca867aa1e1e675c0a9d27d76bd069bc6d5f512
> 
> tdf#156306 sw: PDF export: refactor, split out BeginTagImpl()
> 
> 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.

I have succesfully tested export of tagged PDF with
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 410632ac4b8a280e0993e665ffa9cfede8326b49
CPU threads: 4; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: threaded

LO didn't hang at tagged PDF export and the document was succesfully exported.
Comment 19 Michael Stahl (allotropia) 2023-09-14 11:04:05 UTC
(In reply to Stefan_Lange_KA@T-Online.de from comment #17)
> Seems there are several patches needed to fix the problem completely.
> Are there special aspects I have to watch in the tests except LO works and
> doesn't hang and the exported documents can be opened by Acrobat Reader?

the 2nd commit was for the same problem with a different element related to table-of-content which i found with fdo51792-1.odt (tdf bug 51792 1st attachment).

3rd commit just moves things around to its own function to be used in these cases so it's more obvious and hopefully the next time somebody adds something similar they will notice ahead of time.
Comment 20 Commit Notification 2023-09-26 11:36:29 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/00f757bc039a057e6418dcee9be5582185871eb5

tdf#156306 sw: PDF export: another implicit structure element

It will be available in 7.6.3.

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 21 Commit Notification 2023-09-26 19:13:46 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/8c94442fab9588dd0793a1792979f50a600c4c65

tdf#156306 sw: PDF export: refactor, split out BeginTagImpl()

It will be available in 7.6.3.

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 22 Stefan_Lange_KA@T-Online.de 2023-09-27 20:03:53 UTC
Test with
Version: 7.6.3.0.0+ (X86_64) / LibreOffice Community
Build ID: 033e37b49b5712df19dbfd2c307a102bce620de1
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: CL threaded
was succesful: Document was correctly exported to a tagged PDF without hangig resp. running in a loop and the exported pdf document is opened correctly by Acrobat Reader.
Comment 23 Stéphane Guillou (stragu) 2023-10-05 12:34:57 UTC
*** Bug 157607 has been marked as a duplicate of this bug. ***