gnome-shell-calendar-server leaks GBs of memory every few days

Bug #1885346 reported by Heewa Barfchin
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gnome-shell (Debian)
Fix Released
Unknown
gnome-shell (Ubuntu)
Fix Released
High
Unassigned
Focal
Fix Released
High
Unassigned

Bug Description

[ Impact ]

gnome-shell-calendar-server memory usage increases daily

[ Test case ]

Monitor the memory usage of gnome-shell-calendar-server process using top or similar tools and ensure that its memory usage is stable.

[ Regression potential ]

Events in gnome-shell calendar aren't visible anymore

---

It's been happening repeatedly over the last maybe week? I have to manually kill it about once a day, when I start to feel everything slow down as the OS starts to swap.

Actually, I tracked down and fixed a few leaks in the code, and it looks stable so far. I'll submit a patch soon, as well as send the fix upstream to Gnome.

Revision history for this message
Heewa Barfchin (heewa) wrote :

I'll create a patch once this merge request to gnome-shell repo is finalized: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1335

Changed in gnome-shell (Ubuntu):
assignee: nobody → Heewa Barfchin (heewa)
importance: Undecided → High
status: New → In Progress
tags: added: focal groovy
Revision history for this message
Felipe Castillo (fcastillo.ec) wrote :

I wanted to add that the memory leak is getting out of hand. After a couple of days, I'm using almost 12GiB of RAM!!! I'm lucky to have enough RAM that I didn't really notice this problem.
I also wanted to draw attention to evolution-calendar-factory, which I'm guessing is probably part of the problem as well, which is using a total of ~3GiB.

Revision history for this message
Heewa Barfchin (heewa) wrote :

Sorry, I also have a lot of ram and a lack of urgency! The bug is fixed in Gnome's repo (via a backport of a larger changeset, not my fix), but a release hasn't been made yet. I'll work on getting my (smaller, easier to review for package maintainers) fix into ubuntu as a patch, to hold things over until theirs makes it down.

Revision history for this message
Heewa Barfchin (heewa) wrote :

Submitted patch to Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964851

I'm not sure if I'm doing everything correctly, this is my first time. Just trying to follow guides I find online and respect various parties' process preferences. Hope the fix gets to you soon.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please follow the instructions of the gnome-shell maintainer here:

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1335

Revision history for this message
Heewa Barfchin (heewa) wrote :

Sorry for the trouble. I'm trying to follow all the directions I find in several places across 3 organizations (Ubuntu, Gnome, Debian), plus asking people in 3 or 4 different Gnome & Ubuntu related IRC channels, but I'm not always sure what the right thing for to do is.

That Gnome maintainer didn't ask me to do anything in relation to fixing this bug, did he? He mentioned that he backported changes that fixed the memory leaks. So the leaks are fixed on the 3.36 branch in the vendor repo.

The reason I submitted a patch, however, is that Gnome hasn't cut a new release of the 3.36 branch with the backported fixes yet. So what should Ubuntu/Debian do about the memory leak in the meanwhile? From what I understand of Ubuntu & Debian's package maintenance practices, patches are created to fix bugs in upstream code until upstream releases fixes for them. Is that correct?

I'm happy to do what Ubuntu would like in this situation. Please advise.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I found the fixes. They are already coming in the next update...

tags: added: fixed-in-3.36.4 fixed-in-3.37.1 fixed-upstream
Changed in gnome-shell (Ubuntu):
assignee: Heewa Barfchin (heewa) → nobody
status: In Progress → Fix Committed
Revision history for this message
Heewa Barfchin (heewa) wrote :

Nice!

Revision history for this message
Amr Ibrahim (amribrahim1987) wrote :

@Heewa, a general rule in Debian/Ubuntu is to always fix things in upstream first before patching downstream (as long as it’s not a distro-specific patch or packaging bug). This makes it easier for maintainers to cherry-pick fixes or updating to newer versions.

Debian does not really like to diverge from upstream nor apply local patches not approved by upstream, exceptions are for things that are critical, violate the Debian guidelines or don’t integrate well in the Debian distro, and Ubuntu follows that too for things that seem more appropriate to the Ubuntu developers and fit more to the Ubuntu project.

Some people in the GNOME community might tell you differently especially if they are from other distros than Debian.

Revision history for this message
Heewa Barfchin (heewa) wrote :

@amribrahim1987 Thanks, Amr.

