Red Hat Bugzilla – Bug 1464632
Mousepad does not handle multiple windows and lengthy runs very well
Last modified: 2018-01-19 14:36:35 EST
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):
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:
-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 \
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
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
Mousepad opens 10 windows that are all responsive and functional. Mousepad will not leak memory. Mousepad will use a reasonable amount of CPU.
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).
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.
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
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'
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.
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
Thank you for reporting this bug and we are sorry it could not be fixed.