Bug 162696 - Installing a certain extension by dragging and dropping to Start Center fails and blocks UI (kf5/kf6)
Summary: Installing a certain extension by dragging and dropping to Start Center fails...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
24.8.0.0 alpha0+
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Michael Weghorn
URL:
Whiteboard: target:25.2.0 target:24.8.2
Keywords: bibisected, bisected, haveBacktrace, regression
Depends on:
Blocks: KDE, KF5 Qt6
  Show dependency treegraph
 
Reported: 2024-08-29 16:11 UTC by Buovjaga
Modified: 2024-09-05 07:57 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
GDB trace (26.87 KB, text/plain)
2024-08-29 16:11 UTC, Buovjaga
Details
Screencast with qt6 without freeze (6.74 MB, video/x-matroska)
2024-08-30 03:52 UTC, Michael Weghorn
Details
GDB trace of crash after https://gerrit.libreoffice.org/c/core/+/172627 (36.66 KB, text/plain)
2024-08-30 07:11 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Buovjaga 2024-08-29 16:11:51 UTC
Created attachment 196101 [details]
GDB trace

Use a Qt-based VCL backend.

1. Extract attachment 194759 [details] and try to install xevalai.oxt

You will see a "Warning" window in the task bar without being able to bring it to focus. You have to kill the process.

Bibisected with linux-64-24.8 to 1ace888823443b85d4a81b94656844f1b27e2987
tdf#130857 Use native qt widgets - simple message dialog
Comment 1 Michael Weghorn 2024-08-30 03:52:24 UTC
Created attachment 196107 [details]
Screencast with qt6 without freeze
Comment 2 Michael Weghorn 2024-08-30 03:55:20 UTC
I can't reproduce with current master and qt6 in a self-compiled KDE Plasma Dev Wayland session (and Qt dev branches), neither when LO is run as a native Wayland client nor with QT_QPA_PLATFORM=xcb.

