Project

General

Profile

Actions

Bug #373

closed

MingwでIO#dupがブロックする

Added by wanabe (_ wanabe) over 16 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.2dev (2009-11-06 trunk 25671) [i386-mingw32]
Backport:
[ruby-dev:35648]

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

test_io_noblock.patch (490 Bytes) test_io_noblock.patch wanabe (_ wanabe), 11/06/2009 07:40 PM
test_io_noblock.patch (490 Bytes) test_io_noblock.patch wanabe (_ wanabe), 11/06/2009 07:59 PM

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #1500: test_io runs forever in windowsThird Party's Issuenobu (Nobuyoshi Nakada)05/21/2009Actions
Actions #1

Updated by ko1 (Koichi Sasada) over 16 years ago

  • Assignee set to nobu (Nobuyoshi Nakada)

=begin

=end

Actions #2

Updated by yugui (Yuki Sonoda) about 16 years ago

  • Target version set to 1.9.1 Release Candidate

=begin

=end

Actions #3

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

Actions #4

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, 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

=end

Actions #5

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

Actions #6

Updated by wanabe (_ wanabe) about 15 years ago

=begin
古いチケットへの反応ですみません。
この件、対応していただいたおかげで子プロセスを kill すれば
テストが進むようになりましたが、できればタイムアウトした方が
よいかと思い、今更ながらパッチを書きました。
よろしければご検討ください。
=end

Updated by rogerdpack (Roger Pack) over 13 years ago

Was this fixed in r20630 ?

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0