[#30455] a[] += 1 で SEGV — "Hiroki Motoyoshi" <himotoyoshi.ml@...>
本吉と申します。
6 messages
2007/03/01
[#30477] ThreadError on shell.rb — "Akira ODA" <oda.org@...>
はじめまして、尾田といいます。
8 messages
2007/03/04
[#30478] Re: ThreadError on shell.rb
— keiju@... (石塚圭樹)
2007/03/04
けいじゅ@いしつかです.
[#30482] Ruby 1.8.6 preview3 has been released — "Akinori MUSHA" <knu@...>
Ruby 1.8.6 preview3 をリリースしました。
10 messages
2007/03/04
[#30489] Re: Ruby 1.8.6 preview3 has been released
— nekomaho <nekomaho@...>
2007/03/05
ねこまほです.
[#30486] str.lines[1..-1] — Minero Aoki <aamine@...>
青木です。
7 messages
2007/03/05
[#30487] Time#to_s format — OHARA Shigeki <os@...>
大原です。
6 messages
2007/03/05
[#30504] num_tとthread_initという名前について — "Yutaka Kanemoto" <kinpoco@...>
金本ともうします。
1 message
2007/03/07
[#30505] [BUG?] SIGTERM の取り扱い — Hidetoshi NAGAI <nagai@...>
永井@知能.九工大です.
10 messages
2007/03/08
[#30509] Re: [BUG?] SIGTERM の取り扱い
— Nobuyoshi Nakada <nobu@...>
2007/03/08
なかだです。
[#30510] Re: [BUG?] SIGTERM の取り扱い
— Yukihiro Matsumoto <matz@...>
2007/03/08
まつもと ゆきひろです
[#30531] DL::PtrData#to_a dumps core — sheepman <sheepman@...>
こんばんは、sheepman です。
4 messages
2007/03/11
[#30532] DL::PtrData#inspect — sheepman <sheepman@...>
こんばんは、sheepman です。
6 messages
2007/03/11
[#30537] Microsoft-IIS 上で cgi.rb がレスポンス行を2重に出力する — MIYASAKA Masaru <alkaid@...>
初めての投稿です。みやさか と申します。よろしくお願いいたします。
5 messages
2007/03/12
[#30549] [ANN] Ruby 1.8.6 has been released — "Akinori MUSHA" <knu@...>
Ruby 1.8.6 をリリースしました。
14 messages
2007/03/12
[#30555] Re: [ANN] Ruby 1.8.6 has been released
— "U.Nakamura" <usa@...>
2007/03/13
こんにちは、なかむら(う)です。
[#30558] Re: [ANN] Ruby 1.8.6 has been released
— moonwolf@...
2007/03/13
おひさしぶり、MoonWolfです。
[#30559] Re: [ANN] Ruby 1.8.6 has been released
— nekomaho <nekomaho@...>
2007/03/13
ねこまほです.
[#30553] help: lib/shell for ruby 1.9 — keiju@... (Keiju ISHITSUKA)
けいじゅ@いしつかです.
13 messages
2007/03/13
[#30585] Re: help: lib/shell for ruby 1.9
— Yukihiro Matsumoto <matz@...>
2007/03/15
まつもと ゆきひろです
[#30587] Re: help: lib/shell for ruby 1.9
— keiju@... (石塚圭樹)
2007/03/15
けいじゅ@いしつかです.
[#30588] Re: help: lib/shell for ruby 1.9
— Yukihiro Matsumoto <matz@...>
2007/03/15
まつもと ゆきひろです
[#30590] [BUG?] Mutex or ConditionVariable for ruby 1.8[Re: Re: help: lib/shell for ruby 1.9]
— keiju@... (石塚圭樹)
2007/03/15
けいじゅ@いしつかです.
[#30592] Re: [BUG?] Mutex or ConditionVariable for ruby 1.8[Re: Re: help: lib/shell for ruby 1.9]
— "Akinori MUSHA" <knu@...>
2007/03/15
At Thu, 15 Mar 2007 18:53:46 +0900,
[#30600] Re: [BUG?] Mutex or ConditionVariable for ruby 1.8[Re: Re: help: lib/shell for ruby 1.9]
— "Akinori MUSHA" <knu@...>
2007/03/16
At Thu, 15 Mar 2007 19:18:42 +0900,
[#30601] Re: [BUG?] Mutex or ConditionVariable for ruby 1.8[Re: Re: help: lib/shell for ruby 1.9]
— keiju@... (keiju ISHITSUKA)
2007/03/16
けいじゅ@いしつかです.
[#30564] release code and revision number — Nobuyoshi Nakada <nobu@...>
なかだです。
11 messages
2007/03/13
[#30566] Re: release code and revision number
— Urabe Shyouhei <shyouhei@...>
2007/03/14
卜部です
[#30581] [ruby-core:10580] Thread後のexecでENOTSUPPエラー対応 — "H.Holon" <holon@...>
相馬 - H.Holonです。
8 messages
2007/03/14
[#30646] Re: [ruby-core:10580] Thread後のexecでENOTSUPPエラー対応
— Nobuyoshi Nakada <nobu@...>
2007/03/19
なかだです。
[#30586] Etc.getgrgid が getgid の値に固定されています — 植田裕之 <ueda@...>
植田と申します。
5 messages
2007/03/15
[#30593] [BUG] waitpid for ruby-trunk — keiju@... (Keiju ISHITSUKA)
けいじゅ@いしつかです.
5 messages
2007/03/15
[#30612] stdout flush in fork — keiju@... (Keiju ISHITSUKA)
けいじゅ@いしつかです.
9 messages
2007/03/17
[#30614] Re: stdout flush in fork
— Yukihiro Matsumoto <matz@...>
2007/03/17
まつもと ゆきひろです
[#30616] Re: stdout flush in fork
— keiju@... (石塚圭樹)
2007/03/17
けいじゅ@いしつかです.
[#30620] DL.callback as free function causes errors — sheepman <sheepman@...>
こんにちは、sheepman です。
4 messages
2007/03/18
[#30627] [ ruby-Bugs-9360 ] Matrix inverse problem — Yukihiro Matsumoto <matz@...>
まつもと ゆきひろです
4 messages
2007/03/19
[#30648] YARVでのalias名の取得方法 — Yukihiro Matsumoto <matz@...>
まつもと ゆきひろです
5 messages
2007/03/20
[#30653] [BUG] queue 0x424010 freed with live thread(s) waiting — Masatoshi SEKI <m_seki@...>
咳といいます。
4 messages
2007/03/20
[#30655] win32/registry wtime — moonwolf@...
MoonWolfです。
11 messages
2007/03/20
[#30658] Unicode対応と文字化け(Re: win32/registry wtime)
— Yukihiro Matsumoto <matz@...>
2007/03/21
まつもと ゆきひろです
[#30659] Re: Unicode対応と文字化け(Re: win32/registry wtime)
— Tietew <tietew+ruby-dev@...>
2007/03/21
win32/registry.rb を書いた Tietew です。
[ruby-dev:30645] Re: possible bug in rb_detach_process()
From:
Nobuyoshi Nakada <nobu@...>
Date:
2007-03-19 16:52:54 UTC
List:
ruby-dev #30645
なかだです。
At Sat, 17 Mar 2007 18:36:07 +0900,
KUBO Takehiro wrote in [ruby-dev:30618]:
> detach_process_watcher() に渡される引数は、rb_detach_process のスレッ
> ドのスタック上の値になっています。rb_waitpid() が実行される前に
> rb_detach_process のスレッドが動いてスタック上の値が書き変わったら、
> rb_waitpid() に渡される pid はわけのわからない値になります。
たしかに。
> 正しくはこう?
>
> static VALUE
> detach_process_watcher(void *arg) <- int *pid_p を void *arg に
> {
> rb_pid_t pid = (int)arg; <- void* を rb_pid_t に戻す。
> rb_pid_t cpid;
> int status;
>
> for (;;) {
> cpid = rb_waitpid(pid, &status, WNOHANG); <- *pid_p を pid に
> if (cpid != 0) return rb_last_status_get();
> rb_thread_sleep(1);
1.9ではpollingは不要になったはずです。
この際なので、1.8でもwatchスレッドからexit statusをかえすように
しませんか。
* process.c (detach_process_watcher): should not pass the pointer
to an auto variable to the thread to be created. pointed and
fix by KUBO Takehiro <kubo at jiubao.org> [ruby-dev:30618]
* process.c (detach_process_watcher): now returns the exit status
of the detached process.
Index: trunk/process.c
===================================================================
--- trunk/process.c (revision 12102)
+++ trunk/process.c (working copy)
@@ -861,14 +861,13 @@ proc_waitall(void)
static VALUE
-detach_process_watcher(int *pid_p)
+detach_process_watcher(void *arg)
{
- rb_pid_t cpid;
+ rb_pid_t cpid, pid = (rb_pid_t)arg;
int status;
- for (;;) {
- cpid = rb_waitpid(*pid_p, &status, WNOHANG);
- if (cpid != 0) return rb_last_status_get();
- rb_thread_sleep(1);
+ while ((cpid = rb_waitpid(pid, &status, 0)) == 0) {
+ /* wait while alive */
}
+ return rb_last_status_get();
}
@@ -876,5 +875,5 @@ VALUE
rb_detach_process(rb_pid_t pid)
{
- return rb_thread_create(detach_process_watcher, (void*)&pid);
+ return rb_thread_create(detach_process_watcher, (void*)pid);
}
@@ -892,6 +891,5 @@ rb_detach_process(rb_pid_t pid)
* process _pid_ when it terminates. Use <code>detach</code>
* only when you do not intent to explicitly wait for the child to
- * terminate. <code>detach</code> only checks the status
- * periodically (currently once each second).
+ * terminate.
*
* The waiting thread returns the exit status of the detached process
Index: stable/process.c
===================================================================
--- stable/process.c (revision 12102)
+++ stable/process.c (working copy)
@@ -839,14 +839,13 @@ proc_waitall()
static VALUE
-detach_process_watcher(pid_p)
- int *pid_p;
+detach_process_watcher(arg)
+ void *arg;
{
- int cpid, status;
+ int pid = (int)arg, status;
- for (;;) {
- cpid = rb_waitpid(*pid_p, &status, WNOHANG);
- if (cpid != 0) return Qnil;
+ while (rb_waitpid(pid, &status, WNOHANG) == 0) {
rb_thread_sleep(1);
}
+ return rb_last_status;
}
@@ -855,5 +854,5 @@ rb_detach_process(pid)
int pid;
{
- return rb_thread_create(detach_process_watcher, (void*)&pid);
+ return rb_thread_create(detach_process_watcher, (void*)pid);
}
@@ -874,4 +873,9 @@ rb_detach_process(pid)
* periodically (currently once each second).
*
+ * The waiting thread returns the exit status of the detached process
+ * when it terminates, so you can use <code>Thread#join</code> to
+ * know the result. If specified _pid_ is not a valid child process
+ * ID, the thread returns +nil+ immediately.
+ *
* In this first example, we don't reap the first child process, so
* it appears as a zombie in the process status display.
--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