Bug#1087632: shared-mime-info: Apps crash on folders with *.json files, segfault, loop in mime cache
Ole Langbehn
ole at langbehn.family
Sat Nov 16 14:57:29 GMT 2024
Package: shared-mime-info
Version: 2.2-1
Severity: important
X-Debbugs-Cc: ole at langbehn.family
Dear Maintainer,
on my laptop running Stable, many GUI applications crash when trying to open
files/folders, e.g. nautilus. I debugged on nautilus and produced the
following stacktrace:
#0 __gio_xdg_cache_mime_type_subclass (mime=mime at entry=0x7ffff0e19fbc "text/javascript", base=base at entry=0x7ffff73e60f0 <_gio_xdg_type_textplain> "text/plain") at ../../../gio/xdgmime/xdgmimecache.c:911
#1 0x00007ffff73a6b16 in __gio_xdg_cache_mime_type_subclass (mime=mime at entry=0x7fffeabdde90 "application/ecmascript", base=base at entry=0x7ffff73e60f0 <_gio_xdg_type_textplain> "text/plain") at ../../../gio/xdgmime/xdgmimecache.c:971
#2 0x00007ffff73a6b16 in __gio_xdg_cache_mime_type_subclass (mime=mime at entry=0x7ffff0e19fbc "text/javascript", base=base at entry=0x7ffff73e60f0 <_gio_xdg_type_textplain> "text/plain") at ../../../gio/xdgmime/xdgmimecache.c:971
#3 0x00007ffff73a6b16 in __gio_xdg_cache_mime_type_subclass (mime=mime at entry=0x7fffeabdde90 "application/ecmascript", base=base at entry=0x7ffff73e60f0 <_gio_xdg_type_textplain> "text/plain") at ../../../gio/xdgmime/xdgmimecache.c:971
#4 0x00007ffff73a6b16 in __gio_xdg_cache_mime_type_subclass (mime=mime at entry=0x7ffff0e19fbc "text/javascript", base=base at entry=0x7ffff73e60f0 <_gio_xdg_type_textplain> "text/plain") at ../../../gio/xdgmime/xdgmimecache.c:971
...(lots of cycling, endless loop)
#74763 0x00007ffff73a6b16 in __gio_xdg_cache_mime_type_subclass (mime=mime at entry=0x7fffeabddea4 "application/ecmascript", base=base at entry=0x7ffff73e60f0 <_gio_xdg_type_textplain> "text/plain") at ../../../gio/xdgmime/xdgmimecache.c:971
#74764 0x00007ffff73a6b16 in __gio_xdg_cache_mime_type_subclass (mime=mime at entry=0x7ffff0e19fbc "text/javascript", base=base at entry=0x7ffff73e60f0 <_gio_xdg_type_textplain> "text/plain") at ../../../gio/xdgmime/xdgmimecache.c:971
#74765 0x00007ffff73a6b16 in __gio_xdg_cache_mime_type_subclass (mime=mime at entry=0x7ffff0e19240 "application/json5", base=base at entry=0x7ffff73e60f0 <_gio_xdg_type_textplain> "text/plain") at ../../../gio/xdgmime/xdgmimecache.c:971
#74766 0x00007ffff73a6b16 in __gio_xdg_cache_mime_type_subclass (mime=0x7ffff0e18e18 "application/json", base=base at entry=0x7ffff73e60f0 <_gio_xdg_type_textplain> "text/plain") at ../../../gio/xdgmime/xdgmimecache.c:971
#74767 0x00007ffff73a53fc in __gio_xdg_mime_type_subclass (base=0x7ffff73e60f0 <_gio_xdg_type_textplain> "text/plain", mime=<optimized out>) at ../../../gio/xdgmime/xdgmime.c:844
#74768 0x00007ffff7333631 in g_content_type_guess
(filename=filename at entry=0x7fff54096940 ".ory-cloud.json", data=data at entry=0x7ffff0dfd760 "{\"version\":\"v0alpha0\",\"session_token\":\"ory_st_HllmGbuSTdnHgA557Rb50sh0yEahg6sm\",\"selected_project\":\"00000000-0000-0000-0000-", '0' <repeats 12 times>, "\",\"session_identity_traits\":{\"ID\":\"d8eca34e-6dbf-4f95-9f22-d7aa3"..., data_size=data_size at entry=244, result_uncertain=result_uncertain at entry=0x0) at ../../../gio/gcontenttype.c:857
#74769 0x00007ffff7398c31 in get_content_type
(basename=basename at entry=0x7fff54096940 ".ory-cloud.json", path=path at entry=0x7fffd80fa120 "/home/ole/.ory-cloud.json", statbuf=statbuf at entry=0x7ffff0dfe830, is_symlink=is_symlink at entry=0, symlink_broken=symlink_broken at entry=0, flags=flags at entry=G_FILE_QUERY_INFO_NONE, fast=0) at ../../../gio/glocalfileinfo.c:1410
#74770 0x00007ffff739adb8 in _g_local_file_info_get
(basename=basename at entry=0x7fff54096940 ".ory-cloud.json", path=path at entry=0x7fffd80fa120 "/home/ole/.ory-cloud.json", attribute_matcher=0x7fffd4041100, flags=G_FILE_QUERY_INFO_NONE, parent_info=parent_info at entry=0x55555611c2a8, error=error at entry=0x7ffff0dffa90) at ../../../gio/glocalfileinfo.c:1998
#74771 0x00007ffff739808f in g_local_file_enumerator_next_file (enumerator=0x55555611c260 [GLocalFileEnumerator], cancellable=<optimized out>, error=0x7ffff0dffaf0) at ../../../gio/glocalfileenumerator.c:409
#74772 0x00007ffff72d0bf1 in next_files_thread (task=0x555555d563f0 [GTask], source_object=0x55555611c260, task_data=<optimized out>, cancellable=0x555555c31460 [GCancellable]) at ../../../gio/gfileenumerator.c:787
#74773 0x00007ffff7315793 in g_task_thread_pool_thread (thread_data=0x555555d563f0, pool_data=<optimized out>) at ../../../gio/gtask.c:1454
#74774 0x00007ffff7edc6ca in g_thread_pool_thread_proxy (data=<optimized out>) at ../../../glib/gthreadpool.c:352
#74775 0x00007ffff7edbcfd in g_thread_proxy (data=0x5555557a7c00) at ../../../glib/gthread.c:831
#74776 0x00007ffff6de91c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#74777 0x00007ffff6e6985c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
I investigated further and found:
* Reddit thread for this issue https://www.reddit.com/r/debian/comments/1drejsu/file_manager_crashes_with_json_and_js_files/
* Matching bugreport in Gnome https://gitlab.gnome.org/GNOME/nautilus/-/issues/3273
* Potential upstream fix https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/275/diffs
I tried to fix the issue by editing the freedesktop.org.xml file and
running `update-mime-database -V /usr/share/mime/`, but could not
understand why the recursion on __gio_xdg_cache_mime_type_subclass does
go from application/ecmascript back to text/javascript.
I would like to not experience crashes on my stable system and request a
fix in stable - testing and unstable packages are not easily installable
and I would rather not switch to testing or unstable.
-- System Information:
Debian Release: 12.8
APT prefers stable-security
APT policy: (900, 'stable-security'), (900, 'stable'), (500, 'stable-updates'), (500, 'stable-debug'), (500, 'proposed-updates-debug'), (2, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.11.5+bpo-amd64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages shared-mime-info depends on:
ii libc6 2.36-9+deb12u9
ii libglib2.0-0 2.74.6-2+deb12u4
ii libxml2 2.9.14+dfsg-1.3~deb12u1
shared-mime-info recommends no packages.
shared-mime-info suggests no packages.
-- no debconf information
More information about the Pkg-freedesktop-maintainers
mailing list