linuxmint / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
4.57k stars 745 forks source link

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

Open LunchBoxStevieC opened 3 years ago

LunchBoxStevieC commented 3 years ago
 * 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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Thanks for adding this. I appreciate it.

erebus-oneiros commented 3 years ago

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

NikoKrause commented 3 years ago

Do you by any chance have the timeshift applet installed?

LunchBoxStevieC commented 3 years ago

Do you by any chance have the timeshift applet installed?

I don't. :(

NikoKrause commented 3 years ago

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

LunchBoxStevieC commented 3 years ago

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 commented 3 years ago

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

LunchBoxStevieC commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

arehtykitna commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Thanks for confirming it along with us.

Ahmed-E-86 commented 3 years ago

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

Ahmed-E-86 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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