Bug 158169 - Crash when using multiple Views
Summary: Crash when using multiple Views
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Armin Le Grand (allotropia)
URL:
Whiteboard: target:24.2.0 target:7.6.4
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-10 16:47 UTC by Armin Le Grand (allotropia)
Modified: 2023-11-24 10:47 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Armin Le Grand (allotropia) 2023-11-10 16:47:28 UTC
To reproduce:
- New Impress
- Menu: Window/New Window
- In new View change to 'Notes' View
- In old View insert an Object (e.g. 'Ellipse')
-> Lo crashes
Comment 1 Armin Le Grand (allotropia) 2023-11-10 16:58:51 UTC
Looking into it...

Has to do with ChildrenManagerImpl: An already disposed one is used by ChildrenManagerImpl::AddShape getting called.
That ChildrenManagerImpl gets already disposed when the 2nd View gets changed to 'Notes' (by ChildrenManagerImpl::impl_dispose() getting called), but it gets not removed from the notify mechanism.
This gets triggered by SfxBaseModel::notifyEvent due to the disposed ChildrenManagerImpl being member of m_pData->m_aDocumentEventListeners1. This method already expects RuntimeException(s) and removes the listener in that case.
That shows what to do: throw lang::DisposedException() if incarnation is disposed (we have m_bDisposed from the base class comphelper::UnoImplBase to know that).
Adding this to ChildrenManagerImpl::notifyEvent solves the problem for AddShape/RemoveShape.
NOTE: More member functions of ChildrenManagerImpl may need this.
Comment 2 Commit Notification 2023-11-10 19:06:11 UTC
Armin Le Grand (allotropia) committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/23e9a4cf1eec75cdd40a695ecae2af9b952178d3

tdf#158169 take no actions in disposed incarnation

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 3 Commit Notification 2023-11-12 00:40:50 UTC
Armin Le Grand (allotropia) committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

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

tdf#158169 take no actions in disposed incarnation

It will be available in 7.6.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.