Bug 154927 - Crash when a11y toolbar is visible and try to insert a math object
Summary: Crash when a11y toolbar is visible and try to insert a math object
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All All
: medium critical
Assignee: Julien Nabet
URL:
Whiteboard: target:7.6.0
Keywords: accessibility, bibisected, bisected, haveBacktrace
Depends on:
Blocks: Formula Accessibility-Check
  Show dependency treegraph
 
Reported: 2023-04-20 09:29 UTC by Gabor Kelemen (allotropia)
Modified: 2023-05-15 17:52 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
bt with debug symbols (4.30 KB, text/plain)
2023-04-20 10:41 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2023-04-20 09:29:49 UTC
1. In Writer with an empty document show the new accessibility sidebar
2. Insert - OLE Object - Formula object
-> The Formula side bar becomes visible for a moment replacing the a11y sidebar, then Writer crashes.

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 1e273de12710eabf908495d341311da93701868f
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: hu-HU (hu_HU.UTF-8); UI: en-US
Calc: default

Started with:
https://git.libreoffice.org/core/+/403ea882af35337431e0f67aa973c5f046deb630

tdf#142978 Add a11y check sidebar
Comment 1 Stéphane Guillou (stragu) 2023-04-20 09:56:25 UTC
Thanks, Gabor. Reproduced in:

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

Same with gen VCL.
Comment 2 Julien Nabet 2023-04-20 10:41:07 UTC
Created attachment 186810 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated today, I could reproduce this.

Quick and perhaps naive fix would be:
diff --git a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx
index 9392bad44ed3..f5673e24c058 100644
--- a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx
+++ b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx
@@ -116,7 +116,7 @@ void A11yCheckIssuesPanel::populateIssues()
 void A11yCheckIssuesPanel::NotifyItemUpdate(const sal_uInt16 nSid, const SfxItemState /* eState */,
                                             const SfxPoolItem* pState)
 {
-    if (!m_xAccessibilityCheckBox) //disposed
+    if (!m_xAccessibilityCheckBox || !pState) //disposed
         return;
 
     switch (nSid)
Comment 3 Samuel Mehrbrodt (allotropia) 2023-05-15 13:24:35 UTC
(In reply to Julien Nabet from comment #2)
> Created attachment 186810 [details]
> bt with debug symbols
> 
> On pc Debian x86-64 with master sources updated today, I could reproduce
> this.
> 
> Quick and perhaps naive fix would be:
> diff --git a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx
> b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx
> index 9392bad44ed3..f5673e24c058 100644
> --- a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx
> +++ b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx
> @@ -116,7 +116,7 @@ void A11yCheckIssuesPanel::populateIssues()
>  void A11yCheckIssuesPanel::NotifyItemUpdate(const sal_uInt16 nSid, const
> SfxItemState /* eState */,
>                                              const SfxPoolItem* pState)
>  {
> -    if (!m_xAccessibilityCheckBox) //disposed
> +    if (!m_xAccessibilityCheckBox || !pState) //disposed
>          return;
>  
>      switch (nSid)

Please go ahead with this fix!
Comment 4 Julien Nabet 2023-05-15 15:40:37 UTC
(In reply to Samuel Mehrbrodt (allotropia) from comment #3)
> ...
> Please go ahead with this fix!

Thank you for the feedback, done here:
https://gerrit.libreoffice.org/c/core/+/151802
Comment 5 Commit Notification 2023-05-15 17:51:38 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2c6e275120fd557ece84267deaa1019f347c0b82

tdf#154927: Crash when a11y toolbar is visible and try to insert a math object

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.