Bug 163335 - Linux (qt6): crash whenever selecting text using cursor or keyboard going from right to left
Summary: Linux (qt6): crash whenever selecting text using cursor or keyboard going fro...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.8.2.1 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Michael Weghorn
URL:
Whiteboard: target:25.8.0 target:25.2.0.3 target:...
Keywords: accessibility
Depends on:
Blocks: a11y, Accessibility Crash Qt6
  Show dependency treegraph
 
Reported: 2024-10-07 05:42 UTC by kristian.akhurst
Modified: 2025-01-23 21:00 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Backtrace from running office in debug mode (33.51 KB, text/plain)
2024-11-02 21:08 UTC, kristian.akhurst
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kristian.akhurst 2024-10-07 05:42:39 UTC
Writer: Crash whenever selecting text using cursor or keyboard going from right to left.

Operating System: CachyOS Linux 
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.3
Kernel Version: 6.11.2-5-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 16 × 11th Gen Intel® Core™ i7-11700 @ 2.50GHz
Memory: 62.7 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3080 Ti/PCIe/SSE2

Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: d9536723ce640b70ba821dfcf645a2e946c0bf76
CPU threads: 16; OS: Linux 6.11; UI render: default; VCL: kf6 (cairo+wayland)
Locale: en-AU (en_GB.UTF-8); UI: en-US
24.8.2-1.1
Calc: CL threaded

**Steps to reproduce:**

1. Open Writer
2. Write any text
3. Hold 'Shift' and use 'left arrow' to highlight backwards
4. Writer crashes.

Alt. Using mouse cursor to select text, right to left will crash Writer.

So far recovery has been perfect but the crash happens every time.

**Expected Results:** 
Writer does not crash when selecting text.
Comment 1 Julien Nabet 2024-10-07 11:28:59 UTC
On pc Debian x86-64 with master sources updated today or with LO Debian package 24.8.2.1 + kf6 rendering, I don't reproduce this.

