Bug 121399 - [gtk3_kde5] 6.1 stable branch: within Plasma-5 session w/ drkonqi: lo_kde5filepicker crashes every time on close (OK/Cancel regardless)
Summary: [gtk3_kde5] 6.1 stable branch: within Plasma-5 session w/ drkonqi: lo_kde5fil...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
6.2.0.0.alpha1+
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Michael Weghorn
URL:
Whiteboard: target:6.3.0 target:6.2.0.1 target:6.1.4
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-13 21:47 UTC by andreas.sturmlechner
Modified: 2018-12-10 09:26 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andreas.sturmlechner 2018-11-13 21:47:59 UTC
I am getting a 100% reliable crash an Open/Save dialogs throughout LibreOffice suite in 6.1 branch, built today. 6.1.3.2 behaves well though.

I have narrowed candidates for the regression down to two commits:

tdf#120261 gtk3_kde5: Leave event handling on gtk3 side to gtk
c6cd5656e5b398502e55bc83c4bfc94180f72606

tdf#120261 gtk3_kde5: Read IPC cmds in own thread on kde5 side
d6391f474a94becf3a30963356515c1a1d5c434e

I've had these two picked on top of 6.1.3.2 which again reproduced the crashes.
Comment 1 andreas.sturmlechner 2018-11-13 21:50:01 UTC
Toolkit versions in use:

GTK+ 3.24.1
Qt 5.11.2
KDE Frameworks 5.52
Comment 2 Michael Weghorn 2018-11-13 22:10:22 UTC
I'll try to have a look, but I'll have to build the 6.1 branch first, since I can't reproduce with git master branch.
Comment 3 Michael Weghorn 2018-11-14 12:28:48 UTC
I CANNOT reproduce on Debian testing with a current build of the libreoffice-6-1 branch

Version: 6.1.4.0.0+
Build ID: 4f727bb76b61648511112adb59439a99b5e27629
CPU threads: 4; OS: Linux 4.18; UI render: default; VCL: gtk3_kde5; 
Locale: en-GB (en_GB.UTF-8); Calc: group threaded

This works fine for me:

* open a new document in Writer
* File -> Save as
* Enter some name
* click "OK"

The following information might help:

1) Do you have any additional extensions installed?

2) Can you try with a clean user profile?

