Race condition in wait(::Process)
with process end?
#54146
Labels
I/O
Involving the I/O subsystem: libuv, read, write, etc.
wait(::Process)
with process end?
#54146
I'm not very familiar with the details of process spawning, but this part looks like it could potentially be a race to me? Inside
wait(x::Process)
, here, we double-check process_exited after grabbing the io_lock:julia/base/process.jl
Lines 655 to 668 in 329f92c
But then, when the process is killed, we don't lock the io_lock before we notify the
.exitnotify
condition...:julia/base/process.jl
Lines 61 to 67 in 329f92c
Isn't it therefore possible that we could set the process's handle to NULL and signal the CV after the process_exited check, but before the lock(x.exitnotify), and thus the waiter would miss it?
That is, isn't there a possible race here?:
Originally posted by @NHDaly in #54145 (comment)
The text was updated successfully, but these errors were encountered: