Bug 154546 - Crash when using presentation mode on macOS
Summary: Crash when using presentation mode on macOS
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
7.5.2.2 release
Hardware: All macOS (All)
: medium critical
Assignee: Patrick Luby (volunteer)
URL:
Whiteboard: target:7.6.0 target:7.5.3.2 target:7....
Keywords:
Depends on:
Blocks: Presenter-Console
  Show dependency treegraph
 
Reported: 2023-04-01 19:26 UTC by eisa01
Modified: 2023-05-03 10:13 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample of LibreOffice nightly build when Document Recovery dialog appears (239.14 KB, text/plain)
2023-04-14 14:47 UTC, Patrick Luby (volunteer)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description eisa01 2023-04-01 19:26:17 UTC
Open an Impress document (my test case had four slides)
Start slide show from first slide
Presenter view is on main screen, and slide show on secondary screen
Click exchange monitor
Watch the views switch position
Click in the slide show on the main screen
Libreoffice aborts and show document recovery screen

It is not fully consistent, and LO seems to remember what is your main screen
However resetting it to the setup described above trigger the crash again

Albeit it did also end up crashing as I clicked around and pressed exit.. Probably the same bug

No crashlog since none appear

After Libreoffice "restart" there's no menu bar any more

Version: 7.5.2.2 (AARCH64) / LibreOffice Community
Build ID: 53bb9681a964705cf672590721dbc85eb4d0c3a2
CPU threads: 10; OS: Mac OS X 13.3; UI render: default; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Alex Thurgood 2023-04-02 11:54:08 UTC
@eisa this requires a non-mirrored monitor setup, correct?
Comment 2 eisa01 2023-04-02 11:57:02 UTC
Yes, I'd assume so
Comment 3 steve 2023-04-03 09:48:08 UTC
Confirmed. Clicking exchange icon in presentation mode does close LibreOffice and show file recovery dialog.
Comment 4 Stéphane Guillou (stragu) 2023-04-03 12:36:05 UTC
eisa or steve, any chance you can test older versions to see if it is a regression, and provide a backtrace? https://wiki.documentfoundation.org/QA/BugReport/Debug_Information#macOS
Comment 5 Alex Thurgood 2023-04-03 15:57:29 UTC
I can't reproduce this with :

Version: 7.6.0.0.alpha0+ (AARCH64) / LibreOffice Community
Build ID: 4ca4282517d02592966576fc642048b3d5ae5532
CPU threads: 8; OS: Mac OS X 13.3; UI render: Skia/Metal; VCL: osx
Locale: fr-FR (fr_FR.UTF-8); UI: en-US
Calc: threaded

using the "screen sharing functionality oover the air" on macOS to have a projected screen from the MacbookPro onto a Macmini output display monitor. The presenter console is on one monitor, and the slideshow on another. With such a setup I can click on "exchange screens" and no crash occurs.

I also can't reproduce the buggy behaviour if I switch the Copy External Display function off in the macOS system settings and then use my external Apple 27" monitor to display the slideshow and have the presenter console on the Macbook Pro and switch between screens with the Switch Screen function of the presenter console.

Is there something else I need to be doing, or some other setting I'm missing ? Does the monitor switching involve any up/down-scaling due to different supported resolutions between each screen ?
Comment 6 steve 2023-04-03 16:32:11 UTC
I reproduced with an external 4k monitor connected via USB-C to a MacBook Pro Intel. Switch to recovery dialog happened on first attempt to exchange monitor (wouldn't "switch" be a better wording?).
Comment 7 Alex Thurgood 2023-04-03 16:40:07 UTC
(In reply to steve from comment #6)
> I reproduced with an external 4k monitor connected via USB-C to a MacBook
> Pro Intel. Switch to recovery dialog happened on first attempt to exchange
> monitor (wouldn't "switch" be a better wording?).

IMO "toggle" would be even better.
Comment 8 Patrick Luby (volunteer) 2023-04-14 14:47:35 UTC
Created attachment 186667 [details]
Sample of LibreOffice nightly build when Document Recovery dialog appears

I was able to reproduce the crash with a non-4K monitor plugged in via HDMI. Clicked the "exchange" button in the presenter view a couple of times and then the Document Recovery dialog appears.

So, I took a sample using the Activity Monitor app while the Document Recovery dialog was visible but before clicking any of the dialog's buttons. The sample is as good as a crash log and you can see where the crash is occurring in the line above the _sigtramp line:

sdext::presenter::PresenterProtocolHandler::Dispatch::Dispatch(rtl::OUString const&, rtl::Reference<sdext::presenter::PresenterController> const&)  (in libsduilo.dylib) + 3104  [0x2de502ce0]

So, this looks like a bug in the following Impress source code file:

sd/source/console/PresenterProtocolHandler.cxx

Just for completeness, here is the About dialog info:

Version: 7.6.0.0.alpha0+ (AARCH64) / LibreOffice Community
Build ID: 127eacf630e1712fd5addcabed404b2d33752311
CPU threads: 8; OS: Mac OS X 12.6.3; UI render: default; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 9 Patrick Luby (volunteer) 2023-04-16 14:16:46 UTC
(In reply to Patrick Luby from comment #8)
> sdext::presenter::PresenterProtocolHandler::Dispatch::Dispatch(rtl::OUString
> const&, rtl::Reference<sdext::presenter::PresenterController> const&)  (in
> libsduilo.dylib) + 3104  [0x2de502ce0]
> 

I have created a patch that appears to stop the crashing for me:

https://gerrit.libreoffice.org/c/core/+/150456

I know nothing about the Impress code so I just added a nullptr check in a place that seems safe to do so. But I really don't understand why mpPresenterController would ever not be set.

I would really like someone familiar with the Impress code to review my patch before committing it.
Comment 10 Commit Notification 2023-04-21 17:08:24 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "master":

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

tdf#154546 skip dispatch when presenter controller is not set

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 Commit Notification 2023-04-22 08:22:44 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/14c4b0d11211cc27fb3a0cae246d8e971d6d8f9a

tdf#154546 skip dispatch when presenter controller is not set

It will be available in 7.5.4.

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 steve 2023-04-22 19:33:56 UTC
verified in Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 35787e07b7e83f7dcaa0c67830fcb4eded49c71f
CPU threads: 8; OS: Mac OS X 13.3.1; UI render: Skia/Metal; VCL: osx
Locale: en-US (en_DE.UTF-8); UI: en-US
Calc: threaded

Thanks Patrick - setting to verified, if you are planning to add more patches, please revert back to assigned.
Comment 13 Commit Notification 2023-04-24 08:12:05 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "libreoffice-7-5-3":

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

tdf#154546 skip dispatch when presenter controller is not set

It will be available in 7.5.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 14 Commit Notification 2023-04-24 10:25:24 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

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

tdf#154546 skip dispatch when presenter controller is not set

It will be available in 7.4.8.

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-05-03 10:13:22 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "libreoffice-7-4-7":

https://git.libreoffice.org/core/commit/807710d6cffe1a2b40a8937c0df43a8ac1034120

tdf#154546 skip dispatch when presenter controller is not set

It will be available in 7.4.7.

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.