3) Can you possibly attach a GDB backtrace of the crash? (can be collected e.g. as described at https://wiki.documentfoundation.org/QA/BugReport/Debug_Information#GNU.2FLinux:_How_to_get_a_backtrace )
Comment 4 Michael Weghorn 2018-11-14 12:41:18 UTC
Also it would be helpful to know whether the crash also occurs if you test with a current daily build of the master branch.
Comment 5 Julien Nabet 2018-11-14 12:46:09 UTC
Could it be already fixed with https://cgit.freedesktop.org/libreoffice/core/commit/?id=a6318cb430fd8f90b760f7dc36f4eacd3904e22e
?
Comment 6 Michael Weghorn 2018-11-14 18:51:51 UTC
(In reply to Julien Nabet from comment #5)
> Could it be already fixed with
> https://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=a6318cb430fd8f90b760f7dc36f4eacd3904e22e
> ?

This commit should be unrelated, in particular since Andreas (the reporter) was originally assuming that it might have caused the issue, i.e. it was already applied for him, s. bug 121276 comment#7.
Comment 7 andreas.sturmlechner 2018-11-15 01:01:08 UTC
I did not get to do a lot with it today, but I've built git master just now and can confirm the crash with gtk3_kde5 just the same. However in >=6.2 in general I also build kde5 VCL, which does not exhibit the crash.

Version: 6.2.0.0.alpha1+
Build ID: 20b2903354138f8ab19261fab74658fcf6af70e3
CPU threads: 8; OS: Linux 4.18; UI render: default; VCL: gtk3_kde5; 
Locale: de-AT (de_AT.UTF-8); UI-Language: en-US
Calc: threaded
Comment 8 andreas.sturmlechner 2018-11-21 15:05:56 UTC
Unfortunately I haven't managed to produce a useful backtrace so far - however, to reproduce the issue you need to have Plasma 5 installed. Typically it ships with drkonqi as the crash handler - this bug is only reproducible with drkonqi present, and goes away as soon as I remove it.
Comment 9 andreas.sturmlechner 2018-11-21 15:20:59 UTC
When I attach to the filepicker process via:

gdb --pid `pgrep lo_kde5filepick`,

the only thing I can extract out of gdb is:

Thread 1 "lo_kde5filepick" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
Comment 10 Julien Nabet 2018-11-21 15:33:25 UTC
in gdb, what does it give if you type:
"bt" (without quotes)
?
Comment 11 andreas.sturmlechner 2018-11-21 15:46:42 UTC
Not more than

(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007f6037baefb1 in __GI_abort () at abort.c:79
Backtrace stopped: Cannot access memory at address 0x7ffcf56fe1e8
Comment 12 Julien Nabet 2018-11-21 15:55:38 UTC
Katarina/Luboš: thought you might be interested in this one since it concerns KDE.
Comment 13 Katarina Behrens (CIB) 2018-11-21 16:37:33 UTC
(In reply to Julien Nabet from comment #12)
> Katarina/Luboš: thought you might be interested in this one since it
> concerns KDE.

I prefer not to be added to Cc: of random bugs just because a QA person thinks "I might be interested". I'm not.

... and if I happen to be, I will add myself, thank you very much.
Comment 14 Julien Nabet 2018-11-21 17:36:17 UTC
(In reply to Katarina Behrens (CIB) from comment #13)
> ...
> I prefer not to be added to Cc: of random bugs just because a QA person
> thinks "I might be interested". I'm not.
> 
> ... and if I happen to be, I will add myself, thank you very much.

I'll try to remember this. Sorry for the noise and don't hesitate to uncc yourself of course.
Comment 15 Michael Weghorn 2018-11-21 22:15:59 UTC
In Debian testing with KDE Plasma and Dr. Konqi installed, I don't get the crash.

@Andreas: What is the system you're using?
Comment 16 Michael Weghorn 2018-11-21 22:20:30 UTC
And, does LibreOffice itself keep running after the file picker crashes (since the two are separate processes)? It might be helpful to get a GDB backtrace of the soffice process as well.
Comment 17 andreas.sturmlechner 2018-11-22 00:25:23 UTC
No, LibreOffice keeps running just fine.

(In reply to Michael Weghorn from comment #15)
> In Debian testing with KDE Plasma and Dr. Konqi installed, I don't get the
> crash.
> 
> @Andreas: What is the system you're using?
This is Gentoo ~amd64, which means it is a bit ahead of Debian testing with Plasma 5.14.3 and Frameworks 5.52 (and meanwhile updated to Qt 5.12.0_beta4 which did not affect behaviour).
Comment 18 andreas.sturmlechner 2018-11-22 07:55:29 UTC
I've also just completed a build from current 6.1 branch with the two commits from comment #0 reverted, and that fixes the bug.

Quoting fvogt from yesterday's #plasma session:

> <fvogt> asturm: Might be as easy as adding Qt::QueuedConnection to 
> vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx:206
> <fvogt> As it bypasses Qt's thread handing and uses std::thread instead, it
> doesn't know it's a connection across threads and uses DirectConnection
> instead - that's not going to work as expected
Comment 19 Michael Weghorn 2018-11-22 19:52:02 UTC
(In reply to andreas.sturmlechner from comment #18)
> I've also just completed a build from current 6.1 branch with the two
> commits from comment #0 reverted, and that fixes the bug.
> 
> Quoting fvogt from yesterday's #plasma session:
> 
> > <fvogt> asturm: Might be as easy as adding Qt::QueuedConnection to 
> > vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx:206
> > <fvogt> As it bypasses Qt's thread handing and uses std::thread instead, it
> > doesn't know it's a connection across threads and uses DirectConnection
> > instead - that's not going to work as expected

Thanks for pointing this out. Can you try whether the change at https://gerrit.libreoffice.org/63835 fixes the crash for you? (It carries out exactly the change mentioned by fvogt.)
Comment 20 andreas.sturmlechner 2018-11-22 22:16:05 UTC
Thanks for your quick patch, unfortunately this did not solve the issue yet.
Comment 21 Michael Weghorn 2018-11-23 12:01:52 UTC
Hm, then the cause must be another one, but it's hard for me to analyse without being able to reproduce...

Can you try to revert

> tdf#120261 gtk3_kde5: Leave event handling on gtk3 side to gtk
> c6cd5656e5b398502e55bc83c4bfc94180f72606
while leaving
> tdf#120261 gtk3_kde5: Read IPC cmds in own thread on kde5 side
> d6391f474a94becf3a30963356515c1a1d5c434e
applied, to narrow down for sure which of the 2 commits introduces the crash?
Comment 22 Michael Weghorn 2018-11-23 12:59:18 UTC
One more idea; could you test patch set 2 of https://gerrit.libreoffice.org/#/c/63835/ (but it's just guessing...)?
Comment 23 andreas.sturmlechner 2018-11-23 21:00:06 UTC
(In reply to Michael Weghorn from comment #22)
> One more idea; could you test patch set 2 of
> https://gerrit.libreoffice.org/#/c/63835/ (but it's just guessing...)?
Bingo! No more crash after this patch.
Comment 24 Michael Weghorn 2018-11-24 09:41:31 UTC
Thanks for testing! The underlying cause should be clear now. There's already a comment on the test patch, so I'll discuss what's the most proper way to fix it and get it integrated soon. I might ask you for the favour to test one more time then...
Comment 25 andreas.sturmlechner 2018-11-29 14:18:02 UTC
I'm ready whenever you attach something in here for me to test (makes it easier than trying to extract the changes out of the gerrit interface (or I'm unable to find a raw patch link).
Comment 26 Michael Weghorn 2018-12-04 13:56:13 UTC
(In reply to andreas.sturmlechner from comment #25)
> I'm ready whenever you attach something in here for me to test (makes it
> easier than trying to extract the changes out of the gerrit interface (or
> I'm unable to find a raw patch link).

Could you test patch set 4? You can see the different options to retrieve the change (either via git or other download methods) in the top right corner in Jenkins, when you click on "Download", e.g. this is a (zipped) patch file:
https://gerrit.libreoffice.org/changes/63835/revisions/8e395b1c1476122963082861c02adaa976d91e9b/patch?zip
Comment 27 andreas.sturmlechner 2018-12-04 21:59:35 UTC
Thanks, I tested this patch on top of 6.1.4.1 and it works for me.
Comment 28 Commit Notification 2018-12-05 06:15:01 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/93815c2b04f1905e43c695caf5cc2c594bb897ce%5E%21

tdf#121399 Join cmd reading thread in gtk3_kde5

It will be available in 6.3.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 29 Michael Weghorn 2018-12-05 06:17:23 UTC
(In reply to andreas.sturmlechner from comment #27)
> Thanks, I tested this patch on top of 6.1.4.1 and it works for me.

Thanks for testing. It's fixed in master now, cherry-picks for LibreOffice 6.2 and 6.1 pending at
https://gerrit.libreoffice.org/#/c/64587
https://gerrit.libreoffice.org/#/c/64588/
Comment 30 Commit Notification 2018-12-05 08:53:38 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/5b017b8ebede87c53ce94dc46be1c252c45705e6%5E%21

tdf#121399 Join cmd reading thread in gtk3_kde5

It will be available in 6.2.0.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 31 Commit Notification 2018-12-08 00:05:26 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

https://git.libreoffice.org/core/+/626ebc8d81d684d3a845ff787fbaaf416df7e427%5E%21

tdf#121399 Join cmd reading thread in gtk3_kde5

It will be available in 6.1.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 32 andreas.sturmlechner 2018-12-08 15:54:26 UTC
Ideally this should still be added for 6.1.4.2, otherwise distributions would need to be advised to apply it downstream.
Comment 33 Michael Weghorn 2018-12-08 16:17:09 UTC
(In reply to andreas.sturmlechner from comment #32)
> Ideally this should still be added for 6.1.4.2, otherwise distributions
> would need to be advised to apply it downstream.

Review request for 6.1.4 is now at https://gerrit.libreoffice.org/#/c/64813/
Comment 34 Commit Notification 2018-12-10 09:25:39 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-6-1-4":

https://git.libreoffice.org/core/+/eb469025573c2d74fe4b1089345a1f5dff930107%5E%21

tdf#121399 Join cmd reading thread in gtk3_kde5

It will be available in 6.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.
Comment 35 Julien Nabet 2018-12-10 09:26:06 UTC
Let's simplify targets.