The problem is tnat when the write does its job, it closes the file. Then reader comes and open it with same fd but it is blocked when it is reading.
Actually it reads first 16 byte, but in the second iteration in ApplyFileIoSyscall, instead of getting zero, it is blocked when it call read syscall.
ssize_t ApplyFileIoSyscall(F const& f, size_t const count) {
size_t completed = 0;
// `do ... while` because some callers actually want to make a syscall with a
// count of 0.
do {
auto const cur = RetryEINTR(f)(completed);
if (cur < 0) {
return cur;
} else if (cur == 0) {
break;
}
completed += cur;
} while (completed < count);
return completed;
}
I was running gvisor testcase on quark and I faced an issue with fifo. The testcase is this:
The problem is tnat when the write does its job, it closes the file. Then reader comes and open it with same fd but it is blocked when it is reading. Actually it reads first 16 byte, but in the second iteration in
ApplyFileIoSyscall
, instead of getting zero, it is blocked when it callread
syscall.code of
ReadFd
andwriteFd
link to code:code of
ApplyFileIoSyscall
link :