[#26266] pragma on ripper — nobuyoshi nakada <nobuyoshi.nakada@...>
なかだです。
こんにちは、なかむら(う)です。
なかだです。
[#26284] ext/tk/sample/tkextlib/tile/demo.rb で TypeError — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
山本です。
[#26298] ext/tk/sample/tkextlib/tile/themes — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
山本です。
[#26305] ext/tk/sample/tkextlib/ICONS/viewIcons.rb — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
山本です。
永井@知能.九工大です.
[#26312] rb_gc_mark_threads spin — Tanaka Akira <akr@...17n.org>
最近、とあるプログラム(五月雨)が、無限ループに陥ることが何回かありました。
なかだです。
In article <TYOMLEM04FRaqbC8wSA00000024@tyomlvem02.e2k.ad.ge.com>,
なかだです。
In article <TYOMLEM04FRaqbC8wSA00000025@tyomlvem02.e2k.ad.ge.com>,
なかだです。
In article <TYOMLEM04Rqf69aZbLA0000002d@tyomlvem02.e2k.ad.ge.com>,
なかだです。
In article <200506101543.j5AFhToG009328@sharui.nakada.niregi.kanuma.tochigi.jp>,
In article <8764wlil9l.fsf@m17n.org>,
なかだです。
In article <200506111335.j5BDZkoG019423@sharui.nakada.niregi.kanuma.tochigi.jp>,
まつもと ゆきひろです
In article <1118583170.298416.26464.nullmailer@x31.priv.netlab.jp>,
まつもと ゆきひろです
In article <1118586617.180748.27381.nullmailer@x31.priv.netlab.jp>,
[#26324] XMLRPC charset — Kazuhiro NISHIYAMA <zn@...>
西山和広です。
[#26358] test failures and errors — Kazuhiro NISHIYAMA <zn@...>
西山和広です。
[#26387] warningを減らす — Kazuhiro NISHIYAMA <zn@...>
西山和広です。
[#26405] WEBrick DoS vulnerability — Tanaka Akira <akr@...17n.org>
NetBSD 2.0 で WEBrick を使って HTTP サーバを動かした場合、クライアント
ごとうゆうぞうです。
In article <20050708.175802.957830318.gotoyuzo@sawara.does.notwork.org>,
In message <87fyupzgcq.fsf@m17n.org>,
In article <20050708.211519.179953950.gotoyuzo@sawara.does.notwork.org>,
In message <87d5ptzdpc.fsf@m17n.org>,
前田です。
In article <42CF1AF2.5000407@ruby-lang.org>,
In message <878y0erpv7.fsf@m17n.org>,
[#26410] irbのlexerが数値認識に失敗 — Kazuhiro NISHIYAMA <zn@...>
西山和広です。
[#26417] test.rb failed 167W: ruby 1.9.0 (2005-06-30) [i686-linux] (boron) — Kazuhiro NISHIYAMA <zn@...>
西山和広です。
[#26421] Subversion — Shugo Maeda <shugo@...>
前田です。
まつもと ゆきひろです
こんにちは、なかむら(う)です。
山本です。
須藤です.
In article <20050703.152549.41008576.kou@cozmixng.org>,
[ruby-dev:26264] Re: IO.select dumps core
なかだです。
At Thu, 2 Jun 2005 04:18:40 +0900,
Tanaka Akira wrote in [ruby-dev:26262]:
> 基本的な方針は「なぜか余計にメモリを確保しておいて動いたらラッキー」な
> ので、今まで参照していなかった FD_SETSIZE は今さら参照しなくても書ける
> はずなんじゃないかと思います。
[ruby-dev:26255]からのパッチです。
diff -U2 eval.c eval.c
--- eval.c 31 May 2005 06:45:05 -0000
+++ eval.c 2 Jun 2005 00:38:29 -0000
@@ -9782,5 +9782,6 @@
{
fds->maxfd = 0;
- fds->maskp = 0;
+ fds->fdset = ALLOC(fd_set);
+ FD_ZERO(fds->fdset);
}
@@ -9789,6 +9790,7 @@
rb_fdset_t *fds;
{
- if (fds->maskp) free(fds->maskp);
- rb_fd_init(fds);
+ if (fds->fdset) free(fds->fdset);
+ fds->maxfd = 0;
+ fds->fdset = 0;
}
@@ -9797,6 +9799,7 @@
rb_fdset_t *fds;
{
- if (fds->maskp) {
- MEMZERO(fds->maskp, fd_mask, howmany(fds->maxfd, NFDBITS));
+ if (fds->fdset) {
+ MEMZERO(fds->fdset, fd_mask, howmany(fds->maxfd, NFDBITS));
+ FD_ZERO(fds->fdset);
}
}
@@ -9807,12 +9810,16 @@
rb_fdset_t *fds;
{
- int m = howmany(n + 1, NFDBITS), o = howmany(fds->maxfd, NFDBITS);
+ int m = howmany(n + 1, NFDBITS) * NFDBITS;
+ int o = howmany(fds->maxfd, NFDBITS) * NFDBITS;
+
+ if (m < sizeof(fd_set)) m = sizeof(fd_set);
+ if (o < sizeof(fd_set)) o = sizeof(fd_set);
if (m > o) {
- REALLOC_N(fds->maskp, fd_mask, m);
- MEMZERO(fds->maskp + howmany(fds->maxfd, NFDBITS), fd_mask, m - o);
+ fds->fdset = realloc(fds->fdset, m);
+ memset((char *)fds->fdset + o, 0, m - o);
}
if (n >= fds->maxfd) fds->maxfd = n + 1;
- FD_SET(n, (fd_set *)fds->maskp);
+ FD_SET(n, fds->fdset);
}
@@ -9823,5 +9830,5 @@
{
if (n >= fds->maxfd) return;
- FD_CLR(n, (fd_set *)fds->maskp);
+ FD_CLR(n, fds->fdset);
}
@@ -9832,5 +9839,5 @@
{
if (n >= fds->maxfd) return 0;
- return FD_ISSET(n, (fd_set *)fds->maskp);
+ return FD_ISSET(n, fds->fdset);
}
@@ -9841,13 +9848,10 @@
int max;
{
- if ((dst->maxfd = max) > 0) {
- int n = howmany(max, NFDBITS);
- REALLOC_N(dst->maskp, fd_mask, n);
- MEMCPY(dst->maskp, src, fd_mask, n);
- }
- else {
- xfree(dst->maskp);
- dst->maskp = 0;
- }
+ int size = howmany(max, NFDBITS) * NFDBITS;
+
+ if (size < sizeof(fd_set)) size = sizeof(fd_set);
+ dst->maxfd = max;
+ dst->fdset = realloc(dst->fdset, size);
+ memcpy(dst->fdset, src, size);
}
@@ -10206,4 +10210,7 @@
if (th->next) th->next->prev = th->prev;
}
+ rb_fd_term(&th->readfds);
+ rb_fd_term(&th->writefds);
+ rb_fd_term(&th->exceptfds);
if (th != main_thread) free(th);
}
diff -U2 intern.h intern.h
--- intern.h 31 May 2005 06:44:32 -0000
+++ intern.h 1 Jun 2005 01:05:26 -0000
@@ -149,5 +149,5 @@
typedef struct {
int maxfd;
- fd_mask *maskp;
+ fd_set *fdset;
} rb_fdset_t;
@@ -162,5 +162,5 @@
void rb_fd_copy _((rb_fdset_t *, const fd_set *, int));
-#define rb_fd_ptr(f) ((fd_set *)(f)->maskp)
+#define rb_fd_ptr(f) ((f)->fdset)
#define rb_fd_max(f) ((f)->maxfd)
diff -U2 ext/socket/socket.c ext/socket/socket.c
--- ext/socket/socket.c 31 May 2005 07:02:27 -0000
+++ ext/socket/socket.c 2 Jun 2005 00:40:00 -0000
@@ -889,23 +889,23 @@
static int
-wait_connectable0(fd, fds)
+wait_connectable0(fd, fds_w, fds_e)
int fd;
- rb_fdset_t *fds;
+ rb_fdset_t *fds_w, *fds_e;
{
int sockerr, sockerrlen;
for (;;) {
- rb_fd_zero(&fds[0]);
- rb_fd_zero(&fds[1]);
+ rb_fd_zero(fds_w);
+ rb_fd_zero(fds_e);
- rb_fd_set(fd, &fds[0]);
- rb_fd_set(fd, &fds[1]);
+ rb_fd_set(fd, fds_w);
+ rb_fd_set(fd, fds_e);
- rb_thread_select(fd+1, 0, rb_fd_ptr(&fds[0]), rb_fd_ptr(&fds[1]), 0);
+ rb_thread_select(fd+1, 0, rb_fd_ptr(fds_w), rb_fd_ptr(fds_e), 0);
- if (rb_fd_isset(fd, &fds[0])) {
+ if (rb_fd_isset(fd, fds_w)) {
return 0;
}
- else if (rb_fd_isset(fd, &fds[1])) {
+ else if (rb_fd_isset(fd, fds_e)) {
sockerrlen = sizeof(sockerr);
if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *)&sockerr,
@@ -924,5 +924,6 @@
struct wait_connectable_arg {
int fd;
- rb_fdset_t *fds;
+ rb_fdset_t fds_w;
+ rb_fdset_t fds_e;
};
@@ -933,5 +934,5 @@
{
struct wait_connectable_arg *p = (struct wait_connectable_arg *)arg;
- return (VALUE)wait_connectable0(p->fd, p->fds);
+ return (VALUE)wait_connectable0(p->fd, &p->fds_w, &p->fds_e);
}
@@ -941,6 +942,6 @@
{
struct wait_connectable_arg *p = (struct wait_connectable_arg *)arg;
- rb_fd_term(&p->fds[0]);
- rb_fd_term(&p->fds[1]);
+ rb_fd_term(&p->fds_w);
+ rb_fd_term(&p->fds_e);
return Qnil;
}
@@ -953,6 +954,6 @@
struct wait_connectable_arg arg;
- rb_fd_init(&arg.fds[0]);
- rb_fd_init(&arg.fds[1]);
+ rb_fd_init(&arg.fds_w);
+ rb_fd_init(&arg.fds_e);
#ifdef HAVE_RB_FD_INIT
arg.fd = fd;
@@ -960,5 +961,5 @@
wait_connectable_ensure,(VALUE)&arg);
#else
- return wait_connectable0(fd, arg.fds);
+ return wait_connectable0(fd, &arg.fds_w, &arg.fds_e);
#endif
}
@@ -1776,17 +1777,4 @@
}
-#if defined(HAVE_RECVMSG) && (FD_PASSING_BY_MSG_CONTROL || FD_PASSING_BY_MSG_ACCRIGHTS)
-static void
-thread_read_select(fd)
- int fd;
-{
- rb_fdset_t fds;
-
- rb_fd_init(&fds);
- rb_fd_set(fd, &fds);
- rb_thread_select(fd+1, rb_fd_ptr(&fds), 0, 0, 0);
-}
-#endif
-
static VALUE
unix_recv_io(argc, argv, sock)
@@ -1818,5 +1806,5 @@
GetOpenFile(sock, fptr);
- thread_read_select(fptr->fd);
+ rb_io_wait_readable(fptr->fd);
msg.msg_name = NULL;
--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