Bug 143135 - Impress crashes when switching to another application then back (kf5 / qt5 with IM)
Summary: Impress crashes when switching to another application then back (kf5 / qt5 wi...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
7.1.4.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.4.0 target:7.3.3
Keywords:
: 143521 147040 148752 (view as bug list)
Depends on:
Blocks: Wayland KDE, KF5
  Show dependency treegraph
 
Reported: 2021-06-30 17:16 UTC by JimR
Modified: 2022-04-26 06:50 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Backtrace (3.05 MB, text/x-log)
2021-07-19 07:03 UTC, Michael Weghorn
Details
Single recursion of that backtrace (3.91 KB, text/plain)
2021-07-19 22:21 UTC, Jan-Marek Glogowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description JimR 2021-06-30 17:16:13 UTC
Description:
Desktop is Fedora 34 KDE spin, running Wayland.  All patches are up to date.

While I am editing an Impress presentation, if I select another application from the panel, then select Impress from the panel, it crashes the Impress session completely.

Steps to Reproduce:
1.Start any desktop application such as KCalc
2.STart Impress and edit a presentation
3.Click on panel Kcalc to switch to that application
4.Click on panel Impress to switch back to presentation

Actual Results:
Impress crashes completely

Expected Results:
Impress should continue operating, allowing presentation to be edited.


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Version: 7.1.4.2
Build ID: 10(Build:2)
CPU threads: 8; OS: Linux 5.12; UI render: default; VCL: kf5
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Buovjaga 2021-07-17 15:50:04 UTC
Does it also happen if you launch from the command line with

SAL_USE_VCLPLUGIN=gtk3 libreoffice
Comment 2 Caolán McNamara 2021-07-17 18:27:54 UTC
If this was the stock fedora build, which it sounds like, was there an offer to report the bug from fedora itself ? If there was, and you approved it, there might have been a link to the fedora retrace shown (something like https://retrace.fedoraproject.org/faf/reports/206623/). A link like that would provide possibly useful backtrace info to give a hint as to the nature of the bug
Comment 3 JimR 2021-07-17 23:16:07 UTC
(In reply to Buovjaga from comment #1)
> Does it also happen if you launch from the command line with
> 
> SAL_USE_VCLPLUGIN=gtk3 libreoffice

No, it does not happen when starting with this option
Comment 4 Michael Weghorn 2021-07-19 07:03:23 UTC
I can reproduce on Debian testing in a Plasma Wayland session.

It doesn't always happen when editing a presentation, but this way was reproducible for me:

0. Make sure to use a Plasma Wayland session (*might* be the same with SAL_USE_VCLPLUGIN=kf5 in a GNOME Wayland session, but I haven't tried)
1.Start any desktop application such as KCalc
2.Start Impress: ./instdir/program/soffice --impress
3. Select "Close" when the "Select a Template" dialog shows up
4. Click into the title box
5. type "ff"
6. switch to KCalc using either Alt+Tab or the entry in the task manager
7. Switch back to impress.


Looks like some infinite recursion, s. attached backtrace gdbtrace.log (will attach afterwards).

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: c6695a4aabeaae99174b7658f2b813788ecff7f0
CPU threads: 12; OS: Linux 5.10; UI render: default; VCL: kf5 (cairo+wayland)
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded
Comment 5 Michael Weghorn 2021-07-19 07:03:57 UTC
Created attachment 173661 [details]
Backtrace
Comment 6 JimR 2021-07-19 18:00:44 UTC
(In reply to Caolán McNamara from comment #2)
> If this was the stock fedora build, which it sounds like, was there an offer
> to report the bug from fedora itself ? If there was, and you approved it,
> there might have been a link to the fedora retrace shown (something like
> https://retrace.fedoraproject.org/faf/reports/206623/). A link like that
> would provide possibly useful backtrace info to give a hint as to the nature
> of the bug

The Bug Reporter did not pop up.  However, when I open it manually, I do see the LibreOffice crash there.  I tried first to create a core dump, after quite a while, it said it could not complete a core dump, and would I like to download huge files to produce a backtrace.  I tried this, but after many hours, it still was incomplete, with no end it sight.

Fortunately, I see that some other person from QA has been able to supply a backtrace.

Is there anything else that you need from me at this time?
Comment 7 Jan-Marek Glogowski 2021-07-19 22:21:32 UTC
Created attachment 173688 [details]
Single recursion of that backtrace

Unfortunately there is no start in the long backtrace. I would happily blame this on QtWayland bugs, if you can't repo on X11, not that this would help the bug reporter ;-)

While the loop is quite tight (just 21 frames), and the Qt5 code is even just 10 frames of it (the rest is generic VCL code, which is less likely to be wrong), I'm not sure where to resolve the chicken-egg problem... guess it's just too late today.

OTOH after reading all the platform implementations of SalFrame::ToTop multiple times, I still don't understand, what these ToTop flags really mean, so that VCL Qt5 code is probably still buggy...
Comment 8 JimR 2021-07-26 03:05:34 UTC
(In reply to Jan-Marek Glogowski from comment #7)
> Created attachment 173688 [details]
> Single recursion of that backtrace
> 
> Unfortunately there is no start in the long backtrace. I would happily blame
> this on QtWayland bugs, if you can't repo on X11, not that this would help
> the bug reporter ;-)
> 
> While the loop is quite tight (just 21 frames), and the Qt5 code is even
> just 10 frames of it (the rest is generic VCL code, which is less likely to
> be wrong), I'm not sure where to resolve the chicken-egg problem... guess
> it's just too late today.
> 
> OTOH after reading all the platform implementations of SalFrame::ToTop
> multiple times, I still don't understand, what these ToTop flags really
> mean, so that VCL Qt5 code is probably still buggy...

So what are the next steps?
Comment 9 Michael Weghorn 2021-07-28 11:47:28 UTC
*** Bug 143521 has been marked as a duplicate of this bug. ***
Comment 10 Ben Cotton 2021-07-30 17:28:45 UTC
Setting SAL_USE_VCLPLUGIN=gtk3 fixes the crash for me as well.
Comment 11 dennis.bayrock 2021-07-30 21:45:55 UTC
Running:

SAL_USE_VCLPLUGIN=gtk3 libreoffice

Worked for me too!

I realize that we are making an assignment of SAL_USE_VCLPLUGIN to gtk3 in the environment prior to running libreoffice. Curious, can someone explain what SAL_USE_VCLPLUGIN actually is?

Thanks!
Comment 12 Buovjaga 2021-07-31 05:33:20 UTC
(In reply to dennis.bayrock from comment #11)
> I realize that we are making an assignment of SAL_USE_VCLPLUGIN to gtk3 in
> the environment prior to running libreoffice. Curious, can someone explain
> what SAL_USE_VCLPLUGIN actually is?

It is forcing a certain VCL UI backend: https://docs.libreoffice.org/vcl.html
Comment 13 caliskanhkaan 2021-09-13 10:54:01 UTC
Still reproducible with version 7.2.0-2.
SAL_USE_VCLPLUGIN=gtk3 solves problem but looking forward to actual fix :)
Comment 14 Nicholas van Oudtshoorn 2021-09-25 10:37:57 UTC
Still an issue with daily 7.3 (2021-09-24_02.59.08). As an alternative to using GTK3, setting libreoffice to run as an X11 app also works:

XDG_SESSION_TYPE=x11 libreofficedev7.3
Comment 15 Jan-Marek Glogowski 2022-04-07 06:28:43 UTC
*** Bug 147040 has been marked as a duplicate of this bug. ***
Comment 16 Jan-Marek Glogowski 2022-04-07 06:34:03 UTC
I just closed my own duplicate. This happens in the same way on X11 for me (I somehow missed this bug. tdf#147040 actually has the bottom of the bt from the stack exhaustion. There is a preliminary patch in https://gerrit.libreoffice.org/c/core/+/132643. I need to update the bug id in the summary and maybe there is some better solution then the implemented workaround.
Comment 17 Commit Notification 2022-04-07 13:05:13 UTC
Jan-Marek Glogowski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#143135 Qt break recursive IM QueryCursorRect

It will be available in 7.4.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 18 Commit Notification 2022-04-08 06:20:05 UTC
Jan-Marek Glogowski committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

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

tdf#143135 Qt break recursive IM QueryCursorRect

It will be available in 7.3.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.
Comment 19 Buovjaga 2022-04-26 06:50:57 UTC
*** Bug 148752 has been marked as a duplicate of this bug. ***