That makes sense, and I did read that somewhere. It wasn't very obvious to me what is considered "critical". I thought maybe a bug that causes gnome to crash unless the user is knowledgeable enough to know how to diagnose and deal kill a specific obscure process once a day is a worth fixing sooner with a patch, while waiting for upstream changes.

I'm never argued what action I think Daniel or anyone else should take. I simply submitted a patch for consideration. I understand if Daniel or anyone else doesn't want the patch, that's fine.

Revision history for this message
Heewa Barfchin (heewa) wrote :

Actually, I was fairly certain I took a lot of care about this, so I checked, and about a month ago I did ask: https://irclogs.ubuntu.com/2020/06/27/%23ubuntu-desktop.html, and followed the instructions I was given.

Changed in gnome-shell (Debian):
status: Unknown → New
Revision history for this message
Amr Ibrahim (amribrahim1987) wrote :

Yes, what was written in IRC is correct. If you could fix something in an Ubuntu package, file two bugs, one upstream with the proposed fix and another bug with “ubuntu-bug package-name” and link the upstream bug to the Ubuntu bug on Launchpad, and ask to either cherry-pick the fix, after it gets committed upstream, or to update the package to a micro-release that contains the fix (a maintenance release with only bug fixes).

Changed in gnome-shell (Ubuntu Focal):
importance: Undecided → High
status: New → Fix Committed
Changed in gnome-shell (Ubuntu):
status: Fix Committed → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Marco, that doesn't make sense. You have the bug fix committed in focal but not in groovy.

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (4.0 KiB)

This bug was fixed in the package gnome-shell - 3.36.4-1ubuntu1

---------------
gnome-shell (3.36.4-1ubuntu1) groovy; urgency=medium

  * Merge with debian, including new upstream stable release, remaining changes:
    - Replace gnome-backgrounds dep with ubuntu-wallpapers and Suggests
      gnome-themes-standard-data, gnome-backgrounds
    - Add some Recommends:
      + ubuntu-session (| gnome-session) to have the ubuntu session available
      + xserver-xorg-legacy
      + yaru-theme-gnome-shell for the default ubuntu theming
    - Update debian/gbp.conf with Ubuntu settings
    - gnome-shell-common.prerm: Remove deprecated ubuntu theme alternative
    - ubuntu/desktop_detect.patch:
      + add caching for desktop detection to avoid querying the current
        desktop env variable as iterate through the list each time. For the
        time of the Shell process, we can expect this env variable to stay
        stable.
    - ubuntu/smarter_alt_tab.patch:
      + quick alt-tab (without showing up the switcher) switch only between
        the last window of the last 2 applications to be focused instead of
        raising all windows of those apps.
    - ubuntu/lightdm-user-switching.patch:
      + Allow user switching when using LightDM.
    - ubuntu/lock_on_suspend.patch
      + Respect Ubuntu's lock-on-suspend setting.
    - ubuntu/background_login.patch
      + Change default background color as we modified the default GDM color
        for our ubuntu session.
    - ubuntu/gdm_alternatives.patch
      + Add support for GDM3 theme alternatives
    - optional-hot-corner.patch
      + enable patch proposed by upstream developer already in package (but
        not in series) to add a settings for optional hot corner activation.
    - main-show-an-error-message-on-gnome-shell-crash.patch,
      global-make-possible-to-set-debug-flags-dynamically.patch,
      main-increase-the-granularity-of-backtraces-in-SHELL_DEBU.patch,
      main-add-backtrace-crashes-all-and-backtrace-all.patch,
      sessionMode-add-support-for-debugFlags-parameter.patch:
      + Improve debug JS tracing for crash reports
    - st-scroll-view-Handle-the-case-where-scrollbars-are-NULL.patch:
      + Fix crash on theme changes
    - ubuntu/search-call-XUbuntuCancel-method-on-providers-when-no-dat.patch:
      + stop searches when requested from UI
    - magnifier-Show-cursor-when-magnifier-is-enabled-and-scale.patch:
      + Show monitor scaled cursor when magnifier is enabled
    - Break gnome-shell-extension-desktop-icons (<< 19.01.3+git20190814)
  * d/p/ubuntu/gdm_alternatives.patch,
    d/p/ubuntu/secure_mode_extension.patch:
    - Refreshed as pr upstream changes

