Skip to content

Conversation

@nobu
Copy link
Member

@nobu nobu commented Oct 3, 2024

PTY.spawn with a block detaches the spawned process and leaves it running in background even after exiting the given block. It is the responsibility of the caller to clean up the yielded IOs and PID.

https://github.com/ruby/ruby/actions/runs/11148759246/job/30986064044#step:13:950

Leaked file descriptor: Reline::Test#test_tty_amibuous_width: 9 : #<File:/dev/pts/0>
Leaked file descriptor: Reline::Test#test_tty_amibuous_width: 10 : #<File:/dev/pts/0>
Leaked file descriptor: Reline::Test#test_tty_amibuous_width: 11 : #<File:/dev/pts/1>
Leaked file descriptor: Reline::Test#test_tty_amibuous_width: 12 : #<File:/dev/pts/1>
Leaked file descriptor: Reline::Test#test_tty_amibuous_width: 13 : #<File:/dev/pts/2>
Leaked file descriptor: Reline::Test#test_tty_amibuous_width: 14 : #<File:/dev/pts/2>

`PTY.spawn` with a block detaches the spawned process and leaves it
running in background even after exiting the given block.  It is the
responsibility of the caller to clean up the yielded IOs and PID.

https://github.com/ruby/ruby/actions/runs/11148759246/job/30986064044#step:13:950
```
Leaked file descriptor: Reline::Test#test_tty_amibuous_width: 9 : #<File:/dev/pts/0>
Leaked file descriptor: Reline::Test#test_tty_amibuous_width: 10 : #<File:/dev/pts/0>
Leaked file descriptor: Reline::Test#test_tty_amibuous_width: 11 : #<File:/dev/pts/1>
Leaked file descriptor: Reline::Test#test_tty_amibuous_width: 12 : #<File:/dev/pts/1>
Leaked file descriptor: Reline::Test#test_tty_amibuous_width: 13 : #<File:/dev/pts/2>
Leaked file descriptor: Reline::Test#test_tty_amibuous_width: 14 : #<File:/dev/pts/2>
```
@tompng tompng merged commit f9f90da into ruby:master Oct 3, 2024
matzbot pushed a commit to ruby/ruby that referenced this pull request Oct 3, 2024
`PTY.spawn` with a block detaches the spawned process and leaves it
running in background even after exiting the given block.  It is the
responsibility of the caller to clean up the yielded IOs and PID.

https://github.com/ruby/ruby/actions/runs/11148759246/job/30986064044#step:13:950
```
Leaked file descriptor: Reline::Test#test_tty_amibuous_width: 9 : #<File:/dev/pts/0>
Leaked file descriptor: Reline::Test#test_tty_amibuous_width: 10 : #<File:/dev/pts/0>
Leaked file descriptor: Reline::Test#test_tty_amibuous_width: 11 : #<File:/dev/pts/1>
Leaked file descriptor: Reline::Test#test_tty_amibuous_width: 12 : #<File:/dev/pts/1>
Leaked file descriptor: Reline::Test#test_tty_amibuous_width: 13 : #<File:/dev/pts/2>
Leaked file descriptor: Reline::Test#test_tty_amibuous_width: 14 : #<File:/dev/pts/2>
```

ruby/reline@f9f90da9e4
@nobu nobu deleted the fd-leak branch October 3, 2024 03:18
@ima1zumi ima1zumi added bug Something isn't working and removed bug Something isn't working labels Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants