[#45703] test_advise failure on GNU/Linux — Tanaka Akira <tanaka.akira@...>

今朝、気がついたのですが、手元で test_advise が失敗します。

11 messages 2012/06/05
[#45705] Re: test_advise failure on GNU/Linux — KOSAKI Motohiro <kosaki.motohiro@...> 2012/06/06

小崎です

[#45735] [ruby-trunk - Feature #6587][Open] proposal: adding new methods File.rootname and Pathname#rootname — "usa (Usaku NAKAMURA)" <usa@...>

14 messages 2012/06/14

[#45745] Re: [ruby-changes:24028] yugui:r36079 (trunk): Embedding CRuby interpreter without internal headers has been difficult — SASADA Koichi <ko1@...>

見逃していました.

19 messages 2012/06/14
[#45747] Re: [ruby-changes:24028] yugui:r36079 (trunk): Embedding CRuby interpreter without internal headers has been difficult — Yugui <yugui@...> 2012/06/15

2012/6/15 SASADA Koichi <ko1@atdot.net>:

[#45748] Re: [ruby-changes:24028] yugui:r36079 (trunk): Embedding CRuby interpreter without internal headers has been difficult — SASADA Koichi <ko1@...> 2012/06/15

 ささだです.

[#45794] :new_pgroup and :pgroup option for spawn. — Tanaka Akira <akr@...>

process.c で気がついたのですが、spawn に Windows 用の :new_pgroup というオプションが

12 messages 2012/06/23
[#45800] Re: :new_pgroup and :pgroup option for spawn. — "U.Nakamura" <usa@...> 2012/06/25

こんにちは、なかむら(う)です。

[#45818] [ruby-trunk - Feature #6643][Open] io.seek(off, :end) — "akr (Akira Tanaka)" <akr@...>

30 messages 2012/06/25

[ruby-dev:45780] Re: [ruby-changes:24083] nobu:r36134 (trunk): process.c: no method calls in async-signal-safe

From: Tanaka Akira <akr@...>
Date: 2012-06-19 14:48:21 UTC
List: ruby-dev #45780
2012/6/19 nobu <ko1@atdot.net>:
> nobu    2012-06-19 17:51:57 +0900 (Tue, 19 Jun 2012)
>
>  New Revision: 36134
>
>  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36134
>
>  Log:
>    process.c: no method calls in async-signal-safe
>
>    * process.c (rb_execarg_run_options): do not call any methods in the
>      async-signal-safe function.  mask has been checked with NUM2MODET()
>      already and converted with LONG2NUM().

> Index: process.c
> ===================================================================
> --- process.c   (revision 36133)
> +++ process.c   (revision 36134)
> @@ -17,6 +17,8 @@
>  #include "internal.h"
>  #include "vm_core.h"
>
> +#define STATIC_ASSERT(name, expr) typedef int static_assert_##name##_check[1 - 2*!(expr)]
> +
>  #include <stdio.h>
>  #include <errno.h>
>  #include <signal.h>
> @@ -1595,6 +1597,7 @@
>                                   hide_obj(rb_str_dup(val)));
>         }
>         else if (id == rb_intern("umask")) {
> +           STATIC_ASSERT(sizeof_mode_t, sizeof(long) >= sizeof(mode_t)); /* for LONG2NUM */
>            mode_t cmask = NUM2MODET(val);
>             if (!NIL_P(rb_ary_entry(options, EXEC_OPTION_UMASK))) {
>                 rb_raise(rb_eArgError, "umask option specified twice");
> @@ -2707,7 +2710,7 @@
>
>     obj = rb_ary_entry(options, EXEC_OPTION_UMASK);
>     if (!NIL_P(obj)) {
> -        mode_t mask = NUM2MODET(obj);
> +        mode_t mask = (mode_t)FIX2LONG(obj); /* no method calls */
>         mode_t oldmask = umask(mask); /* never fail */ /* async-signal-safe */
>         if (!NIL_P(soptions))
>             rb_ary_store(soptions, EXEC_OPTION_UMASK, MODET2NUM(oldmask));

どういう状況でこの NUM2MODET からメソッド呼び出しが起こるのか
理解できなかったんですが、どういう話なんでしょう?
-- 
[田中 哲][たなか あきら][Tanaka Akira]

In This Thread

Prev Next