[#30872] segv when reentering into Fiber with callcc — sheepman <sheepman@...>

こんばんは、sheepman です。

15 messages 2007/06/01
[#30899] Re: segv when reentering into Fiber with callcc — SASADA Koichi <ko1@...> 2007/06/06

 ささだです。

[#30905] Re: segv when reentering into Fiber with callcc — "Yusuke ENDOH" <mame@...> 2007/06/06

遠藤と申します。

[#30906] Re: segv when reentering into Fiber with callcc — SASADA Koichi <ko1@...> 2007/06/06

 ささだです。

[#30929] secrand.rb — "NAKAMURA, Hiroshi" <nakahiro@...>

-----BEGIN PGP SIGNED MESSAGE-----

51 messages 2007/06/08
[#30930] Re: secrand.rb — Tanaka Akira <akr@...> 2007/06/08

In article <4669066C.2080307@sarion.co.jp>,

[#30934] Re: secrand.rb — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/06/08

-----BEGIN PGP SIGNED MESSAGE-----

[#30935] Re: secrand.rb — Tanaka Akira <akr@...> 2007/06/08

In article <46694461.4060706@sarion.co.jp>,

[#30936] Re: secrand.rb — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/06/08

-----BEGIN PGP SIGNED MESSAGE-----

[#30938] Re: secrand.rb — Tanaka Akira <akr@...> 2007/06/08

In article <46697C0B.8060402@sarion.co.jp>,

[#30939] Re: secrand.rb — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/06/08

-----BEGIN PGP SIGNED MESSAGE-----

[#30940] Re: secrand.rb — Tanaka Akira <akr@...> 2007/06/08

In article <4669DAB0.4050705@sarion.co.jp>,

[#30944] Re: secrand.rb — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/06/09

-----BEGIN PGP SIGNED MESSAGE-----

[#30945] Re: secrand.rb — Tanaka Akira <akr@...> 2007/06/09

In article <466AA73C.9030407@sarion.co.jp>,

[#30946] Re: secrand.rb — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/06/09

-----BEGIN PGP SIGNED MESSAGE-----

[#30950] Re: secrand.rb — Nobuyoshi Nakada <nobu@...> 2007/06/11

なかだです。

[#31173] Re: Random — Tanaka Akira <akr@...> 2007/07/10

In article <469253E9.9010203@sarion.co.jp>,

[#31174] Re: Random — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/07/10

-----BEGIN PGP SIGNED MESSAGE-----

[#31178] Re: Random — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/07/11

-----BEGIN PGP SIGNED MESSAGE-----

[#31179] Re: Random — Tanaka Akira <akr@...> 2007/07/11

In article <4694338C.7090303@sarion.co.jp>,

[#31183] Re: Random — "NAKAMURA, Hiroshi" <nakahiro@...> 2007/07/11

-----BEGIN PGP SIGNED MESSAGE-----

[#30971] Linux/ia64で'ucontext_t' undeclared — akira yamada / やまだあきら <akira@...>

最近のRuby 1.9をLinux/ia64上でmakeしようとすると

16 messages 2007/06/13
[#30973] Re: Linux/ia64で'ucontext_t' undeclared — Yukihiro Matsumoto <matz@...> 2007/06/13

まつもと ゆきひろです

[#30974] Re: Linux/ia64で'ucontext_t' undeclared — akira@... 2007/06/13

Yukihiro Matsumoto さんは書きました:

[#30975] Re: Linux/ia64で'ucontext_t' undeclared — Yukihiro Matsumoto <matz@...> 2007/06/13

まつもと ゆきひろです

[ruby-dev:31042] SAVE_ROOT_JMPBUF

From: Tanaka Akira <akr@...>
Date: 2007-06-23 17:07:33 UTC
List: ruby-dev #31042
In article <871wge0xxs.fsf@fsij.org>,
  Tanaka Akira <akr@fsij.org> writes:

> どうも _tag が cycle になるようで、以下のような assertion を
> 入れて試してますが、これって (スタックの伸長方向を x86 と等
> しいと仮定して) 正しいですかね?
>
> Index: eval_intern.h
> ===================================================================
> --- eval_intern.h	(revision 12537)
> +++ eval_intern.h	(working copy)
> @@ -127,2 +127,4 @@ char *strrchr _((const char *, const cha
>  
> +#include <assert.h>
> +
>  #define TH_PUSH_TAG(th) do { \
> @@ -132,2 +134,3 @@ char *strrchr _((const char *, const cha
>    _tag.prev = _th->tag; \
> +  assert(_th->tag == 0 || &_tag < _th->tag); \
>    _th->tag = &_tag;

これですが、x86 でも cycle じゃないんですが、起きます。

% uname -a
Linux nute 2.6.18-4-486 #1 Wed May 9 22:23:40 UTC 2007 i686 GNU/Linux
% gdb miniruby
GNU gdb 6.4.90-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) break rb_fiber_start 
Breakpoint 1 at 0x80df729: file cont.c, line 522.
(gdb) run -e 'Fiber.new {}.yield'
Starting program: /home/akr/ruby/yarvo2/ruby/miniruby -e 'Fiber.new {}.yield'
Failed to read a valid object file image from memory.
[Thread debugging using libthread_db enabled]
[New Thread -1210476320 (LWP 31013)]
[New Thread -1211208784 (LWP 31016)]
[Switching to Thread -1210476320 (LWP 31013)]

Breakpoint 1, rb_fiber_start () at cont.c:522
522         rb_thread_t *th = GET_THREAD();
(gdb) n
528         TH_PUSH_TAG(th);
(gdb) 
522         rb_thread_t *th = GET_THREAD();
(gdb) 
528         TH_PUSH_TAG(th);
(gdb) 
529         if ((state = EXEC_TAG()) == 0) {
(gdb) p ruby_current_thread->tag
$1 = (struct rb_vm_tag *) 0xbffc0ec8
(gdb) p ruby_current_thread->tag->prev
$2 = (struct rb_vm_tag *) 0xbffc0e94
(gdb) p ruby_current_thread->tag->prev->prev
$3 = (struct rb_vm_tag *) 0xbffc0fa0
(gdb) p ruby_current_thread->tag->prev->prev->prev
$4 = (struct rb_vm_tag *) 0x0
(gdb) 

というように、0xbffc0ec8 -> 0xbffc0e94 と prev で増加します。
fiber が起動した時に rb_thread_t の tag を初期化するコードが
必要なように思うんですが、どうでしょうか。
-- 
[田中 哲][たなか あきら][Tanaka Akira]

In This Thread