If input is larger than 139264 bytes, then write() blocks indefinitely in cmd_extcmd_io().
For example:
./srek '|/tr a-z A-Z/' tests/large_input.txt
hangs, but
./srek '|/tr a-z A-Z/' tests/large_input_limit.txt
does not (until I add a single byte to the file).
Note: simply replacing the pipe() calls with pipe2() using O_NONBLOCK does not solve this issue. Instead, it gets us:
write(): Resource temporarily unavailable
TODO: once this issue is solved, large_input_limit.txt should be removed from the repo.
If input is larger than 139264 bytes, then
write()blocks indefinitely incmd_extcmd_io().For example:
./srek '|/tr a-z A-Z/' tests/large_input.txthangs, but
./srek '|/tr a-z A-Z/' tests/large_input_limit.txtdoes not (until I add a single byte to the file).
Note: simply replacing the
pipe()calls withpipe2()usingO_NONBLOCKdoes not solve this issue. Instead, it gets us:write(): Resource temporarily unavailableTODO: once this issue is solved, large_input_limit.txt should be removed from the repo.