apple / apple/container

[Bug]: container run --interactive wrongly (de?)allocates stdin/stdout/terminal?

Open
#1,148 9 comments 0 reactions 1 assignee Claimed by @dcantah View on GitHub
Dominant language
Swift
Stars
49.9k
Forks
1.8k
Avg merge
1d 20h
Merged PRs (30d)
22

Description

### I have done the following

- [x] I have searched the existing issues
- [ ] If possible, I've reproduced the issue using the 'main' branch of this project

### Steps to reproduce

Note that the value ends in `01234` but the actual output of `cat test` in the same line ends in `0123` no matter what and no matter how many times you call `cat test`. In the next line `cat test` is properly output and ends in `01234` as expected.

~ container run --interactive docker.io/debian:trixie-slim printf 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 >test; cat test; printf '\n'; cat test
~ cat test

The length of the value I provided is exactly one symbol longer than needed for misbehaviour to happen.

If you remove `--interactive`, misbehaviour vanishes.

The misbehaviour is not specific to `cat`. The issue can be reproduced with e. g. `base64

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.