ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:104329] [Ruby master Bug#17996] Cygwin: thread + pipe behavior since Ruby 2.6
@ 2021-06-17  3:59 xtkoba+ruby
  2024-03-29  2:16 ` [ruby-core:117370] " hsbt (Hiroshi SHIBATA) via ruby-core
  0 siblings, 1 reply; 2+ messages in thread
From: xtkoba+ruby @ 2021-06-17  3:59 UTC (permalink / raw
  To: ruby-core

Issue #17996 has been reported by xtkoba (Tee KOBAYASHI).

----------------------------------------
Bug #17996: Cygwin: thread + pipe behavior since Ruby 2.6
https://bugs.ruby-lang.org/issues/17996

* Author: xtkoba (Tee KOBAYASHI)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.1.0dev (2021-06-10T23:31:51Z master 9210f8df7f) [x86_64-cygwin]
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
The following one-liner is the repro named `thread-pipe-read-close.rb` the aim of which is essentially the same as that of "IO#close raises an IOError with a clear message" test in `spec/ruby/core/io/close_spec.rb`.

```ruby
r, w = IO.pipe; Thread.new{ r.read }; sleep 0.5; r.close
```

Run on Cygwin with Ruby 2.6 or later, this hangs up indefinitely consuming a full core. On the other hand, with Ruby 2.5.9p229 it works as expected.

```
$ miniruby25 -v
ruby 2.5.9p229 (2021-04-05 revision 67939) [x86_64-cygwin]

$ miniruby25 thread-pipe-read-close.rb
#<Thread:0x000000080006c9f0@thread-pipe-read-close.rb:2 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
        1: from thread-pipe-read-close.rb:2:in `block in <main>'
thread-pipe-read-close.rb:2:in `read': IOError

$ miniruby -v
ruby 3.1.0dev (2021-06-10T23:31:51Z master 9210f8df7f) [x86_64-cygwin]

$ miniruby thread-pipe-read-close.rb
```



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ruby-core:117370] [Ruby master Bug#17996] Cygwin: thread + pipe behavior since Ruby 2.6
  2021-06-17  3:59 [ruby-core:104329] [Ruby master Bug#17996] Cygwin: thread + pipe behavior since Ruby 2.6 xtkoba+ruby
@ 2024-03-29  2:16 ` hsbt (Hiroshi SHIBATA) via ruby-core
  0 siblings, 0 replies; 2+ messages in thread
From: hsbt (Hiroshi SHIBATA) via ruby-core @ 2024-03-29  2:16 UTC (permalink / raw
  To: ruby-core; +Cc: hsbt (Hiroshi SHIBATA)

Issue #17996 has been updated by hsbt (Hiroshi SHIBATA).

Status changed from Open to Closed

https://github.com/ruby/ruby/pull/9357 may be fixed this.

----------------------------------------
Bug #17996: Cygwin: thread + pipe behavior since Ruby 2.6
https://bugs.ruby-lang.org/issues/17996#change-107528

* Author: xtkoba (Tee KOBAYASHI)
* Status: Closed
* Assignee: cygwin
* ruby -v: ruby 3.1.0dev (2021-06-10T23:31:51Z master 9210f8df7f) [x86_64-cygwin]
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
The following one-liner is the repro named `thread-pipe-read-close.rb` the aim of which is essentially the same as that of "IO#close raises an IOError with a clear message" test in `spec/ruby/core/io/close_spec.rb`.

```ruby
r, w = IO.pipe; Thread.new{ r.read }; sleep 0.5; r.close
```

Run on Cygwin with Ruby 2.6 or later, this hangs up indefinitely consuming a full core. On the other hand, with Ruby 2.5.9p229 it works as expected.

```
$ miniruby25 -v
ruby 2.5.9p229 (2021-04-05 revision 67939) [x86_64-cygwin]

$ miniruby25 thread-pipe-read-close.rb
#<Thread:0x000000080006c9f0@thread-pipe-read-close.rb:2 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
        1: from thread-pipe-read-close.rb:2:in `block in <main>'
thread-pipe-read-close.rb:2:in `read': IOError

$ miniruby -v
ruby 3.1.0dev (2021-06-10T23:31:51Z master 9210f8df7f) [x86_64-cygwin]

$ miniruby thread-pipe-read-close.rb
```



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-29  2:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-17  3:59 [ruby-core:104329] [Ruby master Bug#17996] Cygwin: thread + pipe behavior since Ruby 2.6 xtkoba+ruby
2024-03-29  2:16 ` [ruby-core:117370] " hsbt (Hiroshi SHIBATA) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).