Bug 117866 - LibreOffice hangs if "Select Firefox Theme" dialog is dismissed before theme previews are completely loaded.
Summary: LibreOffice hangs if "Select Firefox Theme" dialog is dismissed before theme ...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.0.4.2 release
Hardware: x86-64 (AMD64) All
: high major
Assignee: Miklos Vajna
URL:
Whiteboard: target:6.2.0 target:6.1.0.1 target:6.0.6
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Firefox-Themes
  Show dependency treegraph
 
Reported: 2018-05-29 04:49 UTC by Kal Sze
Modified: 2018-08-06 15:29 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
How the "Select Firefox Theme" dialog looks like just before I clicked "Cancel". (38.46 KB, image/png)
2018-05-29 04:49 UTC, Kal Sze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kal Sze 2018-05-29 04:49:26 UTC
Created attachment 142366 [details]
How the "Select Firefox Theme" dialog looks like just before I clicked "Cancel".

Steps to reproduce:

1. Launch LibreOffice;
2. Start a new Writer document;
3. Open the "Select Firefox Theme":
    - Open the "Tools" menu;
    - Select "Options...";
    - Expand the "LibreOffice" section in the tree;
    - Select the "Personlisation" item in the tree;
    - Click the "Select Theme" button.
4. You will see the "Select Firefox Theme" dialog, with 9 gray rectangles, which are used to display theme previews;
5. Click one of the categories - e.g. "Abstract";
6. LibreOffice will start loading and showing theme previews in those gray rectangles;
7. Click the "Cancel" button after just one or two previews are loaded and displayed.
8. Watch LibreOffice hang.
Comment 1 Joao Farias 2018-05-31 22:35:31 UTC
Kal, thank you for your report.

I could reproduce the issue on macOS and Windows, versions 6.1.0.0.beta1 and 6.0.4.2.

Setting the bug to NEW, changing the Hardware to All, since it affects two SOs.

Debugging details:

On macOS, the loading on step 6 prints the following message on the terminal:

(pkix_CacheCert_Add: PKIX_PL_HashTable_Add for Certs skipped: entry existed
Comment 2 Xisco Faulí 2018-06-04 11:23:35 UTC
Regression introduced by:

author	Miklos Vajna <vmiklos@collabora.co.uk>	2018-04-24 17:44:54 +0200
committer	Miklos Vajna <vmiklos@collabora.co.uk>	2018-04-24 22:28:20 +0200
commit 336d91a6f2bc12ff0342f984cdbb2cf64abd0b56 (patch)
tree 9b5d85a6c65a6aa022186eea200dec3c57c928e2
parent 697ebd15d646e41bb69726f7b438ebbfaff141b0 (diff)
tdf#113377 cui personalization: fix calling into VCL without necessary locking
We assume the SolarMutex is always taken when doing GL calls, but
putting DBG_TESTSOLARMUTEX() into WinOpenGLContext::makeCurrent()
pointed out two places in the persona code where this invariant wasn't
hold, fix those.

Opening the dialog and downloading previews of one category, then
clicking on an other button to download previews of an other category no
longer results in a crash while calling glBindFramebuffer() with this.

Bisected with: bibisect-linux64-6.1

Adding Cc: to Miklos Vajna
Comment 3 Commit Notification 2018-06-04 16:55:45 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=766c85a4f67f5d50645340e31cebd5956998c6fc

tdf#117866 cui: avoid deadlock in personalization dialog

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2018-06-05 12:07:43 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f4ac7b5a084a7cf483bb89a2fa411f9df70df4d0

Related: tdf#117866 cui: use std::atomic for thread termination flag

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2018-06-05 15:14:03 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=400137b1d36e4296e4e297a4c570933e6572b38c&h=libreoffice-6-1

tdf#117866 cui: avoid deadlock in personalization dialog

It will be available in 6.1.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Xisco Faulí 2018-06-06 10:22:38 UTC
Verified in

Version: 6.1.0.0.beta1+
Build ID: 8b96445766efe237eb47608ade6c147673466e2e
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

@Miklos, thanks for fixing this!!
Comment 7 Commit Notification 2018-06-28 11:31:30 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f4c73f90da2a2c31f0d29572180aa97e10c3dbad

tdf#117866 cui personalization: fix a possible race

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2018-06-28 15:13:47 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ea08ffc92d84e944a143902f9cd280370986a781&h=libreoffice-6-1

tdf#117866 cui personalization: fix a possible race

It will be available in 6.1.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2018-06-29 14:02:32 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ec8e973f7e681b0ae25e4b781918dd98ea0e8176&h=libreoffice-6-0

tdf#117866 cui: avoid deadlock in personalization dialog

It will be available in 6.0.6.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Telesto 2018-07-21 12:17:15 UTC
I'm still able to reproduce a similar issues:

1. Launch LibreOffice;
2. Start a new Writer document;
3. Open the "Select Firefox Theme":
    - Open the "Tools" menu;
    - Select "Options...";
    - Expand the "LibreOffice" section in the tree;
    - Select the "Personlisation" item in the tree;
    - Click the "Select Theme" button.
4. You will see the "Select Firefox Theme" dialog, with 9 gray rectangles, which are used to display theme previews;
5. Click one of the categories - e.g. "Abstract";
6. LibreOffice will start loading and showing theme previews in those gray rectangles;
7. Click the "Cancel" button (without waiting for a theme)
8. Press the Select Theme button again -> hang

Alternative
7. Click the "OK" button (without waiting for a theme) -> Hang
Comment 11 Xisco Faulí 2018-07-22 21:05:50 UTC
(In reply to Telesto from comment #10)
> I'm still able to reproduce a similar issues:
> 
> 1. Launch LibreOffice;
> 2. Start a new Writer document;
> 3. Open the "Select Firefox Theme":
>     - Open the "Tools" menu;
>     - Select "Options...";
>     - Expand the "LibreOffice" section in the tree;
>     - Select the "Personlisation" item in the tree;
>     - Click the "Select Theme" button.
> 4. You will see the "Select Firefox Theme" dialog, with 9 gray rectangles,
> which are used to display theme previews;
> 5. Click one of the categories - e.g. "Abstract";
> 6. LibreOffice will start loading and showing theme previews in those gray
> rectangles;
> 7. Click the "Cancel" button (without waiting for a theme)
> 8. Press the Select Theme button again -> hang
> 
> Alternative
> 7. Click the "OK" button (without waiting for a theme) -> Hang

Hi Telesto,
Could you please create a follow-up bug for this?