Bug 157182 - Crashes when exporting a certain presentation as PDF in Archival format PDF/A-1b
Summary: Crashes when exporting a certain presentation as PDF in Archival format PDF/A-1b
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: All All
: medium critical
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:24.2.0 target:7.6.3
Keywords: bibisected, bisected, filter:pdf, haveBacktrace, regression
: 157917 (view as bug list)
Depends on:
Blocks: PDF-Export
  Show dependency treegraph
 
Reported: 2023-09-11 11:06 UTC by Mike Taylor
Modified: 2023-10-26 08:44 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
The PPTX presentation that causes the crash when exported as PDF (12.55 MB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2023-09-11 15:14 UTC, Mike Taylor
Details
PDF export options in LibreOffice 7.6.0.3 (1.33 MB, image/png)
2023-09-11 15:20 UTC, Mike Taylor
Details
PDF export options in LibreOffice 7.5.6.2 (1.28 MB, image/png)
2023-09-11 15:21 UTC, Mike Taylor
Details
Difference between PDF export options dialogues (1011.51 KB, image/png)
2023-09-11 15:24 UTC, Mike Taylor
Details
Apport's extracted ThreadStacktrace on Ubuntu 20.04 with LO 7.6.1.1 (17.74 KB, text/plain)
2023-09-11 16:12 UTC, Stéphane Guillou (stragu)
Details
Difference between PDF export options dialogues (REVERSED) (1.01 MB, image/png)
2023-09-11 16:16 UTC, Mike Taylor
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Taylor 2023-09-11 11:06:01 UTC
Description:
I created a presentation in PPTX format using LibreOffice 7.6.0.3. That presentation can be downloaded from http://www.miketaylor.org.uk/dino/pubs/svpca2023/TaylorEtAl2023-untold-diplodocus.pptx

LibreOffice consistently crashes when I try to export it as a PDF, about 40% of the way through the process (if the progress bar is to be trusted). This happens whether I do Export as PDF or Export Directly as PDF, and happens reliably.

LibreOffie 7.5.x works OK, exporting the PDF correctly.

LibreOffice 7.6.x crashes when exporting my presentation as PDF

Steps to Reproduce:
1. Download http://www.miketaylor.org.uk/dino/pubs/svpca2023/TaylorEtAl2023-untold-diplodocus.pptx
2. Open it in LibreOffice 7.6.0.3
3. File -> Export As -> Export Directly as PDF
4. Choose any output directory and filename, and click Save

Actual Results:
The export begins, the progress bar makes it about 40% of the way across the screen, and then LibreOffice crashes. No output file is created, although an empty file with a name like "lu547715mbq7j.tmp" is left behind.

Expected Results:
PDF exported.


Reproducible: Always


User Profile Reset: No

Additional Info:
It's impossble to copy the text from a Mac's about box, but here's a screencap:
http://www.miketaylor.org.uk/tmp/about-libreoffice.png
Comment 1 Mike Taylor 2023-09-11 11:11:00 UTC
I now find that if I restart in Safe Mode, I am able to export the document.
Comment 2 Stéphane Guillou (stragu) 2023-09-11 11:38:39 UTC
No crash for me in:

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

It would be interesting to see how your PDF export settings differ between safe mode and normal mode, in File > Export as > PDF. Can you please compare?

(In reply to Mike Taylor from comment #0)
> It's impossble to copy the text from a Mac's about box

Even with the Copy button next to "version information"?
Comment 3 Stéphane Guillou (stragu) 2023-09-11 11:40:11 UTC
(and please attach the file here if you are OK with sharing it like that)
Comment 4 Mike Taylor 2023-09-11 15:12:18 UTC
> Even with the Copy button next to "version information"?

Haha, how stupid of me! (To be fair, it's not exactly obvious.)

Here is the information:

--

Version: 7.6.0.3 (X86_64) / LibreOffice Community
Build ID: 69edd8b8ebc41d00b4de3915dc82f8f0fc3b6265
CPU threads: 8; OS: Mac OS X 12.6.8; UI render: Skia/Raster; VCL: osx
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded
Comment 5 Mike Taylor 2023-09-11 15:14:06 UTC
Created attachment 189493 [details]
The PPTX presentation that causes the crash when exported as PDF

Attached as requested by Stéphane Guillou in comment #3.
Comment 6 Mike Taylor 2023-09-11 15:20:03 UTC
Running File -> Export as -> Export as PDF ...

As far as I can see, the options are identical in both versions. I am attaching two screenshots, named according to the LibreOffice version that produced them.
Comment 7 Mike Taylor 2023-09-11 15:20:45 UTC
Created attachment 189494 [details]
PDF export options in LibreOffice 7.6.0.3
Comment 8 Mike Taylor 2023-09-11 15:21:13 UTC
Created attachment 189495 [details]
PDF export options in LibreOffice 7.5.6.2
Comment 9 Mike Taylor 2023-09-11 15:24:27 UTC
Created attachment 189496 [details]
Difference between PDF export options dialogues

I added another attachment showing the differences between the two versions' Export PDF dialogues. As you can see, there are no substantive differences — just a lot of places where the render puts things one or two pixels away from where they are in the other version.
Comment 10 Stéphane Guillou (stragu) 2023-09-11 16:10:58 UTC
Thanks for the extra info.

(In reply to Mike Taylor from comment #9)
> Created attachment 189496 [details]
> Difference between PDF export options dialogues
I think there's an issue with your screenshot here.

(In reply to Mike Taylor from comment #4)
> > Even with the Copy button next to "version information"?
> 
> Haha, how stupid of me! (To be fair, it's not exactly obvious.)
You're not the first one to miss it, not stupid at all :)

(In reply to Mike Taylor from comment #7)
> Created attachment 189494 [details]
> PDF export options in LibreOffice 7.6.0.3

I can reproduce with those settings, it crashes after trying for a few seconds.

The only difference with my original settings is that you are using "Archival" with version "PDF/A-1b".
PDF/A-2b and PDF/A-3b work fine.

No crash reporter, but I've got an Apport backtrace.

Recent master build also crashes:

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

Up to 7.5, a dialog reports export "problem(s)" about transparencies being removed, but PDF export is successful, no crash -> Regression.
Comment 11 Stéphane Guillou (stragu) 2023-09-11 16:12:39 UTC
Created attachment 189497 [details]
Apport's extracted ThreadStacktrace on Ubuntu 20.04 with LO 7.6.1.1
Comment 12 Mike Taylor 2023-09-11 16:16:42 UTC
Created attachment 189498 [details]
Difference between PDF export options dialogues (REVERSED)

Colour values inverted from the earlier diff image.
Comment 13 Mike Taylor 2023-09-11 16:19:56 UTC
(In reply to Stéphane Guillou (stragu) from comment #10)
> (In reply to Mike Taylor from comment #9)
> > Created attachment 189496 [details]
> > Difference between PDF export options dialogues
> I think there's an issue with your screenshot here.

Nope, that's how it's supposed to look :-) I just superimposed the screenshots in GIMP and set the top layer's mode to Difference, so you get black where they're identical.

I've attached a reversed version where the unchanged areas are white. I admit it's easier to read, but of course it makes exactly the same point.

> (In reply to Mike Taylor from comment #7)
> > Created attachment 189494 [details]
> > PDF export options in LibreOffice 7.6.0.3
> 
> I can reproduce with those settings, it crashes after trying for a few
> seconds.

That is great news!

> The only difference with my original settings is that you are using
> "Archival" with version "PDF/A-1b".
> PDF/A-2b and PDF/A-3b work fine.

All right, this is really good to know! I have verified that PDF/A-2b export works for me. So we seem to have nailed it down.
 
> No crash reporter, but I've got an Apport backtrace.
> 
> Recent master build also crashes:
> 
> Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
> Build ID: 10689e0f24e96781664e734fe23d109af6df77f1
> CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
> Locale: en-AU (en_AU.UTF-8); UI: en-US
> Calc: threaded
> 
> Up to 7.5, a dialog reports export "problem(s)" about transparencies being
> removed, but PDF export is successful, no crash -> Regression.

Great that you're on this!
Comment 14 Stéphane Guillou (stragu) 2023-09-11 17:16:18 UTC
(In reply to Mike Taylor from comment #13)
> Nope, that's how it's supposed to look :-) I just superimposed the
> screenshots in GIMP and set the top layer's mode to Difference, so you get
> black where they're identical.

Oh I didn't realise it was a mix of the two screenshots! Good trick when there's a million settings on the page...

I bibisected the issues with the linux-64-7.6 bibisect repo to the first bad commit e92b5659ead214010ce05bc86554b00675957acd which points to core commit 4bebff384b986c48af2b7f157cc27e956acceab6 which is a cherrypick of:

commit 07d790ca473cd6e71f0343419b819fa6b485dc01
author	Michael Stahl Wed Jul 12 15:26:25 2023 +0200
committer	Michael Stahl 	Fri Jul 14 14:56:24 2023 +0200
tdf#154982 vcl: PDF Export: split BeginStructureElement
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154357

Michael, can you please have a look?
Comment 15 Commit Notification 2023-10-10 14:33:23 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

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

tdf#157182 vcl,filter: PDF/A export: fix crash due to SE ID mismatch

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 Michael Stahl (allotropia) 2023-10-10 14:44:42 UTC
fixed on master
Comment 17 Commit Notification 2023-10-10 19:32:49 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/2865050bf82c717ea403bf7635bf4072b1876f41

tdf#157182 vcl,filter: PDF/A export: fix crash due to SE ID mismatch

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 18 Stéphane Guillou (stragu) 2023-10-25 13:03:43 UTC
*** Bug 157917 has been marked as a duplicate of this bug. ***
Comment 19 Alex Thurgood 2023-10-26 08:40:11 UTC
I can verify that this is fixed on master, but I still see a ton load of warnings in a LLDB debug session on macOS, relating to the destructured nature of the PDF. Presumably, this is what is expected ?

Sample of warnings from LLDB session below:
warn:vcl.gdi:11759:183085:vcl/source/outdev/stack.cxx:101: OutputDevice::Pop() without OutputDevice::Push()

warn:vcl.pdfwriter:11759:183085:vcl/source/gdi/pdfwriter_impl.cxx:8477: invalid conversion
x14

and then again :

warn:vcl.gdi:11759:183085:vcl/source/outdev/stack.cxx:101: OutputDevice::Pop() without OutputDevice::Push()

warn:vcl.pdfwriter:11759:183085:vcl/source/gdi/pdfwriter_impl.cxx:8477: invalid conversion
x22

warn:legacy.osl:11759:183085:vcl/source/gdi/pdfwriter_impl.cxx:10842: document structure in disorder !
x60

warn:vcl.gdi:11759:183085:vcl/source/outdev/stack.cxx:101: OutputDevice::Pop() without OutputDevice::Push()

warn:vcl.pdfwriter:11759:183085:vcl/source/gdi/pdfwriter_impl.cxx:8477: invalid conversion
x7


warn:legacy.osl:11759:183085:vcl/source/gdi/pdfwriter_impl.cxx:10842: document structure in disorder !
x84


Note that the PDF gets created and there's no crash, hence verified fixed.
Comment 20 Mike Taylor 2023-10-26 08:44:40 UTC
> I can verify that this is fixed on master.

Great news! Does that mean it will be in v7.6.3?