Bug 1464632

Summary: Mousepad does not handle multiple windows and lengthy runs very well
Product: [Fedora] Fedora Reporter: Kyle Marek <psppsn96>
Component: mousepadAssignee: Kevin Fenzi <kevin>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: kevin, mikedep333, nonamedotc
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-27 20:31:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kyle Marek 2017-06-24 01:04:51 UTC
Description of problem:
Mousepad uses 100% of a single virtual processor when many windows are open. Mousepad slowly consumes more memory at a rate relative to the amount of windows that are open (or attempted to be opened). Mousepad becomes unresponsive during the 100% CPU usage episodes and often does not become operational again, making users lose anything that was not saved. Sometimes mousepad will open new windows with the title of "Untitled 1" during these episodes, as if they've decided to run independent of the master process (a kind of response to D-Bus timeout?)

Version-Release number of selected component (if applicable):
mousepad-0.4.0-5.fc24.x86_64

How reproducible:
100%

Steps to prepare live environment (if environment is suspected):
1. Run: wget https://download.fedoraproject.org/pub/fedora/linux/releases/25/Spins/x86_64/iso/Fedora-Xfce-Live-x86_64-25-1.3.iso
2. Run the following on a host with a hardware-accelerated hypervisor:
qemu-system-x86_64 \
    -nodefaults \
    -nodefconfig \
    -no-user-config \
    -machine q35,accel=kvm \
    -cpu qemu64 \
    -smp cores=1 \
    -m 1G \
    -device virtio-vga \
    -device virtio-net-pci,netdev=eth0 -netdev user,id=eth0 \
    -device virtio-scsi-pci,id=scsi \
    -device scsi-disk,bus=scsi.0,drive=cdrom0 -drive file="Fedora-Xfce-Live-x86_64-25-1.3.iso",format=raw,media=cdrom,id=cdrom0,if=none \
    -monitor stdio
3. Maximize QEMU window before guest initializes a framebuffer if you want more screen space.
4. Run in guest: sudo dnf install -y mousepad

Steps to Reproduce:
1. Run: for i in $(seq 1 10); do mousepad & sleep 1; done

Actual results:
Mousepad will open ~5 windows, consume 100% CPU, struggle to open more windows, slowly leak memory, and spews the following onto the terminal:

(mousepad:10543): GLib-CRITICAL **: g_variant_new_string: assertion 'string != NULL' failed

(mousepad:10543): GtkSourceView-CRITICAL **: gtk_source_style_scheme_get_id: assertion 'GTK_IS_SOURCE_STYLE_SCHEME (scheme)' failed

(mousepad:10543): GtkSourceView-CRITICAL **: gtk_source_style_scheme_manager_get_scheme: assertion 'scheme_id != NULL' failed


Expected results:
Mousepad opens 10 windows that are all responsive and functional. Mousepad will not leak memory. Mousepad will use a reasonable amount of CPU.

Additional info:
While the bug is not isolated to usage in a VM, I gave instructions for my test in a VM to create a more reproducible environment. VM memory may need to be increased if memory leak makes live environment lock up (oom-killer doesn't seem to work as well in Fedora's live environments).

In the VM, I also get the following output from mousepad on terminals:

(mousepad:2056): dconf-WARNING **: failed to commit changes to dconf: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._g_2dfile_2derror_2dquark.Code8: Failed to create file '/home/liveuser.config/dconf/user.GRR72Y': Read-only file system

I believe it is due to the live system implementation. Fedora's live systems are currently rw device mapper snapshots on top of a ro ext4 image. When there is less RAM allocated to overlay the ext4 image than there is free space in the image, Linux device mapper will stop writing and return I/O errors instead, putting the file systems in ro.

When watching top output, I noticed that dconf-service also uses a lot of CPU. On physical hosts (not subject to a read-only file system), I've noticed a consistent 1-2 MiB/s of disk usage that occurs as long as Mousepad is in the 100% CPU condition, and disappears upon killing dconf-service (usually also crashing mousepad).

Since opening many windows locks the main mousepad process, I attempted to work around the issue with mousepad --disable-server, and have found that these independent processes also leak memory with absolutely no activity happening. I observed this in a test where I pasted about 4 MiB of text into 6 mousepad windows: 3 running normal mousepad (shared main process) and 3 --disable-server'd instances, and let them run over the course of the day. Eventually, my 8 GiB of free memory was allocated and 2 GiB of swap was used. I decided to stop the test. Upon killing each of the --disable-server'd instances, something like 5% of my 16 GB of memory was freed for each one (5% being (.05*(16*1000^3))/(1024^2)=762.94 MiB).

Comment 1 Kevin Fenzi 2017-06-24 14:24:19 UTC
So, would you be willing to file this upstream? Or would you like me to do so?

Note that mousepad is pretty inactive upstream these days (last release was about 3 years ago). We have also dropped it a while back from the default package set in the Xfce spin.

Comment 2 Kyle Marek 2017-06-24 20:33:19 UTC
I would think there's a lack of changes upstream because the application is so simple, but there are a lot of bugs on the Xfce bug tracker regarding Mousepad.

Regarding filing upstream, I think this bug is of the same issue: https://bugzilla.xfce.org/show_bug.cgi?id=12134

It looks like the memory leak is connected, too: https://bugzilla.xfce.org/show_bug.cgi?id=12134#c12

Comment 3 Fedora End Of Life 2017-11-16 18:30:55 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 4 Fedora End Of Life 2017-12-12 10:33:20 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 5 Ben Cotton 2018-11-27 17:25:27 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Ben Cotton 2018-11-30 19:18:49 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 7 Kyle Marek 2018-11-30 19:49:14 UTC
I'm guessing the move to GTK3 in Xfce inadvertently fixed the responsiveness issue, however, the memory leak still seems to be present.

I was able to open 400 Mousepad windows in Fedora 29 without the freeze of all the windows connected to the main process. However, after closing all except for the first one, the memory usage was 11.9% of my 8 GiB.

Comment 8 Kyle Marek 2018-11-30 19:51:36 UTC
Upstream marks the dbus-related issue as fixed: https://bugzilla.xfce.org/show_bug.cgi?id=12134

Memory leak must be a different issue...

Comment 9 Mukundan Ragavan 2018-12-19 23:27:22 UTC
The patch in upstream #12134 is already applied in Fedora (was part of 0.4.1). Can this be closed?

Comment 10 Kyle Marek 2018-12-31 02:35:34 UTC
Maybe. Should I file another bug for the memory leak (which I suppose is a different issue)?

Comment 11 Ben Cotton 2019-10-31 20:14:50 UTC
This message is a reminder that Fedora 29 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '29'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 29 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 12 Ben Cotton 2019-11-27 20:31:20 UTC
Fedora 29 changed to end-of-life (EOL) status on 2019-11-26. Fedora 29 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.