Permalink
Browse files

added --with-wipe-sites= & --enable-mbari-api.

Fixed GC saveregs bug.  Removed race in ruby/suicide test case.
  • Loading branch information...
1 parent efed36a commit 79ae1d7551f796cc08468b231f54c7bbf73b68a7 @brentr committed Feb 25, 2009
Showing with 44 additions and 9 deletions.
  1. +14 −0 ChangeLog
  2. +19 −1 configure.in
  3. +6 −5 gc.c
  4. +1 −0 rubysig.h
  5. +0 −1 signal.c
  6. +3 −1 test/ruby/suicide.rb
  7. +1 −1 test/runner.rb
View
@@ -1,3 +1,17 @@
+Tue Feb 24 00:01:19 2009 Brent Roman <brent@mbari.org>
+
+ * cofigure.in: added --enable-mbari-api and --with-wipe-sites
+
+ * signal.c: removed CHECK_INTS after kill
+
+ * test/ruby/suicide.rb: add tiny delay to let signal propogate
+
+ * gc.c: save regs properly on main stack before marking it!
+
+ * eval.c: numerous corrections in use of volatile variables w/setjmp()
+
+ * version.h: bumped date, MBARI version 7+ --> 7A
+
Fri Feb 13 00:01:19 2009 Brent Roman <brent@mbari.org>
* signal.c: CHECK_INTS after kill in case of suicide
View
@@ -151,6 +151,24 @@ AC_ARG_ENABLE(frame-address,
if test $frame_address = yes; then
AC_DEFINE(USE_BUILTIN_FRAME_ADDRESS)
fi
+AC_ARG_ENABLE(mbari-api,
+ [ --enable-mbari-api enable API changes from the MBARI patches. ],
+ [mbari_api=$enableval])
+if test $mbari_api = yes; then
+ AC_DEFINE(MBARI_API)
+fi
+AC_ARG_WITH(wipe-sites,
+[ --with-wipe-sites=MASK override default STACK_WIPES_SITES mask in rubysig.h],
+[wipe_sites=$withval])
+if test "$wipe_sites" != ""; then
+ case $wipe_sites in
+ none|no) wipe_sites=0x0;;
+ yes) wipe_sites=;;
+ esac
+ if test -n "$wipe_sites"; then
+ AC_DEFINE_UNQUOTED(STACK_WIPE_SITES,$wipe_sites)
+ fi
+fi
AC_ARG_PROGRAM
@@ -1783,7 +1801,7 @@ AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${RUBY_SITE_LIB_PATH2}/${sitearch}")
AC_DEFINE_UNQUOTED(RUBY_VENDOR_ARCHLIB, "${RUBY_VENDOR_LIB_PATH2}/${sitearch}")
AC_ARG_WITH(search-path,
- [ --with-search-path=DIR specify the additional search path],
+ [ --with-search-path= DIR specify the additional search path],
[search_path=$withval])
if test "$search_path" != ""; then
AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path")
View
@@ -567,6 +567,7 @@ static unsigned int STACK_LEVEL_MAX = 655300;
#ifndef nativeAllocA
/* portable way to return an approximate stack pointer */
+NOINLINE(VALUE *__sp(void));
VALUE *__sp(void) {
VALUE tos;
return &tos;
@@ -1431,7 +1432,6 @@ garbage_collect_0(VALUE *top_frame)
{
struct gc_list *list;
struct FRAME * frame;
- jmp_buf save_regs_gc_mark;
SET_STACK_END;
#ifdef HAVE_NATIVETHREAD
@@ -1470,10 +1470,6 @@ garbage_collect_0(VALUE *top_frame)
mark_tbl(finalizer_table);
}
- FLUSH_REGISTER_WINDOWS;
- /* This assumes that all registers are saved into the jmp_buf (and stack) */
- rb_setjmp(save_regs_gc_mark);
- mark_locations_array((VALUE*)save_regs_gc_mark, sizeof(save_regs_gc_mark) / sizeof(VALUE *));
#if STACK_GROW_DIRECTION < 0
rb_gc_mark_locations(top_frame, rb_curr_thread->stk_start);
#elif STACK_GROW_DIRECTION > 0
@@ -1528,7 +1524,12 @@ garbage_collect_0(VALUE *top_frame)
static void
garbage_collect()
{
+ jmp_buf save_regs_gc_mark;
VALUE *top = __sp();
+ FLUSH_REGISTER_WINDOWS;
+ /* This assumes that all registers are saved into the jmp_buf (and stack) */
+ rb_setjmp(save_regs_gc_mark);
+
#if STACK_WIPE_SITES & 0x400
# ifdef nativeAllocA
if (__stack_past (top, stack_limit)) {
View
@@ -216,6 +216,7 @@ __defspfn("addi %0, r1, 0": "=r"(sp))
# elif defined __i386__
__defspfn("movl %%esp, %0": "=r"(sp))
# elif defined __x86_64__
+#warn ===> x86_64 inline assembler is known to crash -- change STACK_WIPE_SITES
__defspfn("movq %%rsp, %0": "=r"(sp))
# elif __arm__
__defspfn("mov %0, sp": "=r"(sp))
View
@@ -392,7 +392,6 @@ rb_f_kill(argc, argv)
rb_sys_fail(0);
}
}
- CHECK_INTS; /* in case we killed ourselves */
return INT2FIX(i-1);
}
@@ -1,2 +1,4 @@
STDERR.reopen(STDOUT)
-at_exit{Process.kill(:INT, $$)}
+at_exit{Process.kill(:INT, $$); sleep 0}
+# brent@mbari.org says
+# sleep 0 avoids race between process termination and signal reception
View
@@ -5,5 +5,5 @@
Version = rcsid[2].scan(/\d+/).collect!(&method(:Integer)).freeze
Release = rcsid[3].freeze
end
-
+#GC.stress=true
exit Test::Unit::AutoRunner.run(true, File.dirname($0))

0 comments on commit 79ae1d7

Please sign in to comment.