Bug 138855 - Draw crashes if I use ALT+TAB to switch between two draw windows while the cursor focus is in a text box
Summary: Draw crashes if I use ALT+TAB to switch between two draw windows while the cu...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
7.1.0.0.beta1+
Hardware: All Linux (All)
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.2.0 target:7.1.4
Keywords: haveBacktrace
Depends on:
Blocks:
 
Reported: 2020-12-12 14:25 UTC by Kevin Suo
Modified: 2021-05-06 17:31 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
gdbtrace.log (18.78 KB, text/x-log)
2020-12-12 14:25 UTC, Kevin Suo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Suo 2020-12-12 14:25:07 UTC
Created attachment 168104 [details]
gdbtrace.log

Steps to Reproduce:

1. New Draw, hit F2, type in "ABCDEFG", click somewhere else so that the cursor focus is out of the text box.
2. Click NEW icon to create a new draw window.
3. Alt+Tab to switch back to the first draw window.
4. Click within the text box, so that the cursor is somewhere between the text (i.e. between the characters, not the text box itself!). (Do not go click anywhere at this moment).
5. Alt+Tab to switch to the 2nd draw window, then Alt+Tab to switch back to the 1st window again.

--> Crash.
If you do not reproduce, then try to repeat step 4 and 5 several times (sometimes you need one round, sometimes 2 or 3 but sometimes you need 5...do remember to put cursor focus in the text box text before)

Fedora 32, Gnome 3.36.7, X11, LibreOffice master as of today and branch libreoffice-7-1.

Note:
If Alt+tab does not switch between windows, then maybe you should use other key shortcuts, or the Gnome Shell Extension "Alternate Tab", or if you are using a newer version of Gnome you may take a look at https://blogs.gnome.org/fmuellner/2018/10/11/the-future-of-alternatetab-and-why-you-need-not-worry/
Comment 1 Kassikakk 2021-01-05 12:49:01 UTC
Confirmed with Arch Linux 5.10.4, KDE Plasma 5.20.4, LibreOffice 7.0.4.2 (on 2 machines)

both in Draw and Impress (which I use more). More precisely, whenever you leave a text box activated in a Draw/Impress document (i.e. the cursor is inside a text box) then switch to any other window (or desktop), then shortly after you return to the Draw/Impress window with the text box, LO crashes. This has been around since I think about when LO 7.0 first came out.

I wonder if these things I also observe could be related:
-within a Text Box, insert anything from Insert/Special Character... After pressing OK in the Special Character dialog, the application crashes.

-within a Text Box, write some text, right-click and choose Paragraph... Adjust anything (or not), then press OK. The application crashes.

None of this happens e.g. in an Arch Linux machine with LXQt desktop, or in Windows 10. So the desktop manager seems to be important. I haven't really tried KDE Plasma with other Linux distros, but there is a report of similar things happening with Manjaro: https://forum.manjaro.org/t/libreoffice-7-0-crashes-when-switching-windows-in-kde-5-19-under-certain-circumstances/34283
Comment 2 Kevin Suo 2021-01-05 13:14:29 UTC
Set to NEW per comment 1.
Comment 3 Kassikakk 2021-01-05 14:57:48 UTC
Well, after some more research, it would appear that, at least in my case, the fcitx package (input method manager) has something to do with the crashes. Anyway, after stopping fcitx, all of the mentioned abnormalities were gone. If the OP finds a similar connection, it might at least give a different angle to the issue.
Comment 4 Kevin Suo 2021-01-06 01:41:21 UTC
(In reply to Kassikakk from comment #3)
It may be a common problem under IBUS as I use ibus-libpinyin, not fcitx.
Comment 5 Kassikakk 2021-01-07 12:32:54 UTC
(In reply to Kevin Suo from comment #4)

Strangely enough, my LxQT machine that is working correctly is using ibus (+ libpinyin). I tried once more to make the LO crash there (including the steps in original posting), but couldn't. Of course, the environment is somewhat different and ibus may still quite possibly be the culprit in your case.
Anyway, on the other machines (Arch Linux + KDE), I removed fcitx and installed fcitx5, the newer version. Checked everything, so far no LO crashes.
Comment 6 Xisco Faulí 2021-01-08 14:43:36 UTC
I can't reproduce it in

Version: 7.2.0.0.alpha0+
Build ID: 6bb6eb1692d7dd432103d0e7278534390084caf6
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: x11
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 7 Buovjaga 2021-04-22 17:32:10 UTC
(In reply to Kassikakk from comment #5)
> (In reply to Kevin Suo from comment #4)
> 
> Strangely enough, my LxQT machine that is working correctly is using ibus (+
> libpinyin). I tried once more to make the LO crash there (including the
> steps in original posting), but couldn't. Of course, the environment is
> somewhat different and ibus may still quite possibly be the culprit in your
> case.
> Anyway, on the other machines (Arch Linux + KDE), I removed fcitx and
> installed fcitx5, the newer version. Checked everything, so far no LO
> crashes.

Another user report saying fcitx5 solved the crash: https://www.reddit.com/r/libreoffice/comments/mm6l2h/libreoffice_7042_crashes_when_changing_windows/gvgrl8d
Comment 8 Buovjaga 2021-04-23 07:43:41 UTC
Kevin: is this related to fcitx in your case?
Comment 9 Kevin Suo 2021-04-23 14:00:33 UTC
(In reply to Buovjaga from comment #8)
I am using ibus-pinyin when the bug occurs. Did not try fcitx.
Comment 10 Caolán McNamara 2021-05-06 14:40:27 UTC
I can reproduce this
Comment 11 Caolán McNamara 2021-05-06 14:43:19 UTC
I feel this may be since

commit 3a662445a0e3666637e5eb140b106a1347f050eb
Date:   Sun Jun 23 17:54:49 2019 -0800

    tdf#126061 Make text edit outliner view show cursor
    
    Change-Id: Ic4e8b5984d5b21c3b789eba943d35d4cad1ba867
    Reviewed-on: https://gerrit.libreoffice.org/74676
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Comment 12 Commit Notification 2021-05-06 16:28:05 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6668b112b341edd24ca77ba88b834108d67b0602

Resolves: tdf#138855 crash on use of Outliner freed by GetFocus

It will be available in 7.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 13 Caolán McNamara 2021-05-06 16:28:59 UTC
backport to 7-1 in gerrit
Comment 14 Commit Notification 2021-05-06 17:31:42 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

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

Resolves: tdf#138855 crash on use of Outliner freed by GetFocus

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