#1088617 GNOME Files crash and Tracker3 issue in Debian 12.8 due to JSON Files

Package:
shared-mime-info
Source:
shared-mime-info
Description:
FreeDesktop.org shared MIME database and spec
Submitter:
P9jgW4773EY
Date:
2024-12-19 00:00:02 UTC
Severity:
normal
#1088617#5
Date:
2024-11-28 16:06:24 UTC
From:
To:
Debian 12.8 is (still) suffering from a bug where the presence of .js or .json files in a directory is crashing GNOME Files (Nautilus) and rendering Tracker3 useless. The bug affects GNOME Files 'search' bar, resulting in constant segmentation faults and tracker-services getting stuck in start-stop loops.

Steps to reproduce the GNOME Files crash:

# Create a non-empty .json file
echo '{}' > test.json
# Open the directory in GNOME Files
nautilus .
# Watch GNOME Files crash

If the directory containing the .json file is being indexed by Tracker3, the tracker-miner-fs-3.service is constantly being killed with status=11/SEGV, resulting in a start-stop loop of the tracker-miner.

Steps to reproduce tracker-miner start-stop loop:

# Change to an indexed directory, e.g.
cd Documents/
# Create a non-empty .json file
echo '{}' > test.json
# Open real-time system logs
journalctl -f
# Watch tracker-miner suffer

Recommended Bug fix for Debian Stable 12.8:

It turns out multiple packages, including Tracker3 and Nautilus, depend on the libglib2.0-0 package, which itself recommends the package shared-mime-info that is installed by default on Debian 12. This package had a minor bug a year ago, where the sub-class type for JSON5 documents was defined incorrectly:

https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/275/diffs

The version 2.2-1 containing the bug is still the version currently used by Debian Stable 12.8, while the bug has been fixed in package version 2.4-5, which is already used by Debian Testing.

I was able to fix the bug on my system running Debian 12.8 by creating a simple private backport using the official guide (https://wiki.debian.org/SimpleBackportCreation) and thus installing shared-mime-info_2.4-5~bpo12+1_amd64.deb.
Since it is not obvious to the user that this package is indeed the culprit, I doubt many users will take the same approach.

The bug is affecting the basic usage of the desktop environment, therefore I suggest including a fix for the package in the upcoming update for Debian 12 Bookworm (Debian 12.9).

I am using Debian GNU/Linux 12.8 (Bookworm), kernel 6.1.0-28-amd64, and libc6 2.36-9+deb12u9.

#1088617#10
Date:
2024-12-01 21:27:13 UTC
From:
To:
I tried to reproduce the bug on a fresh Debian 12.8 install and failed.

There were some 21 files/folders on my system in ~/.local/share/mime/ compared to a Debian 12.8 fresh install. They mostly resembled those in /usr/share/mime/. I don't know which script/program placed them wrongly in ~/.local/share/mime/, but deleting everything besides ~/.local/share/mime/packages fixed the bug.

I also did a backtrace and found out that the Segmentation fault is caused by an endless loop of:

(mime=mime@entry=0x7fd4153a675c "application/ecmascript", base=base@entry=0x7fd4153c7224 "text/x-csrc") at ../../../gio/xdgmime/xdgmimecache.c:971

alternating with

 (mime=mime@entry=0x7fd4153cb4c0 "text/javascript", base=base@entry=0x7fd4153c7224 "text/x-csrc") at ../../../gio/xdgmime/xdgmimecache.c:971

Could be related to
https://gitlab.gnome.org/GNOME/glib/-/issues/2833
and
https://gitlab.gnome.org/GNOME/glib/-/commit/adf96047f45c8e07f9a980f75dd416c3631141b3

#1088617#15
Date:
2024-12-18 23:56:02 UTC
From:
To:
Some more information on what triggers the bug:

Apparently ~/.local/share/mime/ gets spammed with files and folders when using the "Integrate and Run" option of AppImageLauncher (https://github.com/TheAssassin/AppImageLauncher) to integrate certain AppImages. Not all AppImages are affected.

This results in segmentation faults. Not only do nautlius und tracker crash handling directories containing JSON Files, also other applications like meld (https://meldmerge.org/) crash at launch with segmentation faults.

Removing the File ~/.local/share/mime/mime.cache fixes the problem immediately.