gnome-shell (3.36.4-1) unstable; urgency=medium

  * New upstream stable release (LP: #1888060)
    - Hide switch-user button on lock screen if unsupported
    - Improve world clocks styling
    - Improve calendar-server performance (Closes: #964851, LP: #1885346)
    - Fix regressions in redesigned modal dialogs (LP: #1871868)
    - Better support sandboxed apps with multiple .desktop files
    - Fix on-screen keyboard size in portrait orientation
    - Support scrolling anywhere in slider menu items
    - Fix...

Read more...

Changed in gnome-shell (Ubuntu):
status: In Progress → Fix Released
Changed in gnome-shell (Debian):
status: New → Fix Released
description: updated
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Heewa, or anyone else affected,

Accepted gnome-shell into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gnome-shell/3.36.4-1ubuntu1~20.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed verification-needed-focal
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Heewa (or others affected), could you please check that the proposed update fixes this for you?

Revision history for this message
Heewa Barfchin (heewa) wrote :

As requested in, I installed and ran gnome-shell 3.36.4-1ubuntu1~20.04.1, from focal proposed. I followed the steps that I previously was able to reproduce this issue with, and didn't see a similar memory-growth behavior (when looking at top). I hope this helps.

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (4.1 KiB)

This bug was fixed in the package gnome-shell - 3.36.4-1ubuntu1~20.04.1

---------------
gnome-shell (3.36.4-1ubuntu1~20.04.1) focal; urgency=medium

  * No change backport to focal

gnome-shell (3.36.4-1ubuntu1) groovy; urgency=medium

  * Merge with debian, including new upstream stable release, remaining changes:
    - Replace gnome-backgrounds dep with ubuntu-wallpapers and Suggests
      gnome-themes-standard-data, gnome-backgrounds
    - Add some Recommends:
      + ubuntu-session (| gnome-session) to have the ubuntu session available
      + xserver-xorg-legacy
      + yaru-theme-gnome-shell for the default ubuntu theming
    - Update debian/gbp.conf with Ubuntu settings
    - gnome-shell-common.prerm: Remove deprecated ubuntu theme alternative
    - ubuntu/desktop_detect.patch:
      + add caching for desktop detection to avoid querying the current
        desktop env variable as iterate through the list each time. For the
        time of the Shell process, we can expect this env variable to stay
        stable.
    - ubuntu/smarter_alt_tab.patch:
      + quick alt-tab (without showing up the switcher) switch only between
        the last window of the last 2 applications to be focused instead of
        raising all windows of those apps.
    - ubuntu/lightdm-user-switching.patch:
      + Allow user switching when using LightDM.
    - ubuntu/lock_on_suspend.patch
      + Respect Ubuntu's lock-on-suspend setting.
    - ubuntu/background_login.patch
      + Change default background color as we modified the default GDM color
        for our ubuntu session.
    - ubuntu/gdm_alternatives.patch
      + Add support for GDM3 theme alternatives
    - optional-hot-corner.patch
      + enable patch proposed by upstream developer already in package (but
        not in series) to add a settings for optional hot corner activation.
    - main-show-an-error-message-on-gnome-shell-crash.patch,
      global-make-possible-to-set-debug-flags-dynamically.patch,
      main-increase-the-granularity-of-backtraces-in-SHELL_DEBU.patch,
      main-add-backtrace-crashes-all-and-backtrace-all.patch,
      sessionMode-add-support-for-debugFlags-parameter.patch:
      + Improve debug JS tracing for crash reports
    - st-scroll-view-Handle-the-case-where-scrollbars-are-NULL.patch:
      + Fix crash on theme changes
    - ubuntu/search-call-XUbuntuCancel-method-on-providers-when-no-dat.patch:
      + stop searches when requested from UI
    - magnifier-Show-cursor-when-magnifier-is-enabled-and-scale.patch:
      + Show monitor scaled cursor when magnifier is enabled
    - Break gnome-shell-extension-desktop-icons (<< 19.01.3+git20190814)
  * d/p/ubuntu/gdm_alternatives.patch,
    d/p/ubuntu/secure_mode_extension.patch:
    - Refreshed as per upstream changes

gnome-shell (3.36.4-1) unstable; urgency=medium

  * New upstream stable release (LP: #1888060)
    - Hide switch-user button on lock screen if unsupported
    - Improve world clocks styling
    - Improve calendar-server performance (Closes: #964851, LP: #1885346)
    - Fix regressions in redesigned modal dialogs (LP: #1871868)
    - Better support sandboxed apps with multiple .desktop files
    - Fix on-scree...

Read more...

Changed in gnome-shell (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for gnome-shell has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.