g_spawn_async_with_pipes is blocking
Submitted by Luca Bruno
Link to original bug (#722401)
Description
When using a command that requires e.g. an NFS mount that is blocked, the function also blocks.
The relevant code that is blocking is here:
Here's the backtrace at the hanging point:
#0 0x00007ffff54a2b0d in read () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007ffff580907e in read (__nbytes=8, __buf=0x7fffffffdaa0, __fd=18) at /usr/include/x86_64-linux-gnu/bits/unistd.h:44
#2 read_ints (fd=18, buf=buf@entry=0x7fffffffdaa0, n_ints_in_buf=n_ints_in_buf@entry=2, n_ints_read=n_ints_read@entry=0x7fffffffda4c, error=error@entry=0xf4f0d8)
at /build/buildd/glib2.0-2.36.0/./glib/gspawn.c:1266
#3 0x00007ffff5809529 in fork_exec_with_pipes (intermediate_child=intermediate_child@entry=0, working_directory=0x928b00 "/path/to/nfs/dir", argv=0xa843d0,
envp=envp@entry=0x0, close_descriptors=close_descriptors@entry=1, search_path=search_path@entry=1, search_path_from_envp=search_path_from_envp@entry=0,
stdout_to_null=stdout_to_null@entry=0, stderr_to_null=stderr_to_null@entry=0, child_inherits_stdin=0, file_and_argv_zero=file_and_argv_zero@entry=0, child_setup=child_setup@entry=0x0,
user_data=user_data@entry=0x0, child_pid=child_pid@entry=0xf4efbc, standard_input=standard_input@entry=0xf4efc0, standard_output=standard_output@entry=0xf4efc4,
standard_error=standard_error@entry=0xf4efc8, error=error@entry=0xf4f0d8) at /build/buildd/glib2.0-2.36.0/./glib/gspawn.c:1481
#4 0x00007ffff580a114 in g_spawn_async_with_pipes (working_directory=<optimized out>, argv=<optimized out>, envp=envp@entry=0x0,
flags=flags@entry=(G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH), child_setup=child_setup@entry=0x0, user_data=user_data@entry=0x0, child_pid=child_pid@entry=0xf4efbc,
standard_input=standard_input@entry=0xf4efc0, standard_output=standard_output@entry=0xf4efc4, standard_error=standard_error@entry=0xf4efc8, error=error@entry=0xf4f0d8)
at /build/buildd/glib2.0-2.36.0/./glib/gspawn.c:665
Version: 2.36.x