Spurious GIO module initialization on Fedora Silverblue (and other ostree-based systems?)
In the gio module loading code,
g_io_modules_scan_all_in_directory_with_scope tries to lazily load the giomodules when the cache file
giomodule.cache has been modified after the module file was last changed.
The issue in Silverblue is that every file in
/usr is last-modified at epoch 0. The result is that every module is inconditionally loaded and unloaded.
This is a (small) performance issue, but also a problem because some modules, at least gvfsdbus, create threads and never unload, which makes it impossible to use some system calls like
setns(USERNS) which require the process to be mono-threaded.
It might be better to use the change time for both the cache and the module?
I assume that this also affects other ostree-based distributions, and also flatpak images since they are also based on OSTree. However, right now, the freedesktop image does not generate the cache file anyways.