Function g_file_query_exists() is blocking
This is something that is driving me nuts because I never faced this problem before (I've been using GLib for 10 years). The problem is that when I'm calling g_file_query_exists()
to check whether a regular file/directory exists, the process blocks forever. It doesn't matter whether the file exists or not, and I have checked it with regular paths such as /tmp
or /home
. If I compile and run my application on other platforms (Linux, Windows MSYS2) and with other GLib versions, the function does not block.
The only thing I have found so far is that this behavior only occurs when invoking g_file_query_exists()
from a subprocess of a main process. If the main process calls the function, the function does not block. However, if the function is called from the child process, then it blocks and leaves the child process blocked forever.
I have read in the docs that g_file_query_exists()
calls g_file_query_info()
, which is the one that might block the process execution. I have tried to follow the calls of these functions in GLib's source code until I faced GLib's internals (GVFS), and now I'm lost...
In what circumstances would g_file_query_exists()
block a process?
Details of the platform where I'm having this issue:
- Ubuntu 22.04.2 LTS
- Linux claudi-ubuntudev 5.19.0-43-generic 44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon May 22 13:39:36 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
- GLib version: 2.72.4
Platforms where the issue does not happen:
- Ubuntu 14.04.6 LTS (Linux 4.4.0-148-generic 174~14.04.1-Ubuntu SMP Thu May 9 08:17:37 UTC 2019 x86_64), GLib version: 2.40.2
- Ubuntu 18.04.4 LTS (Linux 5.4.0-1097-aws 105~18.04.1-Ubuntu SMP Mon Feb 13 17:50:57 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux), GLib version: 2.56.4
- Windows (MSYS2), GLib version: 2.66.2
Thank you.