[ruby-dev:35648] [Bug:1.9] MingwでIO#dupがブロックする

View: New views
5 Messages — Rating Filter:   Alert me  

[ruby-dev:35648] [Bug:1.9] MingwでIO#dupがブロックする

by wanabe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ワナベと申します。
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

--
ワナベ


[ruby-dev:37022] [Bug #373] MingwでIO#dupがブロックする

by Nobuyoshi Nakada-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

チケット #373 が更新されました。 (by Roger Pack)


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 
----------------------------------------
http://redmine.ruby-lang.org/issues/show/373

----------------------------------------
http://redmine.ruby-lang.org


[ruby-dev:37023] Re: [Bug #373] MingwでIO#dupがブロックする

by U.Nakamura :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

In message "[ruby-dev:37022] [Bug #373] MingwでIO#dupがブロックする"
    on Nov.04,2008 07:30:38, <redmine@...> 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@...>



[ruby-dev:37386] [Bug #373](Closed) MingwでIO#dupがブロックする

by Nobuyoshi Nakada-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

チケット #373 が更新されました。 (by Akira Tanaka)

ステータス OpenからClosedに変更
進捗 % 0から100に変更

Applied in changeset r20630.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/373

----------------------------------------
http://redmine.ruby-lang.org


[ruby-dev:39651] [Bug #373] MingwでIO#dupがブロックする

by Nobuyoshi Nakada-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

チケット #373 が更新されました。 (by _ wanabe)

ファイル test_io_noblock.patch 追加
カテゴリ testにセット
Target version 1.9.1 Release Candidateから1.9.xに変更
ruby -v ruby 1.9.2dev (2009-11-06 trunk 25671) [i386-mingw32]にセット

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

----------------------------------------
http://redmine.ruby-lang.org