[#25010] test_flush fails. — "URABE Shyouhei aka.mput" <root@...>
mput です。以下のように test_flush が失敗します。
[#25031] Method#to_proc とブロックの引渡し — Masahiro Sakai (酒井政裕) <sakai@...>
酒井といいます。
[#25035] 拡張ライブラリへの共有ライブラリのPATHの埋め込み — Takahiro Kambe <taca@...>
こんにちは。
なかだです。
In message <200412060607.iB667giF007533@sharui.nakada.niregi.kanuma.tochigi.jp>
なかだです。
In message <200412070015.iB70FAiF012770@sharui.nakada.niregi.kanuma.tochigi.jp>
2004-12-07 (火) の 12:27 +0900 に Takahiro Kambe さんは書きました:
こんにちは、なかむら(う)です。
In message <1102395885.21598.19.camel@rice.p.arika.org>
なかだです。
In message <200412071613.iB7GD2r4007918@sharui.nakada.niregi.kanuma.tochigi.jp>
[#25041] temporal locking already locked string on simultaneous write — Tanaka Akira <akr@...17n.org>
同じ文字列をほぼ同時に IO に書き込むと、temporal locking already
まつもと ゆきひろです
In article <1102133507.339625.10453.nullmailer@x31.priv.netlab.jp>,
In article <1102176395.383559.21204.nullmailer@x31.priv.netlab.jp>,
まつもと ゆきひろです
Tietew です。
[#25054] rexml — Takahiro Kambe <taca@...>
こんばんは。
なかだです。
In message <200412051451.iB5EpYiF009060@sharui.nakada.niregi.kanuma.tochigi.jp>
まつもと ゆきひろです
In message <1102290330.040938.1210.nullmailer@x31.priv.netlab.jp>
[#25096] double free problem — "Akinori MUSHA" <knu@...>
ご無沙汰しております。
Hi,
In article <1102401703.030252.2480.nullmailer@x31.priv.netlab.jp>,
まつもと ゆきひろです
Yukihiro Matsumoto wrote:
Yukihiro Matsumoto wrote:
In article <41BEF768.7030008@ttsky.net>,
Tanaka Akira wrote:
[#25101] non-stdio buffering — Tanaka Akira <akr@...17n.org>
えぇと、今回 1.9 でなにが起きたのかを私が把握している範囲でまとめてお
こんにちは、なかむら(う)です。
In article <20041208.033521.635728872.gotoyuzo@sawara.does.notwork.org>,
[#25103] ruby_xrealloc dumps core — Tietew <tietew-ml-ruby-dev@...>
Tietew です。
[#25134] Set/test_eq failed on Tru64UNIX — Minero Aoki <aamine@...>
青木です。
なかだです。
まつもと ゆきひろです
[#25152] 1.8 reopen problem with duplex popen — Tanaka Akira <akr@...17n.org>
次のように、1.8 で双方向 popen な IO を reopen するとエラーになること
なかだです。
In article <200412110142.iBB1gDIh004622@sharui.nakada.niregi.kanuma.tochigi.jp>,
なかだです。
わたなべです。
In article <41-Tue21Dec2004123451+0900-eban@os.rim.or.jp>,
[#25158] core dump on NetBSD 2.0 — Tanaka Akira <akr@...17n.org>
NetBSD 2.0 で次のようにすると core を吐きます。
In article <87hdmsivva.fsf@serein.a02.aist.go.jp>,
In article <87ekhwiv7g.fsf@serein.a02.aist.go.jp>,
なかだです。
In article <200412130040.iBD0e8Qh003275@sharui.nakada.niregi.kanuma.tochigi.jp>,
まつもと ゆきひろです
In article <1102906796.625997.23964.nullmailer@x31.priv.netlab.jp>,
前田です。
In article <41BD40DC.6030706@ruby-lang.org>,
まつもと ゆきひろです
[#25160] ripper in snapshot.tar.gz — Tanaka Akira <akr@...17n.org>
ふと、とある autoconf も bison も入っていない環境で Ruby をコンパイル
[#25193] 1.8.2 release schedule — Yukihiro Matsumoto <matz@...>
まつもと ゆきひろです
[#25226] Zlib::Deflate.deflate dumps core — Tanaka Akira <akr@...17n.org>
次のようにすると core を吐きます。
[#25236] BSD/OS rlim_t — OHARA Shigeki <os@...>
大原です。
[#25252] core dump if local_append_gen invokes GC — Tanaka Akira <akr@...17n.org>
先程 1.9 を make test-all したところ、
[#25270] BSD/OS LDSHARED — OHARA Shigeki <os@...>
大原です。
[#25283] 1.8.2 preview4 — Yukihiro Matsumoto <matz@...>
Hello,
[#25292] tkutil is installed on no tcl/tk environment — Tanaka Akira <akr@...17n.org>
ふと気がついたのですが、Tcl/Tk が入っていない環境でも、tkutil は
[#25299] Re: リリース準備 — Yukihiro Matsumoto <matz@...>
まつもと ゆきひろです
高橋征義です。
山本です。
小西 弘将です。
山本です。
山本です。
山本です。
永井@知能.九工大です.
[#25302] test_readline.rb blocks on BSD again — GOTOU Yuuzou <gotoyuzo@...>
In message <20041223175402.3116FC6718@lithium.ruby-lang.org>,
In message <20041224.131211.846943951.gotoyuzo@sawara.does.notwork.org>,
まつもと ゆきひろです
わたなべです。
In message <20041225140050.378109.eban@os.rim.or.jp>,
なかだです。
In article <200412251620.iBPGK1xA009288@sharui.nakada.niregi.kanuma.tochigi.jp>,
なかだです。
In article <200412260300.iBQ3038u005055@sharui.nakada.niregi.kanuma.tochigi.jp>,
[#25336] webrick/httpauth.rb must require 'base64' — sheepman <sheepman@...>
こんにちは、sheepman です。
[#25341] String#center dumps core — Tanaka Akira <akr@...17n.org>
次のようにすると core を吐きます。
なかだです。
[#25342] 1.9.0でbcc版がコンパイルできない — 小西 弘将 <konishih@...6.so-net.ne.jp>
小西 弘将です。
山本です。
[#25365] method(:p).to_proc.call([]) — Masahiro Sakai (酒井政裕) <sakai@...>
酒井です。
[#25370] FileUtils.copy_stream on nonblocking IO — Tanaka Akira <akr@...17n.org>
FileUtils.copy_stream を nonblocking な IO に対して使うと、次のように
[ruby-dev:25038] Continuation protection (Re: Re: IO#flush dumps core again)
なかだです。
At Thu, 2 Dec 2004 14:57:14 +0900,
Yukihiro Matsumoto wrote in [ruby-dev:25029]:
> |rb_protect()自体をこうしてしまったほうがいいような気がしてきま
> |した。rb_protect()を使うようなところからcallccを外部に持ち出せ
> |て嬉しいというか、安全な状況はあまりないと思います。
>
> 賛成です。コミット希望。
スレッドを考慮してませんでした。
protectはrb_protect()を呼ぶグローバルメソッドとして
$ cat ext/protect/protect.c
#include "ruby.h"
static VALUE
call_protect(argc, argv)
int argc;
VALUE *argv;
{
VALUE val;
int state;
rb_scan_args(argc, argv, "01", &val);
val = rb_protect(rb_yield, val, &state);
if (state) rb_jump_tag(state);
return val;
}
void
Init_protect()
{
rb_define_global_function("protect", call_protect, -1);
}
途中で別スレッドでrb_protect()を使うと対応が合わなくなります。
$ ruby -rprotect -e '
trap("INT"){c=nil;(puts; c.call(false)) if callcc{|c|
Thread.pass;print "."; true}}
Thread.new{protect{Process.kill("INT", $$)}}.join'
.
-e:2:in `call': continuation called across trap (RuntimeError)
from -e:2
from -e:2:in `call'
from -e:4:in `initialize'
from -e:4:in `new'
from -e:4
また、外部の継続も呼び出せないのはちょっと制限がきついかもとい
う気がして来ました。
$ ruby -rprotect -e '
c=nil
protect{puts; c.call(false)} if callcc{|c| print "."; true}'
-e:3:in `call': continuation called across trap (RuntimeError)
from -e:3
from -e:3:in `protect'
from -e:3
Index: eval.c
===================================================================
RCS file: /cvs/ruby/src/ruby/eval.c,v
retrieving revision 1.741
diff -U2 -p -d -r1.741 eval.c
--- eval.c 2 Dec 2004 15:17:35 -0000 1.741
+++ eval.c 3 Dec 2004 05:01:23 -0000
@@ -1298,4 +1298,7 @@ static int thread_set_raised();
static int thread_reset_raised();
+static void thread_push_cont_protect();
+static void thread_pop_cont_protect();
+
static VALUE exception_error;
static VALUE sysstack_error;
@@ -5147,6 +5150,4 @@ rb_rescue(b_proc, data1, r_proc, data2)
}
-static VALUE cont_protect;
-
VALUE
rb_protect(proc, data, state)
@@ -5159,9 +5160,9 @@ rb_protect(proc, data, state)
PUSH_TAG(PROT_NONE);
- cont_protect = (VALUE)rb_node_newnode(NODE_MEMO, cont_protect, 0, 0);
+ thread_push_cont_protect();
if ((status = EXEC_TAG()) == 0) {
result = (*proc)(data);
}
- cont_protect = ((NODE *)cont_protect)->u1.value;
+ thread_pop_cont_protect();
POP_TAG();
if (state) {
@@ -9585,4 +9586,5 @@ struct thread {
VALUE thread;
+ NODE *cont_protect;
};
@@ -9657,4 +9659,20 @@ thread_reset_raised()
}
+static void
+thread_push_cont_protect()
+{
+ NODE *c = curr_thread->cont_protect;
+ curr_thread->cont_protect =
+ rb_node_newnode(NODE_MEMO, (VALUE)c, Qtrue, 0);
+}
+
+static void
+thread_pop_cont_protect()
+{
+ NODE *c = curr_thread->cont_protect;
+ curr_thread->cont_protect = c->u1.node;
+ c->u2.value = Qfalse;
+}
+
static void rb_thread_ready _((rb_thread_t));
@@ -9785,4 +9803,5 @@ thread_mark(th)
rb_mark_tbl(th->locals);
rb_gc_mark(th->thgroup);
+ rb_gc_mark((VALUE)th->cont_protect);
/* mark data in copied stack */
@@ -11336,4 +11355,5 @@ rb_thread_group(thread)
th->locals = 0;\
th->thread = 0;\
+ th->cont_protect = 0;\
} while (0)
@@ -12274,5 +12294,5 @@ rb_callcc(self)
}
th->thread = curr_thread->thread;
- th->thgroup = cont_protect;
+ th->cont_protect = curr_thread->cont_protect;
for (vars = ruby_dyna_vars; vars; vars = vars->next) {
@@ -12316,6 +12336,6 @@ rb_cont_call(argc, argv, cont)
rb_raise(rb_eRuntimeError, "continuation called across threads");
}
- if (th->thgroup != cont_protect) {
- rb_raise(rb_eRuntimeError, "continuation called across trap");
+ if (th->cont_protect && !RTEST(th->cont_protect->u2.value)) {
+ rb_raise(rb_eRuntimeError, "continuation called across context");
}
switch (argc) {
--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