[#28217] ANDCALL operator (Re: [ruby-list:41768] Re: nilの扱い) — nobuyoshi nakada <nobuyoshi.nakada@...>
なかだです。
6 messages
2006/01/13
[#28223] FYI: Fix bug: FileUtils.mv() does not unlink source file when moving over filesystem boundaries — 植田裕之 <ueda@...>
植田と申します。
7 messages
2006/01/17
[#28227] Re: FYI: Fix bug: FileUtils.mv() does not unlink source file when moving over filesystem boundaries
— akira yamada / やまだあきら <akira@...>
2006/01/17
植田裕之 wrote:
[#28230] bcc32 memory manager — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
山本です。
15 messages
2006/01/18
[#28231] Re: bcc32 memory manager
— "U.Nakamura" <usa@...>
2006/01/18
こんにちは、なかむら(う)です。
[#28232] Re: bcc32 memory manager
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2006/01/18
山本です。
[#28358] Re: bcc32 memory manager
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2006/02/21
山本です。
[#28376] Re: bcc32 memory manager
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2006/02/23
山本です。
[#28233] 1.8.5 release plan? — "URABE Shyouhei aka. mput" <root@...>
卜部です。
9 messages
2006/01/18
[#28240] String クラス insert メソッド — 北浦 友規 <uv2t-ktur@...>
String クラスの insert メソッドは、
6 messages
2006/01/19
[#28243] FUNCTION_CALL_MAY_RETURN_TWICE — Hajimu UMEMOTO <ume@...>
梅本です。
18 messages
2006/01/20
[#28253] Re: FUNCTION_CALL_MAY_RETURN_TWICE
— Tanaka Akira <akr@...17n.org>
2006/01/21
In article <ygeoe26gnuj.wl%ume@mahoroba.org>,
[#28254] Re: FUNCTION_CALL_MAY_RETURN_TWICE
— Hajimu UMEMOTO <ume@...>
2006/01/21
梅本です。
[#28255] Re: FUNCTION_CALL_MAY_RETURN_TWICE
— Tanaka Akira <akr@...17n.org>
2006/01/21
In article <ygelkxagkse.wl%ume@mahoroba.org>,
[#28261] Re: FUNCTION_CALL_MAY_RETURN_TWICE
— Hajimu UMEMOTO <ume@...>
2006/01/21
梅本です。
[#28247] Re: FUNCTION_CALL_MAY_RETURN_TWICE
— Tanaka Akira <akr@...17n.org>
2006/01/20
In article <ygezmlrqybi.wl%ume@mahoroba.org>,
[#28270] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
山本です。
17 messages
2006/01/23
[#28271] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2006/01/23
山本です。
[#28272] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes
— WATANABE Hirofumi <eban@...>
2006/01/23
わたなべです。
[#28273] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2006/01/23
山本です。
[#28274] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2006/01/24
山本です。
[#28275] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes
— "U.Nakamura" <usa@...>
2006/01/24
こんにちは、なかむら(う)です。
[#28276] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2006/01/24
山本です。
[#28277] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2006/01/24
山本です。
[#28278] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2006/01/24
山本です。
[#28279] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2006/01/24
山本です。
[#28281] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2006/01/25
[#28282] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes
— Yukihiro Matsumoto <matz@...>
2006/01/25
まつもと ゆきひろです
[#28283] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2006/01/26
山本です。
[#28286] SEGV with zlib — Tanaka Akira <akr@...17n.org>
最近、Data オブジェクトの free 関数が気になっているのですが、
24 messages
2006/01/30
[#28303] Re: SEGV with zlib
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2006/02/06
山本です。
[#28304] Re: SEGV with zlib
— Yukihiro Matsumoto <matz@...>
2006/02/06
まつもと ゆきひろです
[#28305] Re: SEGV with zlib
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2006/02/06
山本です。
[#28306] Re: SEGV with zlib
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2006/02/06
山本です。
[#28307] Re: SEGV with zlib
— Tietew <tietew-ml-ruby-dev@...>
2006/02/06
[#28308] Re: SEGV with zlib
— Yukihiro Matsumoto <matz@...>
2006/02/06
まつもとゆきひろです。
[#28309] Re: SEGV with zlib
— Yukihiro Matsumoto <matz@...>
2006/02/07
まつもと ゆきひろです
[#28310] Re: SEGV with zlib
— "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
2006/02/07
山本です。
[#28312] Re: SEGV with zlib
— Yukihiro Matsumoto <matz@...>
2006/02/07
まつもと ゆきひろです
[#28316] Re: SEGV with zlib
— Tanaka Akira <akr@...17n.org>
2006/02/07
In article <34e00f690602060546l1ef5b22em52589f23240a8e43@mail.gmail.com>,
[#28317] Re: SEGV with zlib
— Yukihiro Matsumoto <matz@...>
2006/02/08
まつもと ゆきひろです
[#28318] Re: SEGV with zlib
— Tanaka Akira <akr@...17n.org>
2006/02/08
In article <1139361872.676364.14519.nullmailer@x31.priv.netlab.jp>,
[ruby-dev:28281] Re: [PATCH] solaris 10 isinf and ruby_setenv fixes
From:
"H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
Date:
2006-01-25 04:39:20 UTC
List:
ruby-dev #28281
山本です。
>もう今日はやらないつもりでしたが、思いついたことがあったので試して
>みたところ、かなり単純化できました。
>
> p ENV
> $0 = $0 # test/unit/ui/console/testrunner.rb (HEAD) modifies $0
> p ENV
>
>パッチを当てると、HEAD も ruby_1_8 も二番目の p ENV が { , , , , } になります。
>
>ruby_1_8 でエラーにならなかったのは、test/unit/ui/console/testrunner.rb で
>$0 を変更していなかったからでした。
>
>そして $0= の実装である set_arg0 には
>
> ruby_setenv("", NULL); /* duplicate environ vars */
>
>なんて行があるので、どうも setenv の独自実装と $0= は依存している感じですね。
$0= で origargv を変更しているのが environ にも影響している感じなのですが、
この処理って本当に必要なんでしょうか?environ を変更するのと同じぐらい
危ない処理に思えますが・・・
マニュアルによると、$0= を使うと ps の結果が変わることがあるという説明なので、
変わらなくなっても仕様に反することにはならないかなと思うのですが・・・
とりあえず、下のパッチで TestDrive でも成功するようになりました。
まとめると、
1. set_arg0 は environ がコピーされることを前提とする場合がある(setproctitle(3)
がない場合など)
2. にもかかわらず ruby_setenv で独自実装を使わず setenv(3) を使うと、set_arg0 を
呼んだときに一緒に environ まで変更されてしまうことがある。
3. しかし、environ を直接変更するのは規約に違反し、Solaris では SEGV するらしい。
Index: configure.in
===================================================================
RCS file: /src/ruby/configure.in,v
retrieving revision 1.296
diff -u -w -b -p -r1.296 configure.in
--- configure.in 22 Jan 2006 11:34:51 -0000 1.296
+++ configure.in 24 Jan 2006 01:45:39 -0000
@@ -506,7 +506,7 @@ AC_CHECK_FUNCS(fmod killpg wait4 waitpid
getpriority getrlimit setrlimit\
dlopen sigprocmask sigaction _setjmp vsnprintf snprintf\
setsid telldir seekdir fchmod mktime timegm cosh sinh tanh\
- setuid setgid daemon select_large_fdset)
+ setuid setgid daemon select_large_fdset unsetenv)
AC_ARG_ENABLE(setreuid,
[ --enable-setreuid use setreuid()/setregid() according to need even if obsolete.],
[use_setreuid=$enableval])
@@ -514,6 +514,20 @@ if test "$use_setreuid" = yes; then
AC_DEFINE(USE_SETREUID)
AC_DEFINE(USE_SETREGID)
fi
+AC_CACHE_CHECK(for setenv (2 arguments), rb_cv_have_setenv_2args,
+ [AC_TRY_COMPILE([#include <stdlib.h>], [setenv("foo", "foo");],
+ rb_cv_have_setenv_2args=yes,
+ rb_cv_have_setenv_2args=no)])
+if test "$rb_cv_have_setenv_2args" = yes; then
+ AC_DEFINE(HAVE_SETENV_2ARGS)
+fi
+AC_CACHE_CHECK(for setenv (3 arguments), rb_cv_have_setenv_3args,
+ [AC_TRY_COMPILE([#include <stdlib.h>], [setenv("foo", "foo", 1);],
+ rb_cv_have_setenv_3args=yes,
+ rb_cv_have_setenv_3args=no)])
+if test "$rb_cv_have_setenv_3args" = yes; then
+ AC_DEFINE(HAVE_SETENV_3ARGS)
+fi
AC_STRUCT_TIMEZONE
AC_CACHE_CHECK(for struct tm.tm_gmtoff, rb_cv_member_struct_tm_tm_gmtoff,
[AC_TRY_COMPILE([#include <time.h>],
Index: hash.c
===================================================================
RCS file: /src/ruby/hash.c,v
retrieving revision 1.159
diff -u -w -b -p -r1.159 hash.c
--- hash.c 20 Oct 2005 02:56:22 -0000 1.159
+++ hash.c 24 Jan 2006 10:03:23 -0000
@@ -1690,7 +1690,14 @@ ruby_setenv(const char *name, const char
* RTL's environ global variable directly yet.
*/
SetEnvironmentVariable(name,value);
-#elif defined __CYGWIN__
+#elif defined(HAVE_SETENV_2ARGS) && defined(HAVE_UNSETENV)
+#undef setenv
+#undef unsetenv
+ if (value)
+ setenv(name,value);
+ else
+ unsetenv(name);
+#elif defined(HAVE_SETENV_3ARGS) && defined(HAVE_UNSETENV)
#undef setenv
#undef unsetenv
if (value)
Index: ruby.c
===================================================================
RCS file: /src/ruby/ruby.c,v
retrieving revision 1.112
diff -u -w -b -p -r1.112 ruby.c
--- ruby.c 12 Dec 2005 00:35:08 -0000 1.112
+++ ruby.c 24 Jan 2006 11:25:49 -0000
@@ -1041,51 +1041,10 @@ set_arg0(VALUE val, ID id)
j.pst_command = s;
pstat(PSTAT_SETCMD, j, i, 0, 0);
}
- rb_progname = rb_tainted_str_new(s, i);
#elif defined(HAVE_SETPROCTITLE)
setproctitle("%.*s", (int)i, s);
- rb_progname = rb_tainted_str_new(s, i);
-#else
- if (len == 0) {
- char *s = origargv[0];
- int i;
-
- s += strlen(s);
- /* See if all the arguments are contiguous in memory */
- for (i = 1; i < origargc; i++) {
- if (origargv[i] == s + 1) {
- s++;
- s += strlen(s); /* this one is ok too */
- }
- else {
- break;
- }
- }
-#ifndef DOSISH
- if (s + 1 == envspace.begin) {
- s = envspace.end;
- ruby_setenv("", NULL); /* duplicate environ vars */
- }
-#endif
- len = s - origargv[0];
- }
-
- if (i >= len) {
- i = len;
- memcpy(origargv[0], s, i);
- origargv[0][i] = '\0';
- }
- else {
- memcpy(origargv[0], s, i);
- s = origargv[0]+i;
- *s++ = '\0';
- while (++i < len)
- *s++ = ' ';
- for (i = 1; i < origargc; i++)
- origargv[i] = 0;
- }
- rb_progname = rb_tainted_str_new2(origargv[0]);
#endif
+ rb_progname = rb_tainted_str_new(s, i);
}
void