Could you try https://wiki.documentfoundation.org/QA/FirstSteps ?
If you still reproduce the crash, would it be possible you retrieve a backtrace? (see https://wiki.documentfoundation.org/QA/BugReport/Debug_Information#GNU/Linux:_How_to_get_a_backtrace)
Comment 2 m_a_riosv 2024-10-07 20:12:42 UTC
Please test in safe mode, Menu/Help/Restart in Safe Mode
Comment 3 kristian.akhurst 2024-11-02 21:08:10 UTC
Created attachment 197359 [details]
Backtrace from running office in debug mode
Comment 4 kristian.akhurst 2024-11-02 21:12:28 UTC
Context; in debug mode writer crashes when attempting to launch from debug  enabled office launch window.

Some output from the console;

qt.accessibility.atspi: Subscription string not handled: "Window:Destroy:"
qt.accessibility.atspi: Could not find accessible on path: "/org/a11y/atspi/accessible/2147483648"
qt.accessibility.atspi: Could not find accessible on path: "/org/a11y/atspi/accessible/2147483648"
qt.accessibility.atspi: Could not find accessible on path: "/org/a11y/atspi/accessible/2147483648"
This plugin supports grabbing the mouse only for popup windows
This plugin supports grabbing the mouse only for popup windows

Possibly insinuating an accessibility setting issue?

First steps were followed before initial bug report;
- User profile appeared not to be corrupted
- Bug persisted in safe mode
- Reinstalling freshest version did not resolve the bug

Other attempts made;
- Uninstall Zotero suspecting the bridge plugin might be the issue. This did not resolve the issue.
Comment 5 QA Administrators 2024-11-03 03:16:20 UTC Comment hidden (obsolete)
Comment 6 Julien Nabet 2024-11-03 08:50:57 UTC
I didn't see anything relevant in the bt but perhaps missed it.
I must recognize I'm stuck here.
Comment 7 David 2024-11-21 22:30:28 UTC
This seems to have been fixed in version 24.8.3.
Comment 8 kristian.akhurst 2024-11-25 07:35:31 UTC
I am still experiencing this issue on 24.8.3.2

Version: 24.8.3.2 (X86_64) / LibreOffice Community
Build ID: 34c056405fc430dc0394ab15e41c1277807f8e9c
CPU threads: 16; OS: Linux 6.12; UI render: default; VCL: kf6 (cairo+wayland)
Locale: en-AU (en_GB.UTF-8); UI: en-US
24.8.3-1.1
Calc: CL threaded
Comment 9 David 2024-11-25 15:20:47 UTC
Maybe wayland or kf6 is making the difference. I'm still on kf5. 24.8.2 would crash every time, but I haven't had a single crash when selecting with 24.8.3 in the manner described.
Comment 10 Michael Weghorn 2025-01-09 15:52:21 UTC
I can reproduce, but for me, this only happens when the Orca screen reader is running (causing accessibility to be active).

Happens with both, wayland and X11.

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 4c8905a25af4585bc4077a1ab0e52e25eb398e83
CPU threads: 32; OS: Linux 6.12; UI render: default; VCL: qt6 (cairo+wayland)
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: CL threaded

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 4c8905a25af4585bc4077a1ab0e52e25eb398e83
CPU threads: 32; OS: Linux 6.12; UI render: default; VCL: qt6 (cairo+xcb)
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: CL threaded
Comment 11 kristian.akhurst 2025-01-10 00:29:58 UTC
I have Orca screen reader installed also, so I think that's a compelling reason^
Comment 12 Michael Weghorn 2025-01-10 14:32:34 UTC
(In reply to kristian.akhurst from comment #11)
> I have Orca screen reader installed also, so I think that's a compelling
> reason^

Thanks for the additional info.
To mention it: The gtk3 VCL plugin (whose use can be forced by setting the SAL_USE_VCLPLUGIN=gtk3 environment variable) currently provides the best screen reader experience on Linux.

But the crash should of course be fixed anyway. I plan to take a look.
Comment 13 Michael Weghorn 2025-01-14 11:20:38 UTC
Pending workaround to fix the crash in our Qt a11y bridge, similar to how it's done elsewhere (like for gtk3):
https://gerrit.libreoffice.org/c/core/+/180228

I intend to backport that one for release branches (LO 25.2, LO 24.8) as well.

Series of changes meant to address the underlying issue in Writer (currently intended for master only):

https://gerrit.libreoffice.org/c/core/+/180231
Comment 14 Commit Notification 2025-01-14 14:24:44 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3eaa35e8bacc19a85f5c9d907450846bfa8bffae

tdf#163335 qt a11y: Work around broken sw selection handling

It will be available in 25.8.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 15 Commit Notification 2025-01-15 09:11:14 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/65a5a4772af919e71a1fe7a752e622ec4cdba7ad

tdf#163335 sw a11y: Handle cursor selection consistently

It will be available in 25.8.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 16 Michael Weghorn 2025-01-15 09:21:07 UTC
Commits from commit 14 and 15 fix the issue I can reproduce, can you please retest with a daily build from tomorrow or later whether it fixes it for you as well?

(The backtrace in attachment 197359 [details] looks unrelated to the crash as it's in the JVM, maybe some "normal" usage of an extension using Java or so?)
Comment 17 Commit Notification 2025-01-16 19:34:05 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/96181fca120b4bd95bf71c86d3987e52e951a323

tdf#163335 qt a11y: Work around broken sw selection handling

It will be available in 24.8.5.

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 18 Commit Notification 2025-01-17 21:28:47 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/94d851b27f26ad9a97c5a8a559592d6d9ea0f37b

Revert "tdf#163335 qt a11y: Work around broken sw selection handling"

It will be available in 25.8.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 19 Commit Notification 2025-01-22 12:18:13 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

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

tdf#163335 qt a11y: Work around broken sw selection handling

It will be available in 25.2.1.

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 20 Commit Notification 2025-01-23 15:01:12 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-25-2-0":

https://git.libreoffice.org/core/commit/95e5c2ac8c0932f25e8577bb8fc2aee9ebee9a6c

tdf#163335 qt a11y: Work around broken sw selection handling

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