Bug #373
closedMingwでIO#dupがブロックする
Description
=begin
ワナベと申します。
ruby-list に送った不具合を改めてこちらにも書かせていただきます。
Mingw 上の trunkで、test/ruby/test_io.rb の test_dup のように
パイプを最大まで作成してから IOオブジェクトの dup を繰り返すと
処理が停止します。
$ ./ruby -ve '
a = []
loop{a.push IO.pipe} rescue nil
loop {a.push(p a[0][0].dup)}'
ruby 1.9.0 (2008-07-24 revision 18196) [i386-mingw32]
#IO:0xbbdbe0 # ここで処理が止まる
また以下の結果から、msvcrt の問題のように思えます。
$ cat test.c
#include <stdio.h>
#include <io.h>
int main(int argc, char **argv) {
int n = 0;
while(_dup(0) != -1) n++;
printf("n = %i\n", n);
_dup(0);
printf("fin\n");
return 0;
}
$ gcc -mno-cygwin test.c && ./a.exe
n = 2045 // ← CTRL+C で中断するまで処理が止まる
$ gcc -mno-cygwin test.c -lmsvcr71 && ./a.exe
n = 2045
fin
--
ワナベ
=end
Files
Updated by ko1 (Koichi Sasada) over 16 years ago
- Assignee set to nobu (Nobuyoshi Nakada)
=begin
=end
Updated by yugui (Yuki Sonoda) about 16 years ago
- Target version set to 1.9.1 Release Candidate
=begin
=end
Updated by rogerdpack (Roger Pack) about 16 years ago
=begin
pardon my english.
Seems that there are a few other problems with the msvcrt6 [1].
I wonder if VC6 does not suffer with these problems, and, if not, did they have to do their own workarounds? If so then this is [I suppose] a mingw issue not a ruby one.
I know the OCI guys with mingw had problems with descriptors not working, too[2].
Thoughts?
-=R
[1] http://www.ruby-forum.com/topic/169681#744518
[2] http://markmail.org/message/hlsuk3ukejabfjrg
=end
Updated by usa (Usaku NAKAMURA) about 16 years ago
=begin
Hello,
In message "[ruby-dev:37022] [Bug #373] MingwでIO#dupがブロックする"
on Nov.04,2008 07:30:38, redmine@ruby-lang.org wrote:
pardon my english.
Seems that there are a few other problems with the msvcrt6 [1].
[1] http://www.ruby-forum.com/topic/169681#744518
I can't understand the problems from this URL.
How do I reproduce them?
I wonder if VC6 does not suffer with these problems, and, if not, did they have to do their own workarounds? If so then this is [I suppose] a mingw issue not a ruby one.
I know the OCI guys with mingw had problems with descriptors not working, too[2].
Thoughts?
[2] http://markmail.org/message/hlsuk3ukejabfjrg
It's not our problem, but readline's.
Regards,¶
U.Nakamura usa@garbagecollect.jp
=end
Updated by akr (Akira Tanaka) almost 16 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
Applied in changeset r20630.
=end
Updated by wanabe (_ wanabe) about 15 years ago
- File test_io_noblock.patch test_io_noblock.patch added
- Category set to test
- Target version changed from 1.9.1 Release Candidate to 2.0.0
- ruby -v set to ruby 1.9.2dev (2009-11-06 trunk 25671) [i386-mingw32]
=begin
古いチケットへの反応ですみません。
この件、対応していただいたおかげで子プロセスを kill すれば
テストが進むようになりましたが、できればタイムアウトした方が
よいかと思い、今更ながらパッチを書きました。
よろしければご検討ください。
=end
Updated by rogerdpack (Roger Pack) over 13 years ago
Was this fixed in r20630 ?