Bug 155149

Summary: Crash when exiting cell edit mode in Calc (Tab, Enter or click out)
Product: LibreOffice Reporter: Stéphane Guillou (stragu) <stephane.guillou>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: VERIFIED FIXED    
Severity: critical CC: noelgrandin, serval2412, telesto, xiscofauli
Priority: highest Keywords: bibisected, bisected, haveBacktrace, regression
Version: 7.6.0.0 alpha0+   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=156683
Whiteboard: target:7.6.0
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 103182, 133092    
Attachments: gdb backtrace with debug build of LO 7.6
bt with debug symbols

Description Stéphane Guillou (stragu) 2023-05-04 14:51:28 UTC
Crash when pressing Tab or Enter or clicking out after editing cell contents.

In terminal:

terminate called after throwing an instance of 'com::sun::star::uno::RuntimeException'

In:

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

Bibisected with linux-64-7.6 repo to first bad commit which points to core commit:

commit 2dc240a82646fc23c673a6fd5a29ade934dd5b67
author	Noel Grandin <noel.grandin@collabora.co.uk>	Tue May 02 14:47:43 2023 +0200
committer	Noel Grandin <noel.grandin@collabora.co.uk>	Tue May 02 18:58:18 2023 +0200
improve AccessibleEventNotifier::addEvent
we use the OInterfaceContainerHelper4 notifyEach function to avoid
copying a vector of listeners
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151290

Noel, can you please have a look?
Comment 1 Stéphane Guillou (stragu) 2023-05-04 14:55:35 UTC
(In reply to Stéphane Guillou (stragu) from comment #0)
> Bibisected with linux-64-7.6 repo to first bad commit which points to core
> commit:

Commit in bisect repo is fbcd21287669e2c0a4fa7dd9934e7a76a04bcb8c.

kf5, qt5 and gen VCLs not affected.
Comment 2 Stéphane Guillou (stragu) 2023-05-04 15:22:21 UTC
Created attachment 187084 [details]
gdb backtrace with debug build of LO 7.6

Backtrace using debug build:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 83b1f6b58a30bdb589e9ce73deef39f021aebde1
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 3 Julien Nabet 2023-05-04 18:32:23 UTC
Created attachment 187090 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated today, I had an assertion.
Comment 4 Xisco Faulí 2023-05-05 09:01:54 UTC
Another way to reproduce it:
1. Open calc
2. Double click on any cell to go into edit mode
3. Close LibreOffice

-> Crash
Comment 5 Noel Grandin 2023-05-05 10:13:57 UTC
fix in progress at https://gerrit.libreoffice.org/c/core/+/151419
Comment 6 Commit Notification 2023-05-05 12:40:38 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2361718a34ee4ef47901846cb35eea4552bca46b

tdf#155149 Crash when exiting cell edit mode

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 7 Julien Nabet 2023-05-05 13:01:38 UTC
On pc Debian x86-64 with master sources updated today, including Noel's patch, I don't reproduce the assertion anymore.
I've just got:
warn:vcl:84555:84555:vcl/unx/gtk3/a11y/atklistener.cxx:209: index hint out of range, ignoring
warn:vcl:84555:84555:vcl/unx/gtk3/a11y/atklistener.cxx:209: index hint out of range, ignoring
warn:vcl:84555:84555:vcl/unx/gtk3/a11y/atklistener.cxx:209: index hint out of range, ignoring
but it's another story.
Thank you Noel for the quick fix!