You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The resulting exception will incorrectly be invalid argument (Bad file descriptor) instead of does not exist (No such file or directory). The problem itself has nothing to do with GIDs, but by setting one, do_spawn_fork is forced to be used instead of do_spawn_posix, which makes this reproducible even when posix_spawn is otherwise supported.
The problem is that the parent_end FD of stdin, stdout, and stderr all get closed both by runInteractiveProcess and by do_spawn_fork. In addition to all of the problems that double-close usually causes, here it also causes errno to be unexpectedly overwritten. I'm pretty sure, but not 100% positive, that runInteractiveProcess is the one that's supposed to be closing them, and that do_spawn_fork shouldn't be.
The text was updated successfully, but these errors were encountered:
bgamari
added a commit
to bgamari/process
that referenced
this issue
Mar 26, 2024
Previously the fork/exec backend would attempt to close
stdin, et al. on process spawn failure. This result in spurious `close`
failures due to `runInteractiveProcess` doing the same. Consequently,
the cause of the failure would be confusingly mis-identified.
Fixeshaskell#306.
When running this Haskell code:
The resulting exception will incorrectly be
invalid argument (Bad file descriptor)
instead ofdoes not exist (No such file or directory)
. The problem itself has nothing to do with GIDs, but by setting one,do_spawn_fork
is forced to be used instead ofdo_spawn_posix
, which makes this reproducible even whenposix_spawn
is otherwise supported.The problem is that the
parent_end
FD of stdin, stdout, and stderr all get closed both byrunInteractiveProcess
and bydo_spawn_fork
. In addition to all of the problems that double-close usually causes, here it also causeserrno
to be unexpectedly overwritten. I'm pretty sure, but not 100% positive, thatrunInteractiveProcess
is the one that's supposed to be closing them, and thatdo_spawn_fork
shouldn't be.The text was updated successfully, but these errors were encountered: