[前][次][番号順一覧][スレッド一覧][生データ]

yarv-dev:978

From: sheepman <sheepman sheepman.sakura.ne.jp>
Date: Fri, 24 Feb 2006 21:23:08 +0900
Subject: [yarv-dev:978] open> local_svar is not marked

こんばんは、sheepman です。
以下のスクリプトでエラーになります。

$ cat t.rb
GC.stress = true
th = Thread.new do
  100.times do
    " ".gsub(/./, 'a')
  end
end
th.join

$ ruby-2.0 -v t.rb
ruby 2.0.0 (Base: Ruby 1.9.0 2006-02-14) [i686-linux]
YARVCore 0.4.0 Rev: 474 (2006-02-23) [opts: ]
free(): invalid pointer 0x40297aa0!
-- stack frame ------------
0x401ff008 (0000): 00000001
0x401ff00c (0001): 08142db9
0x401ff010 (0002): 000000c9
0x401ff014 (0003): 4027efa5
0x401ff018 (0004): 00000001
0x401ff01c (0005): 401ff00d (= 1)
0x401ff020 (0006): 402989f0
0x401ff024 (0007): 40297ac8
0x401ff028 (0008): 4029884c
0x401ff02c (0009): 00000001 <- lfp <- dfp
-- control frame ----------
c:0007 p:-001 s:0010 b:0010 l:0009 d:0009 CFUNC  i:gsub     s:         -
c:0006 p:0012 s:0006 b:0006 l:-684 d:0005 BLOCK  i:block (2 levels) in <main> s:         -
c:0005 p:-001 s:0005 b:0005 l:0004 d:0004 FINISH i:-        s:         -
c:0004 p:-001 s:0004 b:0004 l:0003 d:0003 CFUNC  i:times    s:         -
c:0003 p:0008 s:0002 b:0002 l:-684 d:0001 PROC   i:block in <main> s:
c:0002 p:-001 s:0001 b:0001 l:0000 d:0000 FINISH i:-        s:         -
c:0001 p:-001 s:0000 b:-001 l:0000 d:0000 ------ i:-        s:         -
---------------------------
DBG> : "t.rb:4:in `block (2 levels) in <main>'"
DBG> : "t.rb:3:in `times'"
DBG> : "t.rb:3:in `block in <main>'"
[BUG] Segmentation fault
ruby 2.0.0 (2006-02-14) [i686-linux]

zsh: abort      ruby-2.0 -v t.rb

マークのし忘れだと思います。以下のような感じでどうでしょう。

$ svn diff yarvcore.c
Index: yarvcore.c
===================================================================
--- yarvcore.c  (revision 475)
+++ yarvcore.c  (working copy)
@@ -626,6 +626,8 @@

        rb_mark_tbl(th->local_storage);

+       MARK_UNLESS_NULL(th->local_svar);
+
        if (GET_THREAD() != th &&
            th->machine_stack_start && th->machine_stack_end) {
            yarv_machine_stack_mark(th);


-- 
sheepman / TAMURA Takashi
sheepman sheepman.sakura.ne.jp http://sheepman.parfait.ne.jp/

-- 
ML: yarv-dev quickml.atdot.net
使い方: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧][生データ]

->     978 2006-02-24 21:23 [sheepman sheepman.sa] open> local_svar is not marked          
       986 2006-02-27 22:01 ┗[ko1 atdot.net       ] fixed> Re: open> local_svar is not marked