Caja thumbnails are deleted during each login and logout! (only on 32bit)

Bug #1468794 reported by Oliver Joos
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
mate-settings-daemon (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Won't Fix
Low
Martin Wimpress 

Bug Description

I tested the new Mint 17.2 MATE rc.
Whenever I logout all thumbnail files in ~/.cache/thumbnails/normal/* are deleted.
I did not find the exact culprit. What I found out so far:

    - "caja -q" does not delete the thumbnails
    - write-protecting helps: "chmod a-w ~/.cache/thumbnails/normal"
    - a script in /etc/X11/Xreset.d/ is called too late to prevent the deletion
    - symbolic linking ~/.cache/thumbnails from or to ~/.thumbnails does not help

First I tried this with a Live USB stick. Then I thought it might be a special "feature" for USB sticks. So I updated my Mint 17.1 to 17.2. But thumbnails on a harddrive are lost too during logout. To upgrade I followed http://mintguide.org/system/448-early-update-linux-mint-17-1-rebecca-to-linux-mint-17-2-rafaela.html

Fedora seems to have had this problem too:
https://bugzilla.redhat.com/show_bug.cgi?id=1048409
https://bugzilla.redhat.com/show_bug.cgi?id=1120809

Tags: patch xenial
Revision history for this message
Oliver Joos (oliver-joos) wrote :

I guess this bug is in mate-settings-daemon because Fedora fixed one there which sounds very similar.

description: updated
Revision history for this message
Oliver Joos (oliver-joos) wrote :

This bug is especially bad because Mint 17.2 includes about 100 (nice) wallpapers.
Whenever I open the "Background Settings" window the first time after a login it freezes for about 30sec on my 2GHz Single-Core Laptop. Enough for a novice to pull the plug...

Revision history for this message
omelette (omelette-oceanfree) wrote :

I can confirm this bug too, and that it originates with the 'housekeeping' plugin of 'mate-settings-daemon'. It occurs both at startup and logout. Renaming the plugin so that it can no longer be installed stops the thumbnails being purged.

I have also built the package from Git and the problem persists. 2 checks are made made during 'housekeeping', one for old thumbnails, the other for overall thumbnail-cache size. I found that if I modified the code to disable one check, the other check ends up deleting the thumbnails anyway!

This is really annoying as it exacerbates an already annoying Mate/Caja bug where, when thumbnails are being generated during an audio-preview, Caja will often freeze permanently.

Revision history for this message
Oliver Joos (oliver-joos) wrote :

Thank you for confirming! You found the exact file where this bug hides: housekeeping.so! Renaming this housekeeping.so works here too. But I recommend a nicer way to deactivate the faulty plugin. Execute this in a Terminal:

    gsettings set org.mate.SettingsDaemon.plugins.housekeeping active false

If you have Gnome (not MATE) you might want to try:
    gsettings set org.gnome.settings-daemon.plugins.housekeeping active false

Me too, I think that this bug is quite high prio because it affects all caja users, like most Mint MATE users.

Revision history for this message
omelette (omelette-oceanfree) wrote :

Hi. Thanks, appreciate the info. You will be glad to know that I have managed to fix the bug in 'housekeeping' as well, although I'm not a good-enough coder to explain why it occurs!

Referring to 'msd-housekeeping-manager.c' available on Git, I figured out that function 'int_gsettings_mapping' (called via function 'get_max_age') was returning a max_age value of zero, when it should have been returning 180 (6 months) as defined at the start of the code. I was mystified to find however that just adding a "g_debug" line to 'int_gsettings_mapping', but placed AFTER the "gint32" line, magically fixes the problem! Placed before the 'gint32' line, the bug is back!!! (see attachment).

Anyway, I've built it and it seems ok. Since we seem to be the only ones currently aware of this in-you-face problem, I'm beginning to suspect that it's 32-bit related - have you a 32 or 64-bit installation?

The Git build is also a bit different to what's available in the repository. It seems to incorporate 'mate-settings-daemon-common', so doesn't have any dependencies. It also stashes everything in /usr/local and needs to be set to autorun manually. I'd advise you to build it yourself, but if you're interested, I'll provide a download-link to the package from the thread you started in the Mint forum.

Revision history for this message
Oliver Joos (oliver-joos) wrote :

Good point, I have 32bit!
I just checked a 64bit Live USB stick of Mint 17.2 on a 64bit hardware: no bug! thumbnails are not deleted!
I hope I have time soon to look deeper into this.
Could you please post a link to the GIT repo you mean?

I don't fully understand either your fix with gdebug(). I saw similar issues with printf() and GCC on microcontrollers. There it was caused by vargs (va_start, va_end, ect.) used in functions like printf() and probably also gdebug().
And I remember a similar 32bit-only-bug that affects me since years: bug 1081019
But both thoughts are just wild guesses yet! Don't waste too much time with them.

Revision history for this message
omelette (omelette-oceanfree) wrote :

The link to clone with git - https://github.com/mate-desktop/mate-settings-daemon. The link to housekeeping plugin code - https://github.com/mate-desktop/mate-settings-daemon/blob/master/plugins/housekeeping/msd-housekeeping-manager.c.

Thanks for confirming the 32-bit thing. Although I have another 64-bit pc, downloading 64-bit Mint and installing over another Linux was too much to contemplate!

Like I said, I don't understand the 'g_debug' fix either - but I can assure you that it works. After playing with it some more, I find that if the 'g_debug' function-call is included anywhere after the 'gint32' line in 'int_gsettings_mapping', the calling function receives the correct value of max_age, otherwise it returns zero.

I'm debugging this only with the aid of the 'g_debug' output as well, so as you can imagine, when I include one in 'int_gsettings_mapping' to monitor values, I'm unintentionally fixing the problem if placed after the 'gint32' line - a real chicken-and-egg problem. My only real programming is with Delphi, I really don't have a clue what Linux developers use to debug stuff - I'm sure they don't rely on g_debug though!

No matter, I'm satisified, as there's one thing less to worry about. If I can get Mint/Mate working properly, I can stop using Ubuntu 10.04 (sob) and I'll be set till 2019! That audio-preview during thumbnail-generation bug is a real downer though. Have you experienced this on your setup?

summary: - Caja thumbnails are deleted during a logout!
+ Caja thumbnails are deleted during each login and logout! (only on
+ 32bit)
Revision history for this message
Oliver Joos (oliver-joos) wrote :

Yes, I can reproduce this "audio-preview during thumbnail-generation freezes caja" bug too! :-(

Did you already find a LaunchPad bug number about this issue?

Changed in linuxmint:
status: New → Confirmed
Revision history for this message
omelette (omelette-oceanfree) wrote :

Yes, I came across it already, though I was mystified by how little reaction there is to what I consider another serious bug.

I've been looking through the source-code for this and it looks complicated! It's also littered with "FIX-ME" comments throughout, so it looks like the developers have their work cut out for themselves! I thought an easy-fix might be to simply disable audio-previews altogether while thumbnailing is in progress - that would certainly be a better situation that the one we have at present - but haven't figured out how to do that yet.

Revision history for this message
omelette (omelette-oceanfree) wrote :

For what it's worth, I'm reasonably sure that the Caja-crash brought about by audio-preview while thumbnailing is in progress, has been fixed in the current Caja (1.10.3) - at least I can no longer get Caja to hang because of this. Looking good.

Revision history for this message
omelette (omelette-oceanfree) wrote :

Guess I'm the last 32-bit Mint user left on the planet! Well, we're onto Mint 17.3, and not only is this bug still present, it has gotten much worse - before, generated-thumbnails persisted until a logout or reboot, now they are being cleared mid-session!

Add to that, the other bug concerning audio-previews is alive & well also...

I don't get this, when I compile Caja from the Git repository, the audio-preview bug vanished, yet here we have Caja source bumped from version 1.10 to 1.12, and the bug still exists in the Mint-builds!!! Is it possible that it is the Mint developer(s) that are introducing these problems? They certainly aren't doing any testing on 32-bit setups anyway, that for sure!

And it would be infinitely easier to build these Mate packages if the Mint packages contained the same components that the Git-Mate packages do - which of course, being Mint, they don't! Bloody frustrating...

Revision history for this message
Vlad Orlov (monsta) wrote :

Hi guys,

Thanks a lot for pinpointing the buggy place in the code. Can you try this commit and check if it fixes the problem?

https://github.com/mate-desktop/mate-settings-daemon/commit/f8c4993100f997509ee488e80aed440cd63b19d1

Since that file hasn't been changed since Dec 2014, the commit should apply fine in 1.10 or 1.12.

Revision history for this message
Vlad Orlov (monsta) wrote :

Guys... aren't you interested in getting this issue fixed?

Revision history for this message
Oliver Joos (oliver-joos) wrote :

I just tested Linux Mint MATE 18.0 on a live USB stick and this bug seems to be fixed!
Thumbnails are not deleted anymore upon logout or login.

I checked the 32bit iso image on a 32-bit hardware and on a 64-bit hardware: this bug is fixed on both. (although the latter is not a recommended setup)

But I think this bug should not be closed yet, since it is not fixed in Mint 13.x and 17.x which both have LTS.

Revision history for this message
omelette (omelette-oceanfree) wrote :

I'm fairly happy with my present setup. I rebuilt 3 packages from git, including Caja, but since Caja shares dependencies with (at least) mate-control-panel, I had to build Caja as caja-common (so no Caja per-se) - in other words, its a bit of a mess, but everything is installed and all are working happily together! So checking to see if the current git-fix works is out of the question for me.

I'll probably give Mint 18 a try, seeing as these bugs have been removed. Although I've been waiting for clarification (from the forum(s)) as to why Samba is AWOL in 18 - 'slow boot-time' doesn't cut it, as this is an essential package imo, at least the way I work.

I'm also hoping that Mate has made the move to Gnome3 relatively unscathed - especially since the latest Gnome3 on Fedora 24 is still not as usable as the final version of Gnome2 was/is, what's that, 5 years on! One nice thing about Mate 1.13 is that it now audio-previews Opus-encoded audio files.

Revision history for this message
Vlad Orlov (monsta) wrote :

No need for some complex rebuilding from git master. You just need to checkout 1.12 branch and apply the patch to it, and it should build fine in 17.3.

As for Mint 18, it wasn't actually fixed there yet. There's still the same undefined behavior in the code, so the bug might show up or not, it's kind of random. So you're lucky it doesn't happen there. :)

Revision history for this message
Vlad Orlov (monsta) wrote :

Here's the patch for mate-settings-daemon 1.12. Should fix it for good.

tags: added: patch xenial
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "fix-thumbnail-cleaning.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

Changed in mate-settings-daemon (Ubuntu):
status: New → Fix Released
Changed in mate-settings-daemon (Ubuntu Xenial):
assignee: nobody → Martin Wimpress (flexiondotorg)
importance: Undecided → Low
status: New → Triaged
no longer affects: linuxmint
Revision history for this message
Oliver Joos (oliver-joos) wrote :

As reporter of this bug I confirm that I cannot reproduce it anymore in Linux Mint 18.3 32bit.

Revision history for this message
Vlad Orlov (monsta) wrote :

It should be fixed since mate-settings-daemon 1.14.1.

Technically, it should still affect 1.12.1 in Ubuntu 16.04, but I was unable to reproduce it there. Tried several times in a 32-bit VM.

Changed in mate-settings-daemon (Ubuntu Xenial):
status: Triaged → Won't Fix
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.