mime definitions causing sigsev in multiple apps
Pre-submit checks
- [x] I checked for similar issues beforehand, but could not find any, not even closed ones. I could not add my bug report to any existing issue.
- [x] I am going to take the time to to fill in all the required details. I know that the bug report will be dismissed otherwise.
Describe the bug
Some weeks ago I reinstalled appimagelauncher. I began having problems with multiple applications crashing. The crashes happened when opening folders with .json or .js files. I have tracked this down to appimage files in ~/.local/share/mime/packages
Expected behavior
Applications can open folders with json and js files.
Steps to reproduce the issue
Install appimagelauncher_3.0.0-alpha-4-gha255.3d42d4c_amd64.deb on Ubuntu 20.04. Applications that depend on mime types related to json and js will crash when opening folder containing such files.
Renaming xml files in ~/.local/share/mime/packages to .xml.bak and running update-mime-database solves the problem.
Screenshots
No response
Distribution and desktop environment
Ubuntu 20.04 using nemo to replace nautilus. Programs known to be affected include gedit, bluefish, nemo.
Installed AppImageLauncher version
appimagelauncher_3.0.0-alpha-4-gha255.3d42d4c_amd64.deb
List of AppImages you tried
This bug does not necessarily affect appimages. It interferes with the system as a whole.
Additional context
When Nemo (or any file manager) enters a folder, it queries each file’s type (to display proper icons, enable previews, etc.). For a JSON file, the flawed MIME info causes a recursive lookup loop. The process keeps chasing the JSON/JS type hierarchy, eventually exhausting memory or stack and crashing the application forum.xfce.org bugs.kde.org . In practice, the folder never fully loads because the MIME lookup for the JSON file never returns, leading to a segfault.
This bug affects multiple file managers and desktops. Reports show Nautilus, Thunar, Dolphin, and even file chooser dialogs all choking on .json or .js files when the underlying MIME info is buggy forum.xfce.org . It wasn’t specific to Cinnamon or Nemo’s code – rather, any program using the GLib/GTK file info APIs or Qt’s MIME routines could hit this issue. In fact, it was identified and filed as a GLib bug (“crash due to infinite recursion in MIME subclassing”) and a fix was introduced in GLib 2.78 to handle such cycles gracefully askubuntu.com . Additionally, the MIME database itself was updated in shared-mime-info 2.4 to remove the contradictory definitions that caused the loop forum.xfce.org
appimage mime files apparently are one of the culprits in causing this recursive search and segfault.