Bug 158379 - Crash when trying to print specific RTF file (macOS)
Summary: Crash when trying to print specific RTF file (macOS)
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All macOS (All)
: high critical
Assignee: Patrick (volunteer)
URL:
Whiteboard: target:24.8.0 target:7.6.5 target:24....
Keywords: bibisected, bisected, regression
: 158385 158990 (view as bug list)
Depends on:
Blocks: Print Crash
  Show dependency treegraph
 
Reported: 2023-11-26 17:31 UTC by seinfeld@jsli.org
Modified: 2024-01-02 20:59 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
file that crashes when trying to print (334.86 KB, text/rtf)
2023-11-27 15:49 UTC, seinfeld@jsli.org
Details
macOS 13.2 system log (25.91 KB, text/plain)
2023-12-06 14:22 UTC, Stéphane Guillou (stragu)
Details
Activity Monitor sample of LibreOffice when Document Recovery dialog displays (136.91 KB, text/plain)
2023-12-08 19:33 UTC, Patrick (volunteer)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description seinfeld@jsli.org 2023-11-26 17:31:26 UTC
Crashing when trying to print a doc with text boxes. Does not crash for other docs. Tried resetting user profile, it's a consistent crash.
Comment 1 Stéphane Guillou (stragu) 2023-11-27 06:33:35 UTC
No crash for me with a file with one text box with a border, and:

Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 2; OS: Mac OS X 13.2.1; UI render: Skia/Raster; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Can you please:
- share a file that we can test with?
- try updating to version 7.6.3, recently released
- share the full information from LibreOffice > About
- do you get a crash backtrace you could share?
- if the crash persists, please try with a new user profile: https://wiki.documentfoundation.org/UserProfile
Comment 2 Julien Nabet 2023-11-27 09:31:32 UTC
*** Bug 158385 has been marked as a duplicate of this bug. ***
Comment 3 seinfeld@jsli.org 2023-11-27 15:49:14 UTC
Created attachment 191065 [details]
file that crashes when trying to print
Comment 4 seinfeld@jsli.org 2023-11-27 15:50:27 UTC
Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 6; OS: Mac OS X 13.4.1; UI render: Skia/Metal; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 5 seinfeld@jsli.org 2023-11-27 15:51:35 UTC
When I select "check for updates" I get, "Libre Office is up to date."
Comment 6 Stéphane Guillou (stragu) 2023-11-27 17:50:43 UTC
Can't reproduce on Linux:

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

But I can on macOS:

Version: 7.6.3.2 (X86_64) / LibreOffice Community
Build ID: 29d686fea9f6705b262d369fede658f824154cc0
CPU threads: 2; OS: Mac OS X 13.2.1; UI render: Skia/Raster; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Crashes as soon as I try to open the print dialog.

Not reproduced in 7.5.4:

Version: 7.5.4.2 (X86_64) / LibreOffice Community
Build ID: 36ccfdc35048b057fd9854c757a8b67ec53977b6
CPU threads: 2; OS: Mac OS X 13.2.1; UI render: default; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

-> regression.
Comment 7 kdub 2023-12-05 18:34:23 UTC
Following up on what Stéphane mentioned in the previous comment, I was not able to replicate this bug in Linux, but I was able to replicate and find the commit that caused this bug in macOS.

