[#39052] Fwd: [redmine4ruby-lang:253] [Bug #1914] ruby-1.9.1-p243 failed to build from source on aix 5.3 with gcc 4.2.0 — Yugui <yugui@...>

Redmine管理用プロジェクトに報告されてしまったので転送します。

12 messages 2009/08/09
[#39264] Re: Fwd: [redmine4ruby-lang:253] [Bug #1914] ruby-1.9.1-p243 failed to build from source on aix 5.3 with gcc 4.2.0 — Yutaka Kanemoto <kinpoco@...> 2009/09/08

金本と申します。

[#39107] [Bug #1952] cannot stop with Ctrl+C — Usaku NAKAMURA <redmine@...>

Bug #1952: cannot stop with Ctrl+C

14 messages 2009/08/18

[#39167] [Bug #2000] Change the license to "GPLv2+ or Ruby's original". — Mamoru Tasaka <redmine@...>

Bug #2000: Change the license to "GPLv2+ or Ruby's original".

11 messages 2009/08/26

[#39193] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Tanaka Akira <akr@...>

In article <200908281827.n7SIRbaX003476@ci.ruby-lang.org>,

16 messages 2009/08/29
[#39194] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Nobuyoshi Nakada <nobu@...> 2009/08/29

なかだです。

[#39195] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Tanaka Akira <akr@...> 2009/08/29

In article <4a988633.9553f10a.4496.483e@mx.google.com>,

[#39196] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Nobuyoshi Nakada <nobu@...> 2009/08/29

なかだです。

[#39197] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Tanaka Akira <akr@...> 2009/08/29

In article <4a989f76.1602be0a.3de4.1131@mx.google.com>,

[#39198] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Yukihiro Matsumoto <matz@...> 2009/08/29

まつもと ゆきひろです

[#39206] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Nobuyoshi Nakada <nobu@...> 2009/08/31

なかだです。

[ruby-dev:39040] Re: [Bug #1872] [ruby_1_8] Kernel#system doesn't work in forked process

From: "U.Nakamura" <usa@...>
Date: 2009-08-07 12:22:11 UTC
List: ruby-dev #39040
こんにちは、なかむら(う)です。

In message "[ruby-dev:39039] [Bug #1872] [ruby_1_8] Kernel#system doesn't work in forked process"
    on Aug.07,2009 20:09:44, <redmine@ruby-lang.org> wrote:
> Mandriva 2009.1 (glibc-2.9-0.20081113.5.1mnb2)では再現しませんでしたが、
> Debian Ecth (libc6   2.3.6.ds1-13etch9) の環境で再現しました。
> リビジョンを遡っていくと、 r23268 以降、発生する(ことがある)ようです。
> 
>     * eval.c (rb_thread_start_timer): guard condition was inverted. [ruby-dev:38319]

r23268自体は正当な修正なので、要するに該当環境だとtimer thread
がいる時にforkするとまずいということなのでしょう。

POSIX threadはよくわからないのですが、つらつら考えてみたとこ
ろ、fork前にtimer threadを止めて、fork後に親子双方でまたtimer
threadを動かせばいいんじゃないかという気がしてきました。
手元には環境がないのでかずひこさんに以下のパッチを試してもら
ったところ、いちおう動くようになるみたいです。

わかる人や元のコードを書いた人(なかださんかな?)に発想が正しい
か考えてほしいのですが、どんなもんでしょうか...

Index: eval.c
===================================================================
--- eval.c	(revision 24389)
+++ eval.c	(working copy)
@@ -12485,7 +12485,7 @@ rb_thread_start_timer()
     safe_mutex_lock(&time_thread.lock);
     if (pthread_create(&time_thread.thread, 0, thread_timer, args) == 0) {
 	thread_init = 1;
-	pthread_atfork(0, 0, rb_thread_stop_timer);
+	pthread_atfork(rb_thread_stop_timer, rb_thread_start_timer, rb_thread_start_timer);
 	pthread_cond_wait(&start, &time_thread.lock);
     }
     pthread_cleanup_pop(1);

それでは。
-- 
U.Nakamura <usa@garbagecollect.jp>


In This Thread