Screencast attachment 196107 [details] shows how it behaves for me.
I also don't get any warning or other message dialog when doing that with gtk3 either.
Do you actually see a warning when you do this with gtk3? If so, what does it say? (Maybe there's some condition for the dialog to show?)

I see this warning, which may or may not be related:

    warn:vcl:35889:35889:vcl/source/window/dialog.cxx:993: Dialog::StartExecuteModal() - Parent already modally disabled, use another parent to ensure modality!

Is this reproducible with master, or only 24.8? What's your exact version information?

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 044980edc41544dd5973d5aa57f134d4bfe6d0e7
CPU threads: 32; OS: Linux 6.10; UI render: default; VCL: qt6 (cairo+xcb)
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: CL threaded
Comment 3 Michael Weghorn 2024-08-30 04:08:16 UTC
(In reply to Buovjaga from comment #0)
> Bibisected with linux-64-24.8 to 1ace888823443b85d4a81b94656844f1b27e2987
> tdf#130857 Use native qt widgets - simple message dialog

In my setup, I also cannot reproduce with that exact version from the bibisect repo:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 1ace888823443b85d4a81b94656844f1b27e2987
CPU threads: 32; OS: Linux 6.10; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: CL threaded
Comment 4 Buovjaga 2024-08-30 06:37:26 UTC
I used to get a visible dialog with gtk3, but not anymore.

If I run with qt6 and try to install, I get these in the console:

QObject::setParent: Cannot set parent, new parent is in a different thread
QObject::killTimer: Timers cannot be stopped from another thread
QObject::startTimer: Timers cannot be started from another thread
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Breeze::WidgetStateEngine(0x560bc918bbf0), parent's thread is QThread(0x560bc8f92dc0), current thread is QThread(0x71ddbc00dc50)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Breeze::WidgetStateEngine(0x560bc918bbf0), parent's thread is QThread(0x560bc8f92dc0), current thread is QThread(0x71ddbc00dc50)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Breeze::WidgetStateEngine(0x560bc918f550), parent's thread is QThread(0x560bc8f92dc0), current thread is QThread(0x71ddbc00dc50)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Breeze::WidgetStateEngine(0x560bc918f550), parent's thread is QThread(0x560bc8f92dc0), current thread is QThread(0x71ddbc00dc50)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Breeze::WidgetStateEngine(0x560bc918bbf0), parent's thread is QThread(0x560bc8f92dc0), current thread is QThread(0x71ddbc00dc50)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Breeze::WidgetStateEngine(0x560bc918f550), parent's thread is QThread(0x560bc8f92dc0), current thread is QThread(0x71ddbc00dc50)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Breeze::WidgetStateEngine(0x560bc918f550), parent's thread is QThread(0x560bc8f92dc0), current thread is QThread(0x71ddbc00dc50)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Breeze::WidgetStateEngine(0x560bc918bbf0), parent's thread is QThread(0x560bc8f92dc0), current thread is QThread(0x71ddbc00dc50)
QObject::installEventFilter(): Cannot filter events for objects in a different thread.
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Breeze::WidgetStateEngine(0x560bc918bbf0), parent's thread is QThread(0x560bc8f92dc0), current thread is QThread(0x71ddbc00dc50)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Breeze::WidgetStateEngine(0x560bc918bbf0), parent's thread is QThread(0x560bc8f92dc0), current thread is QThread(0x71ddbc00dc50)
QObject::installEventFilter(): Cannot filter events for objects in a different thread.

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 044980edc41544dd5973d5aa57f134d4bfe6d0e7
CPU threads: 8; OS: Linux 6.10; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Comment 5 Michael Weghorn 2024-08-30 07:00:46 UTC
(In reply to Buovjaga from comment #4)
> If I run with qt6 and try to install, I get these in the console:
> 
> QObject::setParent: Cannot set parent, new parent is in a different thread
> QObject::killTimer: Timers cannot be stopped from another thread
> QObject::startTimer: Timers cannot be started from another thread
> QObject: Cannot create children for a parent that is in a different thread.
> (Parent is Breeze::WidgetStateEngine(0x560bc918bbf0), parent's thread is
> QThread(0x560bc8f92dc0), current thread is QThread(0x71ddbc00dc50)

Can you please try whether https://gerrit.libreoffice.org/c/core/+/172627 helps?
Comment 6 Buovjaga 2024-08-30 07:11:33 UTC
Created attachment 196109 [details]
GDB trace of crash after https://gerrit.libreoffice.org/c/core/+/172627

With the patch, I get a crash and now I realise I should have given more information: I am installing the extension by dragging and dropping it into the Start Center. I now see that if I do it via Tools - Extensions - Add, there is no problem!!
Comment 7 Michael Weghorn 2024-08-30 07:22:43 UTC
(In reply to Buovjaga from comment #6)
> Created attachment 196109 [details]
> GDB trace of crash after https://gerrit.libreoffice.org/c/core/+/172627
> 
> With the patch, I get a crash 

That's progress :-) - backtrace suggests that more needs to be done in the main thread than the current version of the Gerrit change ensures.

> and now I realise I should have given more
> information: I am installing the extension by dragging and dropping it into
> the Start Center.

This way, I can indeed reproduce: With a debug Qt build it triggers the assertion that the Gerrit change fixes:

ASSERT failure in QWidget: "Widgets must be created in the GUI thread.", file /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp, line 958
terminate called after throwing an instance of 'com::sun::star::uno::RuntimeException'

I'll look into the remaining issues.
Comment 8 Michael Weghorn 2024-08-30 08:23:57 UTC
(In reply to Michael Weghorn from comment #7)
> I'll look into the remaining issues.

Works for me with these 2 Gerrit changes in place:

https://gerrit.libreoffice.org/c/core/+/172642
https://gerrit.libreoffice.org/c/core/+/172643
Comment 9 Buovjaga 2024-08-30 08:33:37 UTC
(In reply to Michael Weghorn from comment #8)
> (In reply to Michael Weghorn from comment #7)
> > I'll look into the remaining issues.
> 
> Works for me with these 2 Gerrit changes in place:
> 
> https://gerrit.libreoffice.org/c/core/+/172642
> https://gerrit.libreoffice.org/c/core/+/172643

Indeed, with those, the warning dialog is focusable.
Comment 10 Commit Notification 2024-08-30 11:25:22 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5e4c1638eaf16908add86fbf6d9d83204178f100

tdf#162696 qt weld: Do GUI things in main thread

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.
Comment 11 Commit Notification 2024-08-30 11:25:24 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1eb49aa3a5abc81c4a23b5371a9f733689edb1b4

tdf#162696 qt weld: Destroy QDialog in main thread

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.
Comment 12 Michael Weghorn 2024-08-30 11:33:24 UTC
(In reply to Buovjaga from comment #9)
> Indeed, with those, the warning dialog is focusable.

Thanks for checking -> setting to VERIFIED as those changes are merged now
Comment 13 Buovjaga 2024-08-30 12:13:46 UTC
One small thing I noticed is that after clicking OK on the warning dialog, the Extensions dialog has to be manually brought into focus. So it's not layered below the warning dialog during the first installation action in a session.
Comment 14 Michael Weghorn 2024-08-30 16:27:40 UTC
(In reply to Buovjaga from comment #13)
> One small thing I noticed is that after clicking OK on the warning dialog,
> the Extensions dialog has to be manually brought into focus. So it's not
> layered below the warning dialog during the first installation action in a
> session.

It occasionally works correctly for me; change to make it work reliably:
https://gerrit.libreoffice.org/c/core/+/172686

And when comparing that to the non-welded variant using SAL_VCL_QT_NO_WELDED_WIDGETS=1 I got another assert with the debug Qt build; fix for that:
https://gerrit.libreoffice.org/c/core/+/172685
Comment 15 Buovjaga 2024-08-30 17:05:40 UTC
(In reply to Michael Weghorn from comment #14)
> (In reply to Buovjaga from comment #13)
> > One small thing I noticed is that after clicking OK on the warning dialog,
> > the Extensions dialog has to be manually brought into focus. So it's not
> > layered below the warning dialog during the first installation action in a
> > session.
> 
> It occasionally works correctly for me; change to make it work reliably:
> https://gerrit.libreoffice.org/c/core/+/172686

Indeed, with that it's perfect.
Comment 16 Commit Notification 2024-08-31 06:30:22 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/308545e2ed4e35960b8c4ed09dcd6a9f95872613

tdf#162696 qt weld: Do GUI things in main thread

It will be available in 24.8.2.

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 17 Commit Notification 2024-08-31 06:31:25 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/59e393c1689a0d6a780aa499c617f2adacf5a886

tdf#162696 qt weld: Destroy QDialog in main thread

It will be available in 24.8.2.

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 2024-08-31 16:28:42 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5ef991ffc226424a673662b6e478db124825022a

tdf#162696 qt: Always run QtFrame::SetPosSize in main thread

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.
Comment 19 Commit Notification 2024-08-31 16:28:44 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1e2836665a1839f61cd8bfa46c54687f010e7e9d

tdf#162696 tdf#130857 qt weld: Get parent via SalInstanceWidget

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.
Comment 20 Commit Notification 2024-09-05 07:55:44 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

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

tdf#162696 qt: Always run QtFrame::SetPosSize in main thread

It will be available in 24.8.2.

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 21 Commit Notification 2024-09-05 07:57:46 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/2d497a8754dbd33ebe7793e543c89018333891f1

tdf#162696 tdf#130857 qt weld: Get parent via SalInstanceWidget

It will be available in 24.8.2.

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.