Linux/ia64$B$G(B'ucontext_t' undeclared

e$B:G6a$Ne(BRuby 1.9e$B$re(BLinux/ia64e$B>e$Ge(Bmakee$B$7$h$&$H$9$k$He(B
e$B0J2<$N$h$&$J%(%i!<$K$J$j$^$9!#e(B

gc.c: In function ‘garbage_collect’:
gc.c:1388: error: ‘ucontext_t’ undeclared (first use in this function)
gc.c:1388: error: (Each undeclared identifier is reported only once
gc.c:1388: error: for each function it appears in.)
gc.c:1388: error: expected ‘;’ before ‘ctx’
gc.c:1394: error: ‘ctx’ undeclared (first use in this function)
gc.c:1403: error: ‘__libc_ia64_register_backing_store_base’ undeclared (first use in this function)

IRCe$B$GAjCL$7$?$H$3$m!"e(BYARVe$B$N%^!<%8$N%?%$%_%s%0$Ge(B
e$B4X78%3!<%I$,$^$-$b$I$C$F$7$^$C$?$N$G$O$J$$$+$H$N$3$H$G$7$?!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:30971] Linux/ia64e$B$Ge(B’ucontext_t’
undeclared”
on Wed, 13 Jun 2007 22:16:58 +0900, akira yamada /
e$B$d$^$@$"$-$ie(B [email protected] writes:

|e$B:G6a$Ne(BRuby 1.9e$B$re(BLinux/ia64e$B>e$Ge(Bmakee$B$7$h$&$H$9$k$He(B
|e$B0J2<$N$h$&$J%(%i!<$K$J$j$^$9!#e(B

e$B$H$j$"$($:e(Bmatzrubye$B%V%i%s%A$+$i%3!<%I$r%3%T!<$7$^$7$?!#e(B
e$B;n$7$F$_$F$/$@$5$$!#e(B

Yukihiro M. e$B$5$s$O=q$-$^$7$?e(B:

e$B$H$j$"$($:e(Bmatzrubye$B%V%i%s%A$+$i%3!<%I$r%3%T!<$7$^$7$?!#e(B
e$B;n$7$F$_$F$/$@$5$$!#e(B

e$B$"$j$,$H$&$4$6$$$^$9!#;n$7$?$H$3$m0J2<$N$h$&$K$J$j$^$7$?!#e(B

gc.c:1480: error: expected declaration specifiers or ‘…’ before
‘rb_ia64_bsp’
gc.c:1481: error: conflicting types for ‘ruby_init_stack’
./include/ruby/ruby.h:676: error: previous declaration of
‘ruby_init_stack’ was here
gc.c: In function ‘Init_heap’:
gc.c:1622: error: too many arguments to function ‘ruby_init_stack’

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:30974] Re: Linux/ia64e$B$Ge(B’ucontext_t’
undeclared”
on Wed, 13 Jun 2007 23:08:45 +0900, [email protected] writes:

|e$B$"$j$,$H$&$4$6$$$^$9!#;n$7$?$H$3$m0J2<$N$h$&$K$J$j$^$7$?!#e(B
|
|gc.c:1480: error: expected declaration specifiers or ‘…’ before ‘rb_ia64_bsp’
|gc.c:1481: error: conflicting types for ‘ruby_init_stack’
|./include/ruby/ruby.h:676: error: previous declaration of ‘ruby_init_stack’ was here
|gc.c: In function ‘Init_heap’:
|gc.c:1622: error: too many arguments to function ‘ruby_init_stack’

e$B$&!<$s!"$J$<$3$s$J%(%i!<$K$J$k$N$+$+$$$b$/8+Ev$,$D$-$^$;$s!#e(B
1622e$B9T$K$Oe(BInit_stack()e$B$O$"$C$F$be(Bruby_init_stack()e$B$O$"$j$^$;e(B
e$B$s$7!"$A$c$s$He(B_ia64e$B$,Dj5A$5$l$F$$$l$Pe(Bruby_init_stack()e$B$N0z?te(B
e$B$O$=$m$C$F$$$k$O$:$G$9$7!#e(B

e$B<B5!$J$7$G$O$3$l0J>e$O;d$K$O<j$KIi$($^$;$s!#$4$a$s$J$5$$!#e(B

Yukihiro M. e$B$5$s$O=q$-$^$7$?e(B:

|gc.c:1480: error: expected declaration specifiers or ‘…’ before ‘rb_ia64_bsp’
|gc.c:1481: error: conflicting types for ‘ruby_init_stack’
|./include/ruby/ruby.h:676: error: previous declaration of ‘ruby_init_stack’ was here
|gc.c: In function ‘Init_heap’:
|gc.c:1622: error: too many arguments to function ‘ruby_init_stack’

e$B$&!<$s!"$J$<$3$s$J%(%i!<$K$J$k$N$+$+$$$b$/8+Ev$,$D$-$^$;$s!#e(B
1622e$B9T$K$Oe(BInit_stack()e$B$O$"$C$F$be(Bruby_init_stack()e$B$O$"$j$^$;e(B
e$B$s$7!"$A$c$s$He(B_ia64e$B$,Dj5A$5$l$F$$$l$Pe(Bruby_init_stack()e$B$N0z?te(B
e$B$O$=$m$C$F$$$k$O$:$G$9$7!#e(B

e$B<j85$N%=!<%9$r$$$8$C$F$7$^$C$F$$$?$h$&$G$9!#e(B
e$B$-$l$$$K$7$F$+$ie(Bbuilde$B$7$?$H$3$m%(%i!<$,$J$/$J$j$^$7$?!#e(B

e$B$*$5$o$,$;$7$^$7$?!#e(B

make teste$B$O<B9T$G$-$Fe(B(859 failed 14)

make TESTS=ruby test-alle$B$Oe(BIllegal instructione$B$G$7$?e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:30976] Re: Linux/ia64e$B$Ge(B’ucontext_t’
undeclared”
on Thu, 14 Jun 2007 01:18:56 +0900, [email protected] writes:

|e$B$-$l$$$K$7$F$+$ie(Bbuilde$B$7$?$H$3$m%(%i!<$,$J$/$J$j$^$7$?!#e(B
|
|e$B$*$5$o$,$;$7$^$7$?!#e(B

e$B$=$l$ONI$+$C$?!#e(B

|# make teste$B$O<B9T$G$-$Fe(B(859 failed 14)
|# make TESTS=ruby test-alle$B$Oe(BIllegal instructione$B$G$7$?e(B

Illegal instructione$B$O$$$:$lDI$$$+$1$J$$$H$$$1$J$$$G$7$g$&$M!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:30982] Re: Linux/ia64e$B$Ge(B’ucontext_t’
undeclared”

|> Illegal instructione$B$O$$$:$lDI$$$+$1$J$$$H$$$1$J$$$G$7$g$&$M!#e(B
|
|e$B%^%k%A%9%l%C%I$K$J$C$?$s$@$+$i3F%9%l%C%I$Ne(B register stack e$B$re(B
|GC e$B$Ge(B scan e$B$7$J$$$H$$$1$J$$$7!“e(BFiber e$B$d7QB3$G$Oe(B register
|stack e$B$rJ]B8!&I|5”$7$J$-$c$$$1$J$$$N$K!"$=$&$$$&%3!<%I$,$J$$e(B
|e$B$s$@$+$i!"$=$&$$$&%3!<%I$rB-$9$H$3$m$+$i$G$9$M!#e(B

e$B%3%s%F%-%9%H%9%$%C%A;~$K%;!<%V$9$k$s$G$7$g$&$M!#$&$o$!!"LLE]e(B
e$B$@$J$!!#e(B

|e$B$$$/$i$+e(B GC e$BLdBj$b$D$V$7$^$7$?$,!"$=$N:]$N0u>]$H$7$F!"e(BYARV
|e$B$G$Oe(B VALUE e$B$r4^$`9=B$BN$X$N%]%$%s%?$r07$C$F$$$F7uF]$G$9$M$’!#e(B

e$B%3%_%C%H$7$F$b$i$C$?J}$,$h$$$H;W$$$^$9!#$5$5$@$/$s$N5v2D$rF@e(B
e$B$?J}$,$h$$$N$+$J!)e(B

In article E1HygwQ-0001OA-4f@x31,
Yukihiro M. [email protected] writes:

|# make teste$B$O<B9T$G$-$Fe(B(859 failed 14)
|# make TESTS=ruby test-alle$B$Oe(BIllegal instructione$B$G$7$?e(B

Illegal instructione$B$O$$$:$lDI$$$+$1$J$$$H$$$1$J$$$G$7$g$&$M!#e(B

e$B%^%k%A%9%l%C%I$K$J$C$?$s$@$+$i3F%9%l%C%I$Ne(B register stack e$B$re(B
GC e$B$Ge(B scan e$B$7$J$$$H$$$1$J$$$7!“e(BFiber e$B$d7QB3$G$Oe(B
register
stack e$B$rJ]B8!&I|5”$7$J$-$c$$$1$J$$$N$K!“$=$&$$$&%3!<%I$,$J$$e(B
e$B$s$@$+$i!”$=$&$$$&%3!<%I$rB-$9$H$3$m$+$i$G$9$M!#e(B

e$B$=$&$d$C$F$be(B test-all e$B$Ge(B SEGV e$B$7$^$9$,!“$=$l$,e(B ia64
e$B8GM-$+$Ie(B
e$B$&$+$O$h$/$o$+$j$^$;$s!#e(BSEGV e$B$9$k$N$Oe(B ia64
e$B$@$1$8$c$”$j$^$;e(B
e$B$s$7!#e(B

e$B$$$/$i$+e(B GC e$BLdBj$b$D$V$7$^$7$?$,!"$=$N:]$N0u>]$H$7$F!"e(BYARV
e$B$G$Oe(B VALUE
e$B$r4^$`9=B$BN$X$N%]%$%s%?$r07$C$F$$$F7uF]$G$9$M$'!#e(B

Index: eval_load.c

— eval_load.c (revision 12533)
+++ eval_load.c (working copy)
@@ -574,10 +574,10 @@
void
Init_load()
{

  • rb_load_path = rb_ary_new();
    rb_define_readonly_variable(“$:”, &rb_load_path);
    rb_define_readonly_variable(“$-I”, &rb_load_path);
    rb_define_readonly_variable(“$LOAD_PATH”, &rb_load_path);
  • rb_load_path = rb_ary_new();

    rb_define_virtual_variable(“$"”, get_loaded_features, 0);
    rb_define_virtual_variable(“$LOADED_FEATURES”, get_loaded_features,
    0);
    Index: variable.c
    ===================================================================
    — variable.c (revision 12533)
    +++ variable.c (working copy)
    @@ -428,7 +428,8 @@
    void
    rb_gc_mark_global_tbl(void)
    {

  • st_foreach_safe(rb_global_tbl, mark_global_entry, 0);
  • if (rb_global_tbl)
  •    st_foreach_safe(rb_global_tbl, mark_global_entry, 0);
    

}

static ID
Index: thread.c

— thread.c (revision 12533)
+++ thread.c (working copy)
@@ -276,18 +276,28 @@
rb_thread_t *th = th_ptr;
th->status = THREAD_KILLED;
th->machine_stack_start = th->machine_stack_end = 0;
+#ifdef __ia64

  • th->machine_register_stack_start = th->machine_register_stack_end =
    0;
    +#endif
    native_mutex_destroy(&th->interrupt_lock);
    native_thread_destroy(th);
    }

static int
-thread_start_func_2(rb_thread_t *th, VALUE *stack_start)
+thread_start_func_2(rb_thread_t *th, VALUE *stack_start
+#ifdef __ia64

  • , VALUE *register_stack_start
    +#endif
    +)
    {
    int state;
    VALUE args = th->first_args;
    rb_proc_t *proc;
    rb_thread_t *join_th;
    th->machine_stack_start = stack_start;
    +#ifdef __ia64
  • th->machine_register_stack_start = register_stack_start;
    +#endif
    th->thgroup = th->vm->thgroup_default;
    thread_debug(“thread start: %p\n”, th);

@@ -1822,6 +1832,9 @@
rb_gc_save_machine_context(rb_thread_t *th)
{
rb_gc_set_stack_end(&th->machine_stack_end);
+#ifdef __ia64

  • th->machine_register_stack_end = rb_ia64_bsp();
    +#endif
    setjmp(th->machine_regs);
    }

Index: gc.c

— gc.c (revision 12533)
+++ gc.c (working copy)
@@ -540,7 +540,12 @@
return (VALUE)data;
}

+#ifdef __ia64
+#define SET_STACK_END (rb_gc_set_stack_end(&th->machine_stack_end),
th->machine_register_stack_end = rb_ia64_bsp())
+#else
#define SET_STACK_END rb_gc_set_stack_end(&th->machine_stack_end)
+#endif
+
#define STACK_START (th->machine_stack_start)
#define STACK_END (th->machine_stack_end)

@@ -1384,10 +1389,10 @@
else
rb_gc_mark_locations(th->machine_stack_start,
th->machine_stack_end + 1);
#endif
-#ifdef ia64
+#ifdef __ia64
/* mark backing store (flushed register stack) /
/
the basic idea from guile GC code */

  • rb_gc_mark_locations(rb_gc_register_stack_start,
    (VALUE*)rb_ia64_bsp());
  • rb_gc_mark_locations(th->machine_register_stack_start,
    th->machine_register_stack_end);
    #endif
    #if defined(human68k) || defined(mc68000)
    rb_gc_mark_locations((VALUE*)((char*)STACK_END + 2),
    @@ -1441,6 +1446,9 @@
    rb_gc_mark_locations(th->machine_stack_end, th->machine_stack_start);
    }
    #endif
    +#ifdef __ia64
  • rb_gc_mark_locations(th->machine_register_stack_start,
    th->machine_register_stack_end);
    +#endif
    }

Index: yarvcore.c

— yarvcore.c (revision 12533)
+++ yarvcore.c (working copy)
@@ -395,6 +395,9 @@

VALUE insns_name_array(void);
extern VALUE *rb_gc_stack_start;
+#ifdef __ia64
+extern VALUE *rb_gc_register_stack_start;
+#endif

static VALUE
sdr(void)
@@ -542,12 +545,13 @@
{
rb_vm_t *vm = ruby_current_vm;
rb_thread_t *th = GET_THREAD();

  •    volatile VALUE th_self;
    

    /* create vm object */
    vm->self = Data_Wrap_Struct(rb_cVM, vm_mark, vm_free, vm);

    /* create main thread */

  • th->self = Data_Wrap_Struct(rb_cThread, thread_mark, thread_free,
    th);
  • th_self = th->self = Data_Wrap_Struct(rb_cThread, thread_mark,
    thread_free, th);

    vm->main_thread = th;
    vm->running_thread = th;
    @@ -557,7 +561,7 @@
    rb_thread_set_current(th);

    vm->living_threads = st_init_numtable();

  • st_insert(vm->living_threads, th->self, (st_data_t) th->thread_id);
  • st_insert(vm->living_threads, th_self, (st_data_t) th->thread_id);
    }
    yarv_init_redefined_flag();
    }
    @@ -575,6 +579,9 @@
    th_init2(th);
    th->vm = vm;
    th->machine_stack_start = rb_gc_stack_start;
    +#ifdef __ia64
  • th->machine_register_stack_start = rb_gc_register_stack_start;
    +#endif
    rb_thread_set_current_raw(th);
    }

Index: yarvcore.h

— yarvcore.h (revision 12533)
+++ yarvcore.h (working copy)
@@ -486,6 +486,10 @@
/* for GC */
VALUE *machine_stack_start;
VALUE *machine_stack_end;
+#ifdef __ia64

  • VALUE *machine_register_stack_start;
  • VALUE *machine_register_stack_end;
    +#endif
    jmp_buf machine_regs;
    int mark_stack_len;

Index: thread_pthread.ci

— thread_pthread.ci (revision 12533)
+++ thread_pthread.ci (working copy)
@@ -86,7 +86,11 @@
posix_signal(SIGVTALRM, null_func);
}

-NOINLINE(static int thread_start_func_2(rb_thread_t *th, VALUE
*stack_start));
+NOINLINE(static int thread_start_func_2(rb_thread_t *th, VALUE
*stack_start
+#ifdef __ia64

  • , VALUE *register_stack_start
    +#endif
    +));

static void
native_thread_destroy(rb_thread_t *th)
@@ -107,7 +111,7 @@
VALUE stack_start;

/* run */

  • thread_start_func_2(th, &stack_start);
  • thread_start_func_2(th, &stack_start, rb_ia64_bsp());
    }
    #if USE_THREAD_CACHE
    if (1) {
    Index: cont.c
    ===================================================================
    — cont.c (revision 12533)
    +++ cont.c (working copy)
    @@ -22,6 +22,11 @@
    VALUE *vm_stack;
    VALUE *machine_stack;
    VALUE *machine_stack_src;
    +#ifdef __ia64
  • VALUE *machine_register_stack;
  • VALUE *machine_register_stack_src;
  • int machine_register_stack_size;
    +#endif
    rb_thread_t saved_thread;
    rb_jmpbuf_t jmpbuf;
    int machine_stack_size;
    @@ -59,6 +64,12 @@
    rb_gc_mark_locations(cont->machine_stack,
    cont->machine_stack + cont->machine_stack_size);
    }
    +#ifdef __ia64
  • if (cont->machine_register_stack) {
  •  rb_gc_mark_locations(cont->machine_register_stack,
    
  •     cont->machine_register_stack + 
    

cont->machine_register_stack_size);

  • }
    +#endif
    }
    MARK_REPORT_LEAVE(“cont”);
    }
    @@ -71,6 +82,9 @@
    rb_context_t *cont = ptr;
    FREE_UNLESS_NULL(cont->saved_thread.stack);
    FREE_UNLESS_NULL(cont->machine_stack);
    +#ifdef __ia64

  • FREE_UNLESS_NULL(cont->machine_register_stack);
    +#endif
    FREE_UNLESS_NULL(cont->vm_stack);
    ruby_xfree(ptr);
    }
    @@ -83,6 +97,10 @@
    int size;

    rb_gc_set_stack_end(&th->machine_stack_end);
    +#ifdef __ia64

  • th->machine_register_stack_end = rb_ia64_bsp();
    +#endif

  • if (th->machine_stack_start > th->machine_stack_end) {
    size = cont->machine_stack_size = th->machine_stack_start -
    th->machine_stack_end;
    cont->machine_stack_src = th->machine_stack_end;
    @@ -100,6 +118,20 @@
    }

    MEMCPY(cont->machine_stack, cont->machine_stack_src, VALUE, size);

+#ifdef __ia64

  • rb_ia64_flushrs();
  • size = cont->machine_register_stack_size =
    th->machine_register_stack_end - th->machine_register_stack_start;
  • cont->machine_register_stack_src =
    th->machine_register_stack_start;
  • if (cont->machine_register_stack) {
  • REALLOC_N(cont->machine_register_stack, VALUE, size);
  • }
  • else {
  • cont->machine_register_stack = ALLOC_N(VALUE, size);
  • }
  • MEMCPY(cont->machine_register_stack,
    cont->machine_register_stack_src, VALUE, size);
    +#endif
    }

static rb_context_t *
@@ -132,9 +164,11 @@
{
rb_context_t *cont;
rb_thread_t *th;

  • volatile VALUE contval;

    th_stack_to_heap(GET_THREAD());
    cont = cont_new(rb_cCont);

  • contval = cont->self;
    th = &cont->saved_thread;

    cont->vm_stack = ALLOC_N(VALUE, th->stack_size);
    @@ -203,12 +237,51 @@
    VALUE, cont->machine_stack_size);
    }

+#ifdef __ia64

  • if (cont->machine_register_stack_src) {
  • MEMCPY(cont->machine_register_stack_src,
    cont->machine_register_stack,
  •     VALUE, cont->machine_register_stack_size);
    
  • }
    +#endif
  • ruby_longjmp(cont->jmpbuf, 1);
    }

NORETURN(NOINLINE(static void cont_restore_0(rb_context_t *, VALUE
*)));

+#ifdef ia64
+#define C(a) rse
##a##0, rse
##a##1, rse_##a##2, rse_##a##3, rse_##a##4
+#define E(a) rse_##a##0= rse_##a##1= rse_##a##2= rse_##a##3= rse_##a##4
+static volatile int C(a), C(b), C(c), C(d), C(e);
+static volatile int C(f), C(g), C(h), C(i), C(j);
+static volatile int C(k), C(l), C(m), C(n), C(o);
+static volatile int C(p), C(q), C(r), C(s), C(t);
+int rb_dummy_false = 0;
+NORETURN(NOINLINE(static void register_stack_extend(rb_context_t *,
VALUE *)));
static void
+register_stack_extend(rb_context_t *cont, VALUE *curr_bsp)
+{

  • if (rb_dummy_false) {
  •    /* use registers as much as possible */
    
  •    E(a) = E(b) = E(c) = E(d) = E(e) =
    
  •    E(f) = E(g) = E(h) = E(i) = E(j) =
    
  •    E(k) = E(l) = E(m) = E(n) = E(o) =
    
  •    E(p) = E(q) = E(r) = E(s) = E(t) = 0;
    
  •    E(a) = E(b) = E(c) = E(d) = E(e) =
    
  •    E(f) = E(g) = E(h) = E(i) = E(j) =
    
  •    E(k) = E(l) = E(m) = E(n) = E(o) =
    
  •    E(p) = E(q) = E(r) = E(s) = E(t) = 0;
    
  • }
  • if (curr_bsp <
    cont->machine_register_stack_src+cont->machine_register_stack_size) {
  •    register_stack_extend(cont, (VALUE*)rb_ia64_bsp());
    
  • }
  • cont_restore_1(cont);
    +}
    +#undef C
    +#undef E
    +#endif

+static void
cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
{
if (cont->machine_stack_src) {
@@ -238,7 +311,11 @@
}
#endif
}
+#ifdef __ia64

  • register_stack_extend(cont, (VALUE*)rb_ia64_bsp());
    +#else
    cont_restore_1(cont);
    +#endif
    }

/*

In article E1Hyiiu-0001y1-89@x31,
Yukihiro M. [email protected] writes:

|e$B%^%k%A%9%l%C%I$K$J$C$?$s$@$+$i3F%9%l%C%I$Ne(B register stack e$B$re(B
|GC e$B$Ge(B scan e$B$7$J$$$H$$$1$J$$$7!“e(BFiber e$B$d7QB3$G$Oe(B register
|stack e$B$rJ]B8!&I|5”$7$J$-$c$$$1$J$$$N$K!“$=$&$$$&%3!<%I$,$J$$e(B
|e$B$s$@$+$i!”$=$&$$$&%3!<%I$rB-$9$H$3$m$+$i$G$9$M!#e(B

e$B%3%s%F%-%9%H%9%$%C%A;~$K%;!<%V$9$k$s$G$7$g$&$M!#$&$o$!!"LLE]e(B
e$B$@$J$!!#e(B

e$BIaDL$N%9%?%C%/$K$D$$$F$O$d$C$F$$$k$s$@$+$i$=$l$[$I$G$b!#e(B

Yukihiro M. e$B$5$s$O=q$-$^$7$?e(B:

|# make teste$B$O<B9T$G$-$Fe(B(859 failed 14)
|# make TESTS=ruby test-alle$B$Oe(BIllegal instructione$B$G$7$?e(B

Illegal instructione$B$O$$$:$lDI$$$+$1$J$$$H$$$1$J$$$G$7$g$&$M!#e(B

e$B$5$-$[$I$Ne(Bcommit(r12538)e$B$G;n$7$F$_$^$7$?$H$3$me(B
make TESTS=ruby test-alle$B$b<B9T$G$-$^$7$?!#e(B

605 tests, 5767 assertions, 16 failures, 4 errors

e$B!!$5$5$@$G$9!#e(B

Tanaka A. e$B$5$s$O=q$-$^$7$?e(B:

e$B$=$&$d$C$F$be(B test-all e$B$Ge(B SEGV e$B$7$^$9$,!"$=$l$,e(B ia64 e$B8GM-$+$Ie(B
e$B$&$+$O$h$/$o$+$j$^$;$s!#e(BSEGV e$B$9$k$N$Oe(B ia64 e$B$@$1$8$c$"$j$^$;e(B
e$B$s$7!#e(B

e$B!!$(!<$H!"$9$_$^$;$s!#1T0U%G%P%C%0Cf$G$9!#$C$F9g=I$G8@$C$F$?e(B
e$B$8$c$s!*e(B

e$B$$$/$i$+e(B GC e$BLdBj$b$D$V$7$^$7$?$,!"$=$N:]$N0u>]$H$7$F!"e(BYARV
e$B$G$Oe(B VALUE e$B$r4^$`9=B$BN$X$N%]%$%s%?$r07$C$F$$$F7uF]$G$9$M$’!#e(B

e$B!!$H$$$&$N$O!"9=B$BN$N%]%$%s%?$@$1;D$C$F!“e(BVALUE e$B$,%9%?%C%/$Ke(B
e$B;D$C$F$$$J$$2DG=@-$,$”$C$F$^$:$$$C$FOC$G$7$g$&$+!#e(B

e$B!!$&!<$`!“e(Bia64
e$B$C$F$I$l$/$i$$$N%f!<%6$,$$$k$s$@$m$&!#$”$H!"$^e(B
e$B$@e(B sparc e$BBP1~$d$C$F$J$$$s$G$9$h$M!#e(B

In article [email protected],
SASADA Koichi [email protected] writes:

e$B!!$(!<$H!"$9$_$^$;$s!#1T0U%G%P%C%0Cf$G$9!#$C$F9g=I$G8@$C$F$?e(B
e$B$8$c$s!*e(B

e$B$=$N;~$K$O$9$G$K$7$P$i$/e(B SEGV e$B$7$F$?$o$1$G!"e(BSEGV
e$B$,I==P$7$Fe(B
e$B$+$i$b$&e(B 20e$BF|$/$i$$7P$C$F$^$9$7$M$'!#e(B
http://www.rubyist.net/~akr/chkbuild/debian-sarge/ruby-trunk/summary.html

e$B$H$O$$$(!"e(B1.9 e$B$Ge(B test-all e$B$,@.8y$7$J$/$J$C$F$+$ie(B
1e$BG/0J>e7P$Ce(B
e$B$F$k$7!“e(BSEGV
e$B$,$”$?$j$^$($N$b$N$H$7$F47$l$kF|$b1s$/$J$$$+$b!#e(B

e$B!!$H$$$&$N$O!"9=B$BN$N%]%$%s%?$@$1;D$C$F!“e(BVALUE e$B$,%9%?%C%/$Ke(B
e$B;D$C$F$$$J$$2DG=@-$,$”$C$F$^$:$$$C$FOC$G$7$g$&$+!#e(B

e$B$($'!"$?$H$($P!"e(B[ruby-dev:30982] e$B$G$$$8$C$?$H$3$m$G8@$($Pe(B
cont_new e$B$,e(B rb_context_t * e$B$rJV$9$H$+!#e(B

Init_VM e$B$N$H$3$m$b$=$&$G$9$M!#$^$!!"$3$C$A$O$=$s$J$H$3$m$Ge(B
GC e$B$,5/$-$k$3$H$OA[Dj$7$F$$$J$$$N$+$b$7$l$J$$$1$I!"e(B
RUBY_GC_STRESS e$B$r;H$&$H5/$-$k$N$G!#e(B
RUBY_GC_STRESS= miniruby -e ‘’ e$B$H$+!#e(B

e$B!!$&!<$`!“e(Bia64 e$B$C$F$I$l$/$i$$$N%f!<%6$,$$$k$s$@$m$&!#$”$H!"$^e(B
e$B$@e(B sparc e$BBP1~$d$C$F$J$$$s$G$9$h$M!#e(B

e$B$^$!!“e(Bia64 e$B$N8D?M%f!<%6$O8+$?$3$H$”$j$^$;$s!#e(B

sparc e$B$O;H$($k4D6-$,$J$$$N$G;n$;$J$$$J$!!#e(B

In article [email protected],
SASADA Koichi [email protected] writes:

e$B$9!#$^$!!“:#2s$Ne(B GC e$B$N%P%0$O!“H/8=$7$?;~E@$G$O@x:E*$KB8:$9$ke(B
e$B$b$N$@$C$?$i$7$$$H$$$&E@!”$d$C$Q$je(B GC e$B$N%P%0$NFCDj$OFq$7$$$H$$e(B
e$B$&E@$r4U$_$F!”$b$&>/$7BT$C$F$/$@$5$l$P9,$$$G$9!#$$$d!“FCDj$7$Fe(B
e$BD:$1$k$H$b$C$H$”$j$,$?$$$s$G$9$,!#e(B

e$B@h$N%Q%C%A$K$b:.$6$C$F$^$9$,?J$a$F$O$$$^$9!#e(B
e$B$H$j$"$($:e(B RUBY_GC_STRESS= miniruby -e ‘’
e$B$,F0$/$h$&$K$J$C$?$7!#e(B

e$B!!<+J,$R$H$j$G$9$Y$F$N<:GT$rJR$E$1$k$N$OFq$7$$$N$G!"$?$H$($P%ie(B
e$B%$%V%i%j$J$I$K$D$$$F<:GT$N860x$N9J$j9~$_$J$I$K$46(NOD:$1$l$P9,e(B
e$B$$$G$9!#e(B

e$BG>L#A9$r;H$o$J$/$F$be(B (e$B?2$F$$$k4V$Ke(B) e$B$d$l$k!"e(B

RUBY_GC_STRESS= …/ruby runner.rb -v ruby/test_a*
RUBY_GC_STRESS= …/ruby runner.rb -v ruby/test_b*
RUBY_GC_STRESS= …/ruby runner.rb -v ruby/test_c*

e$B$H$$$&$h$&$J$H$3$m$+$i$d$C$F$^$9$,!"e(B
test_fiber.rb e$B$O2x$7$$$G$9$M!#e(B
(test_continuation.rb e$B$be(B?)

e$B$D!<$+!“e(Btest_fiber.rb e$B$Oe(B RUBY_GC_STRESS e$B$r;H$o$J$/$F$be(B
SEGV
e$B$9$k>l9g$,$”$C$F!"e(B
Thread.new { Fiber.new do throw :a end.yield}.join
e$B$,L58B%k!<%W$9$k$H$$$&$N$O$=$3$+$i8+IU$1$?$b$N$G$9!#e(B

e$B$I$&$be(B _tag e$B$,e(B cycle e$B$K$J$k$h$&$G!“0J2<$N$h$&$Je(B
assertion e$B$re(B
e$BF~$l$F;n$7$F$^$9$,!”$3$l$C$Fe(B (e$B%9%?%C%/$N?-D9J}8~$re(B x86
e$B$HEye(B
e$B$7$$$H2>Dj$7$Fe(B) e$B@5$7$$$G$9$+$Me(B?

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;

In article [email protected],
Tanaka A. [email protected] writes:

+#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;

e$B$3$l$G$9$,!"e(Bx86 e$B$G$be(B cycle
e$B$8$c$J$$$s$G$9$,!"5/$-$^$9!#e(B

% 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)

e$B$H$$$&$h$&$K!“e(B0xbffc0ec8 → 0xbffc0e94 e$B$He(B prev
e$B$GA}2C$7$^$9!#e(B
fiber e$B$,5/F0$7$?;~$Ke(B rb_thread_t e$B$Ne(B tag
e$B$r=i4|2=$9$k%3!<%I$,e(B
e$BI,MW$J$h$&$K;W$&$s$G$9$,!”$I$&$G$7$g$&$+!#e(B

e$B!!$5$5$@$G$9!#e(B

Tanaka A. wrote:

e$B!!$(!<$H!"$9$_$^$;$s!#1T0U%G%P%C%0Cf$G$9!#$C$F9g=I$G8@$C$F$?e(B
e$B$8$c$s!*e(B

e$B$=$N;~$K$O$9$G$K$7$P$i$/e(B SEGV e$B$7$F$?$o$1$G!"e(BSEGV e$B$,I==P$7$Fe(B
e$B$+$i$b$&e(B 20e$BF|$/$i$$7P$C$F$^$9$7$M$'!#e(B
http://www.rubyist.net/~akr/chkbuild/debian-sarge/ruby-trunk/summary.html

e$B!!!V$G$-$J$$$d$D$O2?$r$d$C$F$b%@%a!W$H$$$&$N$Oe(BRubye$B2q5De(B2007e$B$G:{e(B
e$BED$KBP$7$F;XE&$5$l$?;v9`$G!“<+J,$NG=NO$N$J$5$rCQ$8$k$H$3$m$Ge(B
e$B$9!#$^$!!”:#2s$Ne(B GC
e$B$N%P%0$O!“H/8=$7$?;~E@$G$O@x:E*$KB8:$9$ke(B
e$B$b$N$@$C$?$i$7$$$H$$$&E@!”$d$C$Q$je(B GC
e$B$N%P%0$NFCDj$OFq$7$$$H$$e(B
e$B$&E@$r4U$_$F!"$b$&>/$7BT$C$F$/$@$5$l$P9,$$$G$9!#$$$d!“FCDj$7$Fe(B
e$BD:$1$k$H$b$C$H$”$j$,$?$$$s$G$9$,!#e(B

e$B$H$O$$$(!"e(B1.9 e$B$Ge(B test-all e$B$,@.8y$7$J$/$J$C$F$+$ie(B 1e$BG/0J>e7P$Ce(B
e$B$F$k$7!“e(BSEGV e$B$,$”$?$j$^$($N$b$N$H$7$F47$l$kF|$b1s$/$J$$$+$b!#e(B

e$B!!<+J,$R$H$j$G$9$Y$F$N<:GT$rJR$E$1$k$N$OFq$7$$$N$G!"$?$H$($P%ie(B
e$B%$%V%i%j$J$I$K$D$$$F<:GT$N860x$N9J$j9~$_$J$I$K$46(NOD:$1$l$P9,e(B
e$B$$$G$9!#e(B

e$B!!$5$5$@$G$9!#e(B

Tanaka A. wrote:

fiber e$B$,5/F0$7$?;~$Ke(B rb_thread_t e$B$Ne(B tag e$B$r=i4|2=$9$k%3!<%I$,e(B
e$BI,MW$J$h$&$K;W$&$s$G$9$,!"$I$&$G$7$g$&$+!#e(B

e$B!!$=$NDL$j$@$H;W$$$^$9!#=i4|2=$9$k$h$&$K$7$^$9!#e(B