Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ejecting USB Drive after using Time Shift causes Cinnamon process to gobble up memory until it crashes #9926

Open
LunchBoxStevieC opened this issue Feb 13, 2021 · 25 comments

Comments

@LunchBoxStevieC
Copy link

LunchBoxStevieC commented Feb 13, 2021

 * Cinnamon version 4.8.6
   - Please specify if you are using the daily builds PPA    -- NO
   - * Distribution - Linux Mint 20.1 Ulyssa base: Ubuntu 20.04 focal
 * Device-1: Intel UHD Graphics vendor: Lenovo driver: i915 v: kernel
 * 64 Bit
 * Attach ~/.xsession-errors, or /var/log/syslog   (Nothing in the log when it happened) and it won't let me attach it here. (Unsupported file type)

**Issue**
After using Time Shift and you eject the USB drive using the button in the system tray will cause the Cinnamon process to start gobbling up copious amounts of memory quickly until Cinnamon completely freezes / crashes.  


**Steps to reproduce**
-Plug in USB drive,  run Time Shift and create a restore point.  Wait until it completes.   
-Exit time Shift.  
-Click on "Eject" icon in the system tray to unmount the USB drive volume
-Monitor Cinnamon Process in HTOP (or similar) you will notice the memory consumption rapidly rise until Cinnamon crashes.

**Expected behaviour**
USB Drive to be ejected normally without memory consumption by Cinnamon after using Time Shift


**Other information**
Ejecting the same mounted USB drive without running Time Shift first does not cause this problem so it is something related to the action of running Time Shift and creating a restore point, then exiting then un-mounting the USB drive via the eject button in the system tray.

If you just exit Time Shift with the USB drive still attached and mounted the memory consumption doesn't change.  If you mount / eject the USB drive without running Time Shift first, the memory consumption doesn't change.  Only when these actions are performed in the order described above.

EDIT 02-13-2021 - Further information discovered:

Connecting the USB drive (dev/sda1) mounts in /media/<my username>/<volume_name>
Running Time Shift changes (dev/sda1) mount to /run/timeshift/backup

I proceeded to create a restore point as usual and then closed Time Shift and observed with DF again and nothing changes. dev/sda1 is still mounted to /run/timeshift/backup.

I clicked on the "Eject" button in the system tray on the USB drive and although Cinnamon says it's now safe to remove, nothing changes with regard to the DF view. /run/timeshift/backup is still mounted. I also noted it's byte sizes does not change either.

I tried a sudo umount operation on /run/timeshift/backup, it completes but doesn't stop the memory problem with the Cinnamon process.

The Cinnamon process continues gobbling up memory until it eventually runs out and starts freezing the OS before it crashes all together.

**Configuration info, if applicable**
N/A


Please paste here

@arehtykitna
Copy link

arehtykitna commented Feb 13, 2021

I can also confirm this issue. I have recreated the same problem on LMDE4 and Mint 20.1 versions of Cinnamon 4.8.x

Cinnamon 4.6.x was not affected. System info: https://termbin.com/2qm5x

@Tibladar
Copy link
Contributor

Confirming as well.
It doesn't have to be a USB stick, it can also be a hard drive and can be triggered with other apps as well (e.g. wine with a wine prefix on a harddrive)

Linux Mint 20.1 with Cinnamon 4.8.6

@LunchBoxStevieC
Copy link
Author

Thanks for adding this. I appreciate it.

@erebus-oneiros
Copy link

This has happened to me at multiple instances with HDD running out of memory and Cinnamon freezing. LM 19.3.

@NikoKrause
Copy link
Member

NikoKrause commented Feb 27, 2021

Do you by any chance have the timeshift applet installed?

@LunchBoxStevieC
Copy link
Author

Do you by any chance have the timeshift applet installed?

I don't. :(

@NikoKrause
Copy link
Member

Anything else unusal or different in your settings compared to default settings?

@LunchBoxStevieC
Copy link
Author

LunchBoxStevieC commented Feb 27, 2021

Anything else unusal or different in your settings compared to default settings?

Nothing different than default. Rsync option, and exclude /home when asked in the initial setup.

@icarter09
Copy link
Member

@LunchBoxStevieC how long did it take for cinnamon to crash once Timeshift was finished?

@LunchBoxStevieC
Copy link
Author

@LunchBoxStevieC how long did it take for cinnamon to crash once Timeshift was finished?

You have to eject the USB drive from the system tray, then you will see the memory climb steadily until it starts swapping excessively to the disk at this point the computer becomes unresponsive and slow with choppy video and then it locks up. I'd say it takes about 5-10 minutes depending on how full the memory was before this and the total memory in the PC. I have 16gb so it takes a bit.

@icarter09
Copy link
Member

I've followed the steps, but so far haven't had any luck reproducing this issue. Tried several times to create a restore point, then eject the USB drive via the system tray, but cinnamon has yet to crash.

@LunchBoxStevieC
Copy link
Author

