After upgrading to Fedora 41, I noticed that upon starting X as an ordinary user, I have ~/.cache/mesa_shader_cache created to be owned by root (and with the group of given user). I assume that should not be the case, any idea how to debug or fix the problem? Please note that my setup is somewhat non-standard: I’m using Fedora Scientific Lab, my window manager is Openbox, and I’m starting X through startx command. I can provide config/log files that could be relevant to the problem, but I still think this issue should not happen.
You can simply delete the directory and reboot, without starting any other applications, to check whether it’s the base system that creates the directory.
If it isn’t recreated on the next login, then it was likely created by a userspace application. In that case the directory could not have been created as root without an application asking you to raise privileges (via a password prompt) or if the application was running under a root node – for example in a container (flatpak/docker/etc) that was launched as root or with certain root privileges.