Bug 166334 - Application freezes on Save As (kf6 on X11)
Summary: Application freezes on Save As (kf6 on X11)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
25.2.2.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Michael Weghorn
URL:
Whiteboard: target:25.8.0 target:25.2.4
Keywords:
Depends on:
Blocks: Save Qt6
  Show dependency treegraph
 
Reported: 2025-04-25 08:24 UTC by Heiko Tietze
Modified: 2025-05-14 06:22 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Backtrace (11.94 KB, text/plain)
2025-04-25 09:44 UTC, Heiko Tietze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Tietze 2025-04-25 08:24:23 UTC
When the SaveAs dialog is supposed to appear the application sometimes freezes and has to be killed via PID. Happens with 

Version: 25.2.2.2 (X86_64) / LibreOffice Community
Build ID: 520(Build:2)
CPU threads: 32; OS: Linux 6.14; UI render: default; VCL: kf6 (cairo+xcb)
Locale: de-DE (en_US.UTF-8); UI: en-US
25.2.2-2
Calc: threaded

but also master and the debug information in the console tells me

kf.kio.filewidgets.kfilefiltercombo: KFileFilterCombo::setCurrentFilter: Could not find file filter KFileFilter(MIME patterns: QList() File patterns: QList("*.odt") label: "ODF Text Document (.odt)")

I cannot identify a particular situation, after restarting everything works flawless.

plasmashell 6.3.4
Qt 6.9.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 14.2.1 20250207) on "xcb" 
OS: Arch Linux [linux version 6.14.3-arch1-1]
Comment 1 Michael Weghorn 2025-04-25 08:36:42 UTC
Some additional questions, as I can't reproduce this with the Debian-provided libreoffice-kf6

(In reply to Heiko Tietze from comment #0)
> the debug information in the console tells me
> 
> kf.kio.filewidgets.kfilefiltercombo: KFileFilterCombo::setCurrentFilter:
> Could not find file filter KFileFilter(MIME patterns: QList() File patterns:
> QList("*.odt") label: "ODF Text Document (.odt)")

I seet that warning with the Debian packaged libreoffice-kf6 as well, but no crashes (neither on Wayland, nor with QT_QPA_PLATFORM=xcb), so it *might* be unrelated.

Some additional questions:

1) Since it only happens sometimes: Do you see the mentioned warning on stderr also for the case where it doesn't freeze, or only when it freezes?

2) Can you please attach a backtrace of such a freeze. One way to get one when the situation occurs:

* identify PID of the soffice.bin process using `ps faux | grep soffice`
* attach GDB to that process: `gdb -p <PID>` (where <PID> is the PID identified in previous step)
* once the gdb prompt appears, run GDB command `thread apply all bt`
* attach the output here

Version: 25.2.2.2 (X86_64) / LibreOffice Community
Build ID: 520(Build:2)
CPU threads: 32; OS: Linux 6.12; UI render: default; VCL: kf6 (cairo+wayland)
Locale: en-GB (en_GB.UTF-8); UI: en-GB
Debian package version: 4:25.2.2-1
Calc: threaded

Version: 25.2.2.2 (X86_64) / LibreOffice Community
Build ID: 520(Build:2)
CPU threads: 32; OS: Linux 6.12; UI render: default; VCL: kf6 (cairo+xcb)
Locale: en-GB (en_GB.UTF-8); UI: en-GB
Debian package version: 4:25.2.2-1
Calc: threaded
Comment 2 Heiko Tietze 2025-04-25 09:44:26 UTC
Created attachment 200511 [details]
Backtrace

It seems to work with SAL_USE_VCLPLUGIN=qt6 meaning it would be a kf6 issue.

After commenting out line #129 osl::Guard<comphelper::SolarMutex> aGuard(comphelper::SolarMutex::get()); in drawinglayer/source/primitive2d/BufferedDecompositionFlusher.cxx I can press escape while the app is frozen and get back to a working state.
Comment 3 Michael Weghorn 2025-04-25 09:58:51 UTC
Can't reproduce myself, but saw the issue in a screensharing session -> setting to NEW
Comment 4 Michael Weghorn 2025-04-25 13:33:20 UTC
One observation was also that despite `QDialog::exec` having been called, the file dialog didn't show up at all for the problematic cases, so likely the application was waiting for the dialog to be closed again, while the user didn't see the dialog to interact with it.

This *might* be related to the parent not properly being set.

https://gerrit.libreoffice.org/c/core/+/184625 fixes another scenario that depends on the proper parent being set (main window properly being greyed out and file dialog always staying on top on Wayland).

@Heiko: Can you please check whether that helps for your issue, too?
Comment 5 Commit Notification 2025-04-25 16:35:42 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

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

tdf#166334 qt: More reliably detect native file dlg parent

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 6 Heiko Tietze 2025-04-28 08:12:27 UTC
With current master the app behaves in kf6 mode like qt6: it becomes frozen but I can use escape to get back. Cannot provoke the same state with qt6 now- but this might be just coincidentally.
Comment 7 Michael Weghorn 2025-05-10 18:21:09 UTC
(In reply to Heiko Tietze from comment #6)
> With current master the app behaves in kf6 mode like qt6: it becomes frozen
> but I can use escape to get back. Cannot provoke the same state with qt6
> now- but this might be just coincidentally.

IIRC, the issue never happened with qt6, only with kf6 on X11/XWayland.

Does https://gerrit.libreoffice.org/c/core/+/185145 help?

I could very rarely reproduce the issue with kf6 and QT_QPA_PLATFORM=xcb on Debian testing now. I did see other less grave issues more reliably, and at least those seem fixed, so I'm quite hopeful this also fixes your issue. (See commit message of that change for more details.)
Comment 8 Heiko Tietze 2025-05-12 08:15:30 UTC
(In reply to Michael Weghorn from comment #7)
> Does https://gerrit.libreoffice.org/c/core/+/185145 help?

Never experienced the issue again after patch from comment 5. The latest does not harm _ no idea if this is needed.
Comment 9 Commit Notification 2025-05-12 09:49:39 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/54767d6c0e58c8506c899fe290f03b1216846e44

tdf#166334 qt: Drop extra QDialog::show for file dialog

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 10 Michael Weghorn 2025-05-12 09:54:38 UTC
(In reply to Heiko Tietze from comment #8)
> Never experienced the issue again after patch from comment 5. The latest
> does not harm _ no idea if this is needed.

OK, then I apparently misunderstood your comment 6 as "it's still broken with kf6 with the commit from comment 5 in place".

Closing as fixed as this hopefully is fixed at least with both commits in place now.

Please reopen or create a new ticket if you still see the issue again in the future.
Comment 11 Heiko Tietze 2025-05-12 10:19:19 UTC
(In reply to Michael Weghorn from comment #10)
> OK, then I apparently misunderstood your comment 6...

Right, now I remember ;-). Hope the issue has been fixed now for good.
Comment 12 Commit Notification 2025-05-14 06:22:48 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

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

tdf#166334 qt: Drop extra QDialog::show for file dialog

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