[#42369] [BUG: trunk] Lazy sweep and ObjectSpace.each_object — SASADA Koichi <ko1@...>

 ささだです。

14 messages 2010/10/13

[#42375] [Ruby 1.9-Feature#3946][Open] Array#packのqQ指定子に機種依存サイズフラグ!を追加 — Yui NARUSE <redmine@...>

Feature #3946: Array#packのqQ指定子に機種依存サイズフラグ!を追加

19 messages 2010/10/14
[#42380] Re: [Ruby 1.9-Feature#3946][Open] Array#packのqQ指定子に機種依存サイズフラグ!を追加 — Tanaka Akira <akr@...> 2010/10/14

2010年10月14日15:36 Yui NARUSE <redmine@ruby-lang.org>:

[#42381] Re: [Ruby 1.9-Feature#3946][Open] Array#packのqQ指定子に機種依存サイズフラグ!を追加 — "NARUSE, Yui" <naruse@...> 2010/10/14

(2010/10/14 21:07), Tanaka Akira wrote:

[#42619] [Ruby 1.9-Feature#3946][Open] Array#packのqQ指定子に機種依存サイズフラグ!を追加 — Usaku NAKAMURA <redmine@...> 2010/11/25

チケット #3946 が更新されました。 (by Usaku NAKAMURA)

[#42376] [Ruby 1.9-Feature#3947][Open] Array#packのにエンディアン指定修飾子</>を追加 — Yui NARUSE <redmine@...>

Feature #3947: Array#packのにエンディアン指定修飾子</>を追加

9 messages 2010/10/14

[#42464] [Ruby 1.9-Bug#3990][Assigned] tests of rexml/rss reports many errors and failures without iconv — Usaku NAKAMURA <redmine@...>

Bug #3990: tests of rexml/rss reports many errors and failures without iconv

40 messages 2010/10/27
[#42500] [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <redmine@...> 2010/10/30

チケット #3990 が更新されました。 (by Kouhei Sutou)

[#42510] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/01

成瀬です。

[#42514] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <kou@...> 2010/11/02

須藤です。

[#42515] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/02

(2010/11/02 21:50), Kouhei Sutou wrote:

[#42516] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <kou@...> 2010/11/02

須藤です。

[#42517] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/02

成瀬です。

[#42518] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <kou@...> 2010/11/02

須藤です。

[#42519] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/03

成瀬です。

[#42543] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <kou@...> 2010/11/06

須藤です。

[#42548] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/07

(2010/11/06 12:10), Kouhei Sutou wrote:

[#42549] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <kou@...> 2010/11/07

須藤です。

[#42572] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/13

成瀬です。

[#42592] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <kou@...> 2010/11/18

須藤です。

[#42593] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/18

成瀬です。

[#42607] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <kou@...> 2010/11/20

須藤です。

[#42608] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/20

成瀬です。

[#42610] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <kou@...> 2010/11/20

須藤です。

[#42611] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/20

成瀬です。

[#42613] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <kou@...> 2010/11/21

須藤です。

[#42614] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/21

成瀬です。

[ruby-dev:42492] Re: memory profiler for test-all

From: Nobuyoshi Nakada <nobu@...>
Date: 2010-10-29 14:25:05 UTC
List: ruby-dev #42492
なかだです。

At Fri, 29 Oct 2010 03:05:07 +0900,
SASADA Koichi wrote in [ruby-dev:42481]:
> >  fiddle の箇所で SEGV します。ただ、fiddle だけで実行すると SEGV しな
> > い。きちんと調べないと無理っぽいです。ObjectSpace.each_objects 相当をし
> > ているので、誰かが変なオブジェクトを生成している、ってことだと思います。
> 
>  これは、この仕組みがうまく機能していなかっただけで、改訂版ではきっちり
> test-all TESTS=fiddle で SEGV しました。

Fiddle::Closure#allocateがcifを初期化していないからのようです。
どこかでinitializeされないままのインスタンスがあるんでしょう。
これでSEGVします。

  10000.times{ObjectSpace.memsize_of(Fiddle::Closure.allocate)}

allocate()に MEMZERO(closure->cif, ffi_cif, 1) を入れるだけでも
落ちなくなりますが、そもそもcifをポインタにする必要もないように
見えます。


diff --git a/ext/fiddle/closure.c b/ext/fiddle/closure.c
index 5e9ede7..157b97c 100644
--- a/ext/fiddle/closure.c
+++ b/ext/fiddle/closure.c
@@ -5,7 +5,7 @@ VALUE cFiddleClosure;
 typedef struct {
     void * code;
     ffi_closure *pcl;
-    ffi_cif * cif;
+    ffi_cif cif;
     int argc;
     ffi_type **argv;
 } fiddle_closure;
@@ -23,7 +23,6 @@ dealloc(void * ptr)
 #else
     munmap(cls->pcl, sizeof(cls->pcl));
 #endif
-    xfree(cls->cif);
     if (cls->argv) xfree(cls->argv);
     xfree(cls);
 }
@@ -37,7 +36,7 @@ closure_memsize(const void * ptr)
     if (ptr) {
 	size += sizeof(*cls);
 #if !defined(FFI_NO_RAW_API) || !FFI_NO_RAW_API
-	size += ffi_raw_size(cls->cif);
+	size += ffi_raw_size(&cls->cif);
 #endif
 	size += sizeof(*cls->argv);
 	size += sizeof(ffi_closure);
@@ -148,7 +147,6 @@ allocate(VALUE klass)
     closure->pcl = mmap(NULL, sizeof(ffi_closure), PROT_READ | PROT_WRITE,
         MAP_ANON | MAP_PRIVATE, -1, 0);
 #endif
-    closure->cif = xmalloc(sizeof(ffi_cif));
 
     return i;
 }
@@ -185,7 +183,7 @@ initialize(int rbargc, VALUE argv[], VALUE self)
     rb_iv_set(self, "@ctype", ret);
     rb_iv_set(self, "@args", args);
 
-    cif = cl->cif;
+    cif = &cl->cif;
     pcl = cl->pcl;
 
     result = ffi_prep_cif(cif, NUM2INT(abi), argc,


-- 
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
    中田 伸悦

In This Thread