LunchBoxStevieC commented Feb 28, 2021

I've followed the steps, but so far haven't had any luck reproducing this issue. Tried several times to create a restore point, then eject the USB drive via the system tray, but cinnamon has yet to crash.

The only thing I can think of is maybe it's since the upgrade to the latest version of Mint from the previous that caused it? I haven't had a chance to try on a fresh install to see if it was the upgrade process that caused it. But I'm able to be duplicated on both my machines (Lenovo and Dell) (which have been upgraded to the latest Mint from their original version) and also confirmed by: arehtykitna

@Tibladar
Copy link
Contributor

The only thing I can think of is maybe it's since the upgrade to the latest version of Mint from the previous that caused it?

You mean from 19.* -> 20.* or from 20 -> 20.1?
I upgraded from a fresh installed 20 -> 20.1

@arehtykitna
Copy link

arehtykitna commented Feb 28, 2021

It's not the upgrade, it happens on my clean install of Mint 20.1 still (part of the reason I tried the clean install). I also don't have any odd settings other than disabling the schedule completely in Timeshift, do not use the Timeshift applet as I wasn't aware it even existed until I read of it in the emails generated from this thread. The removable drives I use for Timeshift are ext4 in a USB enclosures. I'm not convinced it's solely related to Timeshift and the drives being locked by that process though. I'd focus on nemo, there were some patches released for it yesterday so lets see if they help.

EDIT - the cinnamon, nemo and python patches seem to have helped, the RAM usage climbed from 68 MiB to 75 MiB but has stopped instead of spiralling out of control this time. Can you guys verify the same?

@LunchBoxStevieC
Copy link
Author

LunchBoxStevieC commented Mar 1, 2021

Nope still does it... Just did a Time Shift backup 20 -> 20.1

@arehtykitna
Copy link

Just did a Time Shift backup 20 -> 20.1

That's not very clear, 20 -> 20.1 would indicate a restoration of an upgrade rather than a creating a snapshot.

In any event, after the Python cinnamon and nemo updates have been applied you also need to restart the machine for them to have a proper effect.

@LunchBoxStevieC
Copy link
Author

All updates were applied before backing up yesterday and a reboot was done as there was a Kernel update in there as well.

With regards to 20 -> 20.1 I was referencing the version I was on and the version I went to as we thought the upgrade might have something to do with it, but it appears that other users in this thread also can confirm the problem on fresh installs as well.

@LunchBoxStevieC
Copy link
Author

Ok I put a spare hard drive in my Dell and loaded a fresh copy of Mint 20.1 on it. I did the updates that were available and setup nothing else. Ran the Time Shift setup and created a back-up and ran it. Closed Time Shift and waited 20 minutes. No memory leak. As soon as I ejected my Sandisk 256gb USB drive it started gobbling memory.

I tried this as well ejected it using the file manager and disk manager and same thing. So it's definitely connected to having run Time Shift.

I tried another USB drive that was 64gb and tried an external drive I have and same issue.

@LunchBoxStevieC
Copy link
Author

LunchBoxStevieC commented Mar 16, 2021

Update: I now only seem to have the problem ejecting the USB drive using the button in the system tray and not if I eject it using the File Manager. This has changed recently I guess due to updates. This partial fix of the problem has been duplicated on the other system that had it as well.

We are getting closer!

@dawithers
Copy link

Thanks for this! I just found this after seeing the same thing. I'm only seeing it with the removable drives applet in the panel and not when I do it from the file manager. I spent an hour or two narrowing down exactly what steps led to what and then was able to do a search that brought me here. The description here is perfect.

@LunchBoxStevieC
Copy link
Author

Thanks for confirming it along with us.

@Ahmed-E-86
Copy link

Ahmed-E-86 commented Apr 24, 2021

I have the same issue. I did a fresh installation of Linux Mint 19 yesterday, and updated it to 19.1.

@Ahmed-E-86
Copy link

Ahmed-E-86 commented Apr 29, 2021

I installed Linux kernel 5.11.17 using Mainline, and Ejecting USB drives from Removable drive applet does not cause memory leak anymore, and all the weird lockups and graphical glitches are gone as well.

Edit:
I also updated the Linux Firmware using this PPA >> https://launchpad.net/~darxus/+archive/ubuntu/linux-firmware-amdgpu-daily

@LunchBoxStevieC
Copy link
Author

Yeah I noticed the Graphical Glitches as well. Was hoping that would resolve itself in successive updates but it seems persistent. Those I can live with. But good to know that rolling back to 5.11.17 fixes both issues.

I'm hesitant to do that myself because I don't know what security patches I'd be giving up.

Thanks for the information, I appreciate it. :)

@Ahmed-E-86
Copy link

I updated both the Linux kernel, and Linux Firmware at the same time. I am not sure which one fixed the issues.

You can update the Linux Firmware using this PPA >> https://launchpad.net/~darxus/+archive/ubuntu/linux-firmware-amdgpu-daily

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants