Bug 379524 - Fontsettings crashes/stalls when installing/deleting multiple system fonts
Summary: Fontsettings crashes/stalls when installing/deleting multiple system fonts
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_fontinst (show other bugs)
Version: 5.9.5
Platform: Neon Linux
: NOR major
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-04 21:14 UTC by Alex
Modified: 2018-08-02 07:34 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Deleting multiple fonts (955.10 KB, image/gif)
2017-05-04 21:14 UTC, Alex
Details
Installing multiple fonts (2.83 MB, image/gif)
2017-05-04 21:14 UTC, Alex
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex 2017-05-04 21:14:19 UTC
Created attachment 105350 [details]
Deleting multiple fonts

When I try to install or delete multiple system fonts systemsettings crashes so only font at time is deleted. Same thing when installing: only one is installed and every time crash error in background is visible. Also sometimes message about updating font config isn't closed and stays until logout, unfortunately not visible here.
Comment 1 Alex 2017-05-04 21:14:53 UTC
Created attachment 105351 [details]
Installing multiple fonts
Comment 2 Raoul Snyman 2017-07-23 04:57:53 UTC
I'm also running into this bug (for a while already, to be honest). Debian unstable, KDE Frameworks 5.28.0, Qt 5.7.1.

Steps to reproduce:

1. Launch Font Management (either via System Settings or command line)
2. Select "System Fonts" in the list on the left hand side
3. Click "Add..." button at the bottom, under the list of fonts
4. Select a range of fonts (all TTF fonts in my case)
5. Type in password when asked for autnetication
6. An error dialog shows, "Backend died, but has been restarted. Please try again."
7. Another authentication dialog shows up immediately, re-enter password
8. Get a "Finished" message: "Please note that any open applications will need to be restarted in order for any changes to be noticed/"
9. See that only 2 fonts have been installed.

As Alex says, sometimes the message boxes refuse to be dismissed and you have to manually terminate Font Management with "kill".

If I run it from the command line, I see the following:

$ kcmshell5 fontinst
Service  org.kde.fontinst  not registered, starting "/usr/lib/x86_64-linux-gnu/libexec/kauth/fontinst"
1500785019 Connecting to session bus
1500785019 Failed to register service!
Comment 3 Thomas H 2017-08-24 00:03:43 UTC
Same issue here on the most recent update of KDE Neon user edition. I also  occasionally experience the fontinst message getting stuck at 100% upon completion.

Another issue with the font manager: After disabling a font, the font list is re-sorted and the first item is highlighted, regardless of previous position or sorting.
Comment 4 Thomas H 2017-08-24 00:12:23 UTC
After a few minutes more, this bug is avoidable if you run the Font Manager as a super user. In a terminal, run "sudo kcmshell5 fontinst" and voila, none of these issues occur.
Comment 5 Paul 2017-08-24 12:20:26 UTC
There are numerous similar bug reports.

This comment from Christoph Feck ( https://bugs.kde.org/show_bug.cgi?id=379324#c4 ) back in June 2017 would indicate this will not be fixed any time soon...
Comment 6 Alex 2017-08-24 13:11:19 UTC
So currently only copying and then:
sudo fc-cache -frv
Comment 7 Mathias Tillman 2018-07-30 17:14:28 UTC
I have sent a review request that should fix this issue here: https://phabricator.kde.org/D14493

Please try the patch if you can and report back.
Comment 8 Mathias Tillman 2018-07-31 10:41:02 UTC
Git commit 60c895758f20bd2cb17ab12e57cf34cc37197098 by Mathias Tillman.
Committed on 31/07/2018 at 10:40.
Pushed by mathiastillman into branch 'master'.

fontinst quits after KJob is done

Summary:
As the summary says, when installing/removing multiple fonts to system the expected behaviour would be for fontinst to keep running after the first font has been installed or removed, instead it quits which causes a bunch of issues. fontinst uses KJob to authorize and internally KJob uses a QEventLoopLocker which causes the main event loop to quit when it's done.
I'm not entirely sure why the event loop locker is enabled by default for KJob, but the patch I have attached works around this by completely disabling that functionality for fontinst. There's a timer that runs in the background which checks for any connected clients, so it will quit after a little while regardless.
Related: bug 379324, bug 349673, bug 361960, bug 392267

Test Plan: Make sure fonts are still installed and removed properly.

Reviewers: #plasma, dfaure, aacid, gateau

Reviewed By: dfaure

Subscribers: wbauer, ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D14493

M  +4    -0    kcms/kfontinst/dbus/Main.cpp

https://commits.kde.org/plasma-desktop/60c895758f20bd2cb17ab12e57cf34cc37197098
Comment 9 Mathias Tillman 2018-08-02 07:34:42 UTC
Git commit 690570a4cefd786db5113ca237e9bdb48cd50812 by Mathias Tillman.
Committed on 02/08/2018 at 07:33.
Pushed by mathiastillman into branch 'Plasma/5.12'.

fontinst quits after KJob is done

Summary:
As the summary says, when installing/removing multiple fonts to system the expected behaviour would be for fontinst to keep running after the first font has been installed or removed, instead it quits which causes a bunch of issues. fontinst uses KJob to authorize and internally KJob uses a QEventLoopLocker which causes the main event loop to quit when it's done.
I'm not entirely sure why the event loop locker is enabled by default for KJob, but the patch I have attached works around this by completely disabling that functionality for fontinst. There's a timer that runs in the background which checks for any connected clients, so it will quit after a little while regardless.
Related: bug 379324, bug 349673, bug 361960, bug 392267

Test Plan: Make sure fonts are still installed and removed properly.

Reviewers: #plasma, dfaure, aacid, gateau

Reviewed By: dfaure

Subscribers: wbauer, ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D14493

(cherry picked from commit 60c895758f20bd2cb17ab12e57cf34cc37197098)

M  +4    -0    kcms/kfontinst/dbus/Main.cpp

https://commits.kde.org/plasma-desktop/690570a4cefd786db5113ca237e9bdb48cd50812