I used the mac64-7.6 bibisect repository (https://bibisect.libreoffice.org/mac64-7.6), and here is more information on the commit (https://git.libreoffice.org/core/commit/6028e9fda96d0ed5da266b1c54a7755f7ba3408c).

Adding CC: Stephan Bergmann.
Comment 8 Stephan Bergmann 2023-12-06 12:33:36 UTC
(In reply to Stéphane Guillou (stragu) from comment #6)
> Version: 7.6.3.2 (X86_64) / LibreOffice Community
> Build ID: 29d686fea9f6705b262d369fede658f824154cc0
> CPU threads: 2; OS: Mac OS X 13.2.1; UI render: Skia/Raster; VCL: osx
> Locale: en-US (en_US.UTF-8); UI: en-US
> Calc: threaded
> 
> Crashes as soon as I try to open the print dialog.

I can not reproduce the issue on my M1 Mac (maybe because I don't have any physical printers available to it), not even with the exact same (X86_64) LO version as above:  With the "Book-box-4x6bLakewood copy.rtf" from attachment 191065 [details] open in Writer, "File - Print..." opens a Print dialog fine and does not crash for me.

Do you have a backtrace?
Comment 9 Stéphane Guillou (stragu) 2023-12-06 14:22:29 UTC
Created attachment 191273 [details]
macOS 13.2 system log

(In reply to Stephan Bergmann from comment #8)
> Do you have a backtrace?
No crash report gets generated.
Attached is a system log around the crash (at about 15:04:40).
Now updating macOS Ventura from 13.2.1 to 13.6.1 to see if it helps.

(In reply to kdub from comment #7)
> [...] I was able to replicate and find
> the commit that caused this bug in macOS.
Which macOS version are you using?
Can you please paste here the full version info from LibreOffice > About LibreOffice?
Comment 10 seinfeld@jsli.org 2023-12-06 16:32:10 UTC
Mac OS Version 13.4.1 (c) (22F770820d)

Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 6; OS: Mac OS X 13.4.1; UI render: Skia/Metal; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 11 kdub 2023-12-06 21:18:27 UTC
Hey Stephan and Stéphane (replying to comment #8 and comment #9),

I am on an Intel Mac and my OS is 14.1.2 (Sonoma). 

Down below you will find two information dumps. The first being the first version in the committed history that causes this issue for me that I mention in my previous comment #7. The second information is coming from the latest release version that also has this bug. I hope this helps!

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 6028e9fda96d0ed5da266b1c54a7755f7ba3408c
CPU threads: 12; OS: Mac OS X 14.1.2; UI render: Skia/Raster; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Version: 7.6.3.2 (X86_64) / LibreOffice Community
Build ID: 29d686fea9f6705b262d369fede658f824154cc0
CPU threads: 12; OS: Mac OS X 14.1.2; UI render: Skia/Metal; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 12 Stephan Bergmann 2023-12-07 16:27:41 UTC
(In reply to Stéphane Guillou (stragu) from comment #9)
> Created attachment 191273 [details]
> macOS 13.2 system log
> 
> (In reply to Stephan Bergmann from comment #8)
> > Do you have a backtrace?
> No crash report gets generated.
> Attached is a system log around the crash (at about 15:04:40).

That is useless, unfortunately.  (And no idea how to get a useful backtrace on macOS, short of building LO yourself.)
Comment 13 Patrick (volunteer) 2023-12-08 19:33:02 UTC
(In reply to Stephan Bergmann from comment #12)
> That is useless, unfortunately.  (And no idea how to get a useful backtrace
> on macOS, short of building LO yourself.)

On macos, the "Document Recovery" dialog that gets shown in LibreOffice's signal handler stops macOS from generating a crash log. So, with LibreOffice, we need to be creative and get a sample of LibreOffice while the Document Recovery dialog is displayed and before clicking the OK button.

I can reproduce this bug so I will post a sample in a minute. But to spread the word on how to get a sample when LibreOffice crashes on macOS, I use the following steps:

1. In the Finder, open the /Applications/Utilities/Activity\ Monitor application
2. In the Activity Monitor window that opens, double-click on the LibreOffice or LibreOfficeDev entry
3. In the dialog that appears, click the Sample button
4. In the window that appears, click the Save button
5. Attach saved file to this bug
Comment 14 Patrick (volunteer) 2023-12-08 19:33:54 UTC
Created attachment 191320 [details]
Activity Monitor sample of LibreOffice when Document Recovery dialog displays
Comment 15 Patrick (volunteer) 2023-12-08 20:15:18 UTC
(In reply to Patrick Luby from comment #14)
> Created attachment 191320 [details]
> Activity Monitor sample of LibreOffice when Document Recovery dialog displays

The key lines in this sample are:

2533 AquaSalInfoPrinter::setPaperSize(long, long, Orientation)  (in libvclplug_osxlo.dylib) + 116  [0x11492ee74]  salprn.cxx:209
2533 PaperInfo::toPSName(Paper)  (in libi18nutil.dylib) + 76  [0x1050d2b60]  paper.cxx:404

There are a few entries with a PageDesc's m_pPSName set to a nullptr and this particular document hits the "user defined page size" entry.

I've uploaded a patch for the fix here:

https://gerrit.libreoffice.org/c/core/+/160504
Comment 16 Commit Notification 2023-12-08 23:50:16 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "master":

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

tdf#158379 check if PageDesc's m_pPSName is a nullptr

It will be available in 24.8.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 17 Patrick (volunteer) 2023-12-09 14:42:24 UTC
The fix is now in today's (09 December 2023) nightly master builds:

https://dev-builds.libreoffice.org/daily/master/current.html

Note for testers: the nightly master builds install in /Applications/LibreOfficeDev.app. These builds are not codesigned like regular LibreOffice releases so you will need to execute the following Terminal command after installation:

xattr -d com.apple.quarantine /Applications/LibreOfficeDev.app
Comment 18 Commit Notification 2023-12-11 13:04:55 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

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

tdf#158379 check if PageDesc's m_pPSName is a nullptr

It will be available in 7.6.5.

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 19 Commit Notification 2023-12-11 13:04:59 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/910dc29435395f9fd9c3019c1d3c59a0dcea2474

tdf#158379 check if PageDesc's m_pPSName is a nullptr

It will be available in 24.2.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.
Comment 20 kdub 2023-12-20 18:07:49 UTC
Hi all,

I can confirm that this bug is no longer present in this daily build:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 78e72be805e9b41617d752e0da8c04b7bf5dd269
CPU threads: 12; OS: macOS 14.2.1; UI render: Skia/Raster; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 21 Stéphane Guillou (stragu) 2023-12-21 14:53:44 UTC
Thank you Patrick and kdub! Marking as "verified" then.
Comment 22 Stéphane Guillou (stragu) 2024-01-02 20:59:07 UTC
*** Bug 158990 has been marked as a duplicate of this bug. ***