Bug 157299 - Calc crashes when accessing cells containing a sumif formula with NVDA
Summary: Calc crashes when accessing cells containing a sumif formula with NVDA
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.5.6.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Michael Weghorn
URL:
Whiteboard: target:24.2.0 target:7.6.3
Keywords: accessibility
Depends on:
Blocks: a11y, Accessibility
  Show dependency treegraph
 
Reported: 2023-09-18 06:51 UTC by Luca
Modified: 2023-10-08 04:39 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample spreadsheet to demonstrate the bug (5.13 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2023-09-18 19:43 UTC, Luca
Details
Backtrace while LO is hanging on Windows with NVDA (10.16 KB, text/plain)
2023-09-26 08:59 UTC, Michael Weghorn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luca 2023-09-18 06:51:35 UTC
Moving the focus to a cell containing a sumif formula causes Calc to freeze and then crash if the screen reader NVDA is working. This does not happen if the screen reader is off. I tested it with different formula arguments, but it looks like the presence of the sumif statement is sufficient for the app to crash. Both the English and localized versions of the sumif statement produce the same effect. Could not test with other assistive technology.
Comment 1 Xisco Faulí 2023-09-18 09:24:16 UTC
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. 
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided.
(Please note that the attachment will be public, remove any sensitive information before attaching it. 
See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)
Comment 2 Luca 2023-09-18 19:43:56 UTC
Created attachment 189675 [details]
Sample spreadsheet to demonstrate the bug

Moving to cell E1 while NVDA is running causes Calc to crash.
Comment 3 Luca 2023-09-18 19:46:56 UTC
Moving to cell E1 while NVDA is running causes Calc to crash. I used the localised version of the sumif statement, that is "somma.se".
Comment 4 Michael Weghorn 2023-09-18 22:12:05 UTC
Reproducible with both, NVDA on Windows and Orca w/ the qt6 VCL plugin on Linux.

I didn't wait until the actual crash happens, but have observed LO hanging for several minutes and RAM usage constantly increasing (> 10 GB on Windows at the point I killed the process), so the crash might happen when running out of memory.

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 6f60670877208612b5ea320b3677480ef6508abb
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (en_DE); UI: en-US
Calc: threaded

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: f17e80ff958852da4139c3fb30626266698d5ea0
CPU threads: 12; OS: Linux 6.4; UI render: default; VCL: qt6 (cairo+xcb)
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded



NOT reproducible when using the gtk3 VCL plugin instead with Orca.

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: f17e80ff958852da4139c3fb30626266698d5ea0
CPU threads: 12; OS: Linux 6.4; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded
Comment 5 Michael Weghorn 2023-09-26 08:59:46 UTC
Created attachment 189826 [details]
Backtrace while LO is hanging on Windows with NVDA

The hang is caused by trying to set CONTROLLED_BY relations for the cells that the SUMIF formula references. Since this is a whole column, those are more than a million cells, and creating a11y objects for all of them takes a lot of time and RAM.

Pending Gerrit change to avoid that:
https://gerrit.libreoffice.org/c/core/+/157265
Comment 6 Commit Notification 2023-09-26 10:06:10 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

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

tdf#157299 sc a11y: Limit amount of reported cell relations

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 7 Michael Weghorn 2023-09-26 10:07:48 UTC
Fixed in master, backport for 7-6 pending in Gerrit:
https://gerrit.libreoffice.org/c/core/+/157225
Comment 8 Luca 2023-09-26 11:10:56 UTC
Thank you guys, very well done.
Comment 9 Commit Notification 2023-10-08 04:39:44 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

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

tdf#157299 sc a11y: Limit amount of reported cell relations

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.