Pinta hangs on opening fonts while using text tool

Bug #1873628 reported by bbhtt
This bug report is a duplicate of:  Bug #1311873: Text tool takes a while to load. Edit Remove
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Pinta
New
Undecided
Unassigned

Bug Description

Affected Versions:

Pinta version 1.6 from Ubuntu Repository
Pinta version 1.7 cloned github.com/PintaProject/Pinta

System:

Kernel: 5.4.0-24-generic x86_64 bits: 64 compiler: gcc v: 9.3.0
Desktop: Xfce 4.14.2 Distro: Ubuntu 20.04 LTS (Focal Fossa)
Xubuntu Daily Build 18th April 2020

~$: mono --version
    Mono JIT compiler version 6.8.0.105 (Debian 6.8.0.105+dfsg-2 Wed Feb 26 23:23:50 UTC 2020)

Installed from repository since Mono doesn't have the newer one for Focal yet.

Steps to Reproduce:

Open an image or even a blank page, try to use the text tool in it by clicking,try to change the font using the font menu. Hangs repeatedly and font menu never appears.

Terminal Output:

:~$ pinta | cat
Cairo.Surface is leaking, programmer is missing a call to Dispose
Set MONO_CAIRO_DEBUG_DISPOSE to track allocation traces
Cairo.Surface is leaking, programmer is missing a call to Dispose
Set MONO_CAIRO_DEBUG_DISPOSE to track allocation traces
Cairo.Surface is leaking, programmer is missing a call to Dispose
Set MONO_CAIRO_DEBUG_DISPOSE to track allocation traces
Cairo.Surface is leaking, programmer is missing a call to Dispose
Set MONO_CAIRO_DEBUG_DISPOSE to track allocation traces
Cairo.Surface is leaking, programmer is missing a call to Dispose
Set MONO_CAIRO_DEBUG_DISPOSE to track allocation traces
Cairo.Surface is leaking, programmer is missing a call to Dispose
Set MONO_CAIRO_DEBUG_DISPOSE to track allocation traces

Notes:

1> Github version dependencies in 20.04:

~$:Package mono-reference-assemblies-4.0 is not available, but is referred to by another package.
   This may mean that the package is missing, has been obsoleted, or
   is only available from another source
   However the following packages replace it:
     mono-mcs mono-devel
   E: Package 'mono-reference-assemblies-4.0' has no installation candidate

However make install produced no error, Pinta ran fine except this error.

2> I have ttf-mscorefonts-installer package installed from Ubuntu repository. I don't know if it affects the behaviour.

Tags: fonts pinta
bbhtt (bbhtt)
description: updated
Revision history for this message
bbhtt (bbhtt) wrote :
Revision history for this message
Cameron White (cameronwhite91) wrote :

I wasn't able to reproduce on 18.04 with mono 6.6.0.166 from the monodevelop PPA. I'll see if I can get a 20.04 VM going, or hopefully someone else can reproduce?

Revision history for this message
bbhtt (bbhtt) wrote :

I had another machine running Lubuntu 18.04 latest. I could reproduce the same behaviour on it with the system's own mono version 4.6.2 (Debian 4.6.2.7+dfsg-1ubuntu1). After updating to latest Mono and installing mono-devel pakage the terminal showed no error however the fot menu lagged.

This system did to have the ttf fonts package installed.

Log attached.

Revision history for this message
Cameron White (cameronwhite91) wrote :

Hmm, I reverted back to the mono 4.6 version for 18.04, and I just have the lag when first opening the font menu, but it doesn't hang.

Revision history for this message
bbhtt (bbhtt) wrote :

Seems like a Mono bug to me. Any idea why the font menu might lag? I installed a fresh copy of Arch on VM (bare-bones) today to test if my own system was messing something up, and I have the exact same output and error. Only I don't have a way to install the latest Mono or a earlier version on Arch. Arch repo has version 6.4.0 on it. I can attach the log file but it wouldn't be of any use.
Arch gives pinta 1.6 from repo.

Revision history for this message
Cameron White (cameronwhite91) wrote :

I think the lag is either from loading all the fonts, or building the previews for the text menu (or both!)

I set up a clean Ubuntu 20.04 and unfortuantely couldn't reproduce the complete hang with the default Pinta version (1.6), before or after installing the mscorefonts.
Are there any other differences in our setups that you can think of (e.g. maybe you're using a different language / localization, or have other additional fonts installed?)

Revision history for this message
bbhtt (bbhtt) wrote :

Thanks, I forgot I had some extra font installed.I think I've singled out the cause. Seems to be non-latin font packages causing the leak. Can you install these and check?

fonts-wqy-microhei fonts-kacst fonts-baekmuk fonts-indic

Removing them solves the error?

I've attached below my packages after removing above fonts' we can compare each other's package list using vimdiff.

Revision history for this message
bbhtt (bbhtt) wrote :
Revision history for this message
bbhtt (bbhtt) wrote :
Revision history for this message
bbhtt (bbhtt) wrote :
Revision history for this message
bbhtt (bbhtt) wrote :
Revision history for this message
Cameron White (cameronwhite91) wrote :

I tried installing those font packages and it still doesn't hang .. I think we have basically the same set of mono packages as well.
Does attaching a debugger to the process when it hangs provide any useful info?

Revision history for this message
bbhtt (bbhtt) wrote :

I have three logs, one is a kernel call by strace, other is a Valgrind memleak log and MONO_LOG_LEVEL=debug log. I don't see any useful info other than that the same "Cairo.Surface is leaking" is occurring even without those fonts. The only difference after uninstalling the fonts is that the font-menu is actually usable this time. Interestingly other programs cause no issue while loading the font-menu even when extra fonts are installed. And I use the default US locale.

I can attach them if you want.

And on top of this while trying to obtain above logs; Pinta dumped core two times, I have the log files in /var/crash but I don't think this is releated.

Revision history for this message
Cameron White (cameronwhite91) wrote :

Do you get anything useful from running mono in trace mode? (https://www.mono-project.com/docs/debug+profile/debug/)

Revision history for this message
bbhtt (bbhtt) wrote :

I have the log file but it's quite large and somehow sending the SIGUSR signal doesn't start the logging. What should I look for in the log file?

Revision history for this message
Cameron White (cameronwhite91) wrote :

I'd mostly be looking to see where in the code it is when the hang occurs. It's possible that adding an option to disable the font previews might address it, but it could also just be an issue with loading the font which would be harder to work around

Revision history for this message
bbhtt (bbhtt) wrote :

This is the approximate output after/during the time I clicked Text Tool button.
I might need some filters to add to --trace[=EXPR], the hang occurs when I click the text tool icon, the font preview works fine if I don't install too many regional fonts.

Revision history for this message
Cameron White (cameronwhite91) wrote :

Yeah it's hard to tell if there's anything useful there. From the function calls it seems like it was drawing the rectangles around editable text regions, so it sounds like the tool was entered successfully?

Revision history for this message
bbhtt (bbhtt) wrote :

Yeah but after some initial lag, you can't see the dotted text box initially. The tool becomes unusable if I load the regional fonts. Pinta as a whole stops responding and greys out then.

Revision history for this message
nmaxx (nmaxx) wrote :

I can reproduce the text tool hang on Ubuntu 20.04 both on real hardware and in VirtualBox, in both versions 1.6 and 1.7.

Revision history for this message
Cameron White (cameronwhite91) wrote :

Interesting, thanks for the update. Was this done on a clean install, and which Mono version (mono --version in a terminal) were you using?

Revision history for this message
bbhtt (bbhtt) wrote : Re: [Bug 1873628] Re: Pinta hangs on opening fonts while using text tool

I can follow on with this one if you'd like. I'm on groovy proposed now.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, August 17, 2020 1:54 AM, Cameron White <email address hidden> wrote:

> Interesting, thanks for the update. Was this done on a clean install,
> and which Mono version (mono --version in a terminal) were you using?

Revision history for this message
bbhtt (bbhtt) wrote :

This was also reported with a mono stacktrace:

https://github.com/mono/mono/issues/19727

Revision history for this message
Cameron White (cameronwhite91) wrote :

Thanks, which Mono version do you have on groovy proposed? 6.10 seems to have fixed many of the random crashes

Revision history for this message
bbhtt (bbhtt) wrote :

Mono 6.8.0.105+dfsg-3, 27 Apr 2020 UTC,(the one auto synced from Debian) Pinta is 1.6.2 I think(?). I have a similar stacktrace like the one linked on GitHub. No extra regional fonts installed except those that come with large font family like noto etc. I'll attach another set of logs soon and/or use the mono ppa to upgrade a release.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, August 17, 2020 1:08 PM, Cameron White <email address hidden> wrote:

> Thanks, which Mono version do you have on groovy proposed? 6.10 seems to
> have fixed many of the random crashes

Revision history for this message
grofaty (grofaty) wrote :

1. Can you try installing Mono 6.10 from Mono PPA:
https://www.mono-project.com/download/stable/#download-lin-ubuntu
and then retry to reproduce the problem.

2. Can you try installing Pinta from snap package to confirm the problem is the same (Pinta snap package already contains Mono 6.10):
sudo snap install pinta-james-carroll
pinta-james-carroll.pinta

After test if you want to remove snap package:
sudo snap remove pinta-james-carroll

Revision history for this message
bbhtt (bbhtt) wrote :

Checked with mono 6.10.0.104 and 6.12.0.86 on Pinta 1.6.2, exactly the same error with same lag.

The snap package of Pinta is 1.7, is better responsive (works!) than the native system package but the same output when piped.

For some reason the snap package collided with native package, so had to start it like this:

# /snap/bin/pinta-james-carroll.pinta|cat

(Pinta:21237): GLib-GIO-WARNING **: 16:46:05.262: Error creating IO
channel for /proc/self/mountinfo: Permission denied (g-file-error-quark, 2)

(Pinta:21237): GLib-GIO-WARNING **: 16:46:30.996: Error creating IO
channel for /proc/self/mountinfo: Permission denied (g-file-error-quark, 2)

Cairo.Surface is leaking, programmer is missing a call to Dispose
Set MONO_CAIRO_DEBUG_DISPOSE to track allocation traces
Cairo.Surface is leaking, programmer is missing a call to Dispose
Set MONO_CAIRO_DEBUG_DISPOSE to track allocation traces

I would've given you a trace but my terminal crashed suddenly...

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, August 17, 2020 2:56 PM, grofaty <email address hidden> wrote:

> 1. Can you try installing Mono 6.10 from Mono PPA:
> https://www.mono-project.com/download/stable/#download-lin-ubuntu
> and then retry to reproduce the problem.
>

> 2. Can you try installing Pinta from snap package to confirm the problem is the same (Pinta snap package already contains Mono 6.10):
> sudo snap install pinta-james-carroll
> pinta-james-carroll.pinta
>

> After test if you want to remove snap package:
> sudo snap remove pinta-james-carroll

Revision history for this message
Cameron White (cameronwhite91) wrote :

With Mono 6.10 are you getting a crash or a freeze? The issue in https://github.com/mono/mono/issues/19727 sounds like https://bugs.launchpad.net/pinta/+bug/1877235 which most users have reported being fixed in 6.10

Revision history for this message
bbhtt (bbhtt) wrote :

It never "crashed", only lagged and hang when using the text tool or changing fonts.

Yeah same lag with Mono 6.10.0.104, (I checked again) on native pinta 1.6.2 with same Cairo terminal spam.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, August 18, 2020 1:18 AM, Cameron White <email address hidden> wrote:

> With Mono 6.10 are you getting a crash or a freeze? The issue in
> https://github.com/mono/mono/issues/19727 sounds like
> https://bugs.launchpad.net/pinta/+bug/1877235 which most users have
> reported being fixed in 6.10

Revision history for this message
Cameron White (cameronwhite91) wrote :

OK, I think I was getting confused by the link to the github issue, which is a crash in Mono.
And by hang do you mean that it permanently freezes?

Revision history for this message
grofaty (grofaty) wrote :

Can I propose to test exclusively:
- Pinta 1.7 (from Ubuntu Pinta Stable PPA) and
- Mono 6.10 (from Mono Stable PPA)
and compare the tests with Pinta 1.7 snap package.

Every other combination is way less tested and so not supported from Pinta maintainers and quality assurance testers.

I would suggest to completely stop testing Pinta 1.6, because many crashes and freezes were already fixed in Pinta 1.7. We are no longer interested in supporting Pinta 1.6 five years old package.

Revision history for this message
bbhtt (bbhtt) wrote :

If you mean this PPA for Pinta https://launchpad.net/~pinta-maintainers/+archive/ubuntu/pinta-daily and Mono 6.10.0.104 from the Mono download page I'm going to test it and report back.

No not a "permanent" hang/freeze but it freezes if I click with the text tool on a picture, recovers after 1-2 minutes, if clicked again, freezes; while the terminal spams Cairo error during those freeze-recovery gaps.

[...]
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, August 18, 2020 2:59 PM, grofaty <email address hidden> wrote:

> Can I propose to test exclusively:
>

> - Pinta 1.7 (from Ubuntu Pinta Stable PPA) and
> - Mono 6.10 (from Mono Stable PPA)
> and compare the tests with Pinta 1.7 snap package.
>

> Every other combination is way less tested and so not supported from
> Pinta maintainers and quality assurance testers.
>

> I would suggest to completely stop testing Pinta 1.6, because many
> crashes and freezes were already fixed in Pinta 1.7. We are no longer
> interested in supporting Pinta 1.6 five years old package.

Revision history for this message
bbhtt (bbhtt) wrote :

Tested out Pinta 1.7+r1145-202008141548~ubuntu20.10.1 against Mono: Mono JIT compiler version 6.10.0.104 (tarball Fri Jun 26 19:38:44 UTC 2020)

A) The snap version is better responsive overall than the native package.

B) Native Pinta 1.7 with Mono 6.10 doesn't lag when selecting text tool and clicking on a picture, better responsive thatn 1.6.2/Mono 6.0.8. But there is a wait time in between the text tool is clicked and it is ready to write on a picture. I guesss this is normal.

C) It now (native 1.7/6.10) hangs similarly when changing the font while the text tool is selected. The font drop down menu never appears, and pinta hangs each time the drop down menu is clicked,recovers, if clicked again, hangs again essentially making it unusable. Similar output on terminal.

Revision history for this message
Cameron White (cameronwhite91) wrote :

Interesting. That's good that the official 1.7 PPA package works properly. I'm not sure what's different with the snap package, although I suppose it probably has its own version of GTK that's being used instead of the system.

Revision history for this message
bbhtt (bbhtt) wrote :

So I think this is good news, I removed these whole font families,

**at the expense of pdf viewers,printers, some software**

(essentially every font package but not making the system unusable)

# sudo apt-get purge fonts-noto-* fonts-twemoji-svginot fonts-wine fonts-urw-base35 fonts-lyx fonts-mathjax fonts-freefont-ttf fonts-liberation2 fonts-liberation fonts-roboto-unhinted

and the drop down menu works fine (1.7/6.10, no terminal spam). So this is not a permanent solution since after autoremove another whole set of packages will be removed, as these are essential.

Anyone else can reproduce this?

Maybe consider replacing it with a font-box (Notepad/wordpad for example) rather than a drop down?

Revision history for this message
grofaty (grofaty) wrote :

kortewegdevries, did you uninstall all those font family at once? If I understand now Pinta works fine. Can you install one font family after another and test Pinta each time. Maybe there is one font family that produces problems in Pinta. And then if you find out font family that causes the problem in Pinta, can you delete individual font and retest in Pinta. Maybe there is just one font that causes trouble - if this is true, then we can skip that font in Pinta and not display it in Pinta font list.

Revision history for this message
bbhtt (bbhtt) wrote :

Yeah I uninstalled them all at once. I'll try singling out the font/family but I need ome time to do this.

Meanwhile,I think it is not a particular font/family but rather the number of fonts causing the problem, per my obervation in # 7 of this thread [1]. If that's the case, you can never control which font to skip, because softwares often install their own: for example minetest game installs droid-fallback I think, there are large meta packages like https://packages.ubuntu.com/groovy/fonts-indic or Math/printing fonts etc.

Hopefully someone can reproduce [1] to confirm my observation.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Thursday, August 20, 2020 3:12 PM, grofaty <email address hidden> wrote:

> kortewegdevries, did you uninstall all those font family at once? If I
> understand now Pinta works fine. Can you install one font family after
> another and test Pinta each time. Maybe there is one font family that
> produces problems in Pinta. And then if you find out font family that
> causes the problem in Pinta, can you delete individual font and retest
> in Pinta. Maybe there is just one font that causes trouble - if this is
> true, then we can skip that font in Pinta and not display it in Pinta
> font list.

Revision history for this message
bbhtt (bbhtt) wrote :

Found them, fonts-noto-*,esp. these, in order of causing more hangs:

Get:1 http://us.archive.ubuntu.com/ubuntu groovy/main amd64 fonts-noto-cjk all 1:20190410+repack1-2 [55.7 MB
Get:2 http://us.archive.ubuntu.com/ubuntu groovy/universe amd64 fonts-noto-extra all 20200323-1build1 [68.8 MB]
Get:6 http://us.archive.ubuntu.com/ubuntu groovy/universe amd64 fonts-noto-ui-extra all 20200323-1build1 [11.9 MB]
Get:3 http://us.archive.ubuntu.com/ubuntu groovy/universe amd64 fonts-noto-ui-core all 20200323-1build1 [1,326 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu groovy/universe amd64 fonts-noto-hinted all 20200323-1build1 [3,992 B]
Get:7 http://us.archive.ubuntu.com/ubuntu groovy/universe amd64 fonts-noto-unhinted all 20200323-1build1 [252 kB]

Collectively the noto fonts occupy 779 MB storage/290 MB download which was a surprise to me!

[A] I tested only the noto fonts installed, removing this whole: ( fonts-freefont-ttf fonts-liberation fonts-liberation fonts-lyx fonts-mathjax fonts-noto-color-emoji fonts-roboto-unhinted fonts-urw-base35 fonts-wine )

The noto-fonts alone caused hangs/lags esp. 1,2,6. Removing 1,2,6 it was better responsive but not super fast compared to no noto-fonts and only the glob in [A] installed...

So I would conclude that larger the package of fonts the more time the menu needs to build a preview for them hence causing the lag. This is in agreement with regional font metapackages which are also large but not that much!

Revision history for this message
bbhtt (bbhtt) wrote :

Same observation as above on Mono 6.8.0.105/pinta 1.6-2...

If you want to restrict fonts to reduce load the lyx package and other math/technical fonts can be restricted also since they render as weird boxes on the drop-down menu and I guess very few people will use them on a picture...

Revision history for this message
Cameron White (cameronwhite91) wrote :

Thanks, it sounds like this might just be a duplicate of bug 1311873 where all of the font previews are being forced to load

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.