Skip to content

Pipe command '|' hangs with large input #4

@Seeker04

Description

@Seeker04

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions