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@entry=0x7ffff0e19fbc "text/javascript", base=base@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@entry=0x7fffeabdde90 "application/ecmascript", base=base@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@entry=0x7ffff0e19fbc "text/javascript", base=base@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@entry=0x7fffeabdde90 "application/ecmascript", base=base@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@entry=0x7ffff0e19fbc "text/javascript", base=base@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@entry=0x7fffeabddea4 "application/ecmascript", base=base@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@entry=0x7ffff0e19fbc "text/javascript", base=base@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@entry=0x7ffff0e19240 "application/json5", base=base@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@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@entry=0x7fff54096940 ".ory-cloud.json", data=data@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@entry=244, result_uncertain=result_uncertain@entry=0x0) at ../../../gio/gcontenttype.c:857
#74769 0x00007ffff7398c31 in get_content_type
(basename=basename@entry=0x7fff54096940 ".ory-cloud.json", path=path@entry=0x7fffd80fa120 "/home/ole/.ory-cloud.json", statbuf=statbuf@entry=0x7ffff0dfe830, is_symlink=is_symlink@entry=0, symlink_broken=symlink_broken@entry=0, flags=flags@entry=G_FILE_QUERY_INFO_NONE, fast=0) at ../../../gio/glocalfileinfo.c:1410
#74770 0x00007ffff739adb8 in _g_local_file_info_get
(basename=basename@entry=0x7fff54096940 ".ory-cloud.json", path=path@entry=0x7fffd80fa120 "/home/ole/.ory-cloud.json", attribute_matcher=0x7fffd4041100, flags=G_FILE_QUERY_INFO_NONE, parent_info=parent_info@entry=0x55555611c2a8, error=error@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.