As requested on irc, here's the changes I've made to my local copy to
help debug things. This allows me to run a debug run in a few minutes
instead of running the entire test suite for hours under valgrind, and
it also supresses the vast majority of the valgrind errors.

I'm seeing reliable failures in test_fiber.rb, segfaults. It's not
always the exact same location, but this test is always triggering the
problem. Ruby's GC looks horrendous for triggering valgrind
errors. I'm hoping they're false positives, but still...

In terms of the root cause of the segfaults, I'm suspecting memory
corruption in the heavily threaded tests. It's difficult to say
exactly where it's coming from in the mass of errors.

-- 
Steve McIntyre, Cambridge, UK.                                st...@einval.com
< liw> everything I know about UK hotels I learned from "Fawlty Towers"
--- ruby1.9.1-1.9.3.0.old/common.mk	2012-01-13 22:32:04.000000000 +0000
+++ ruby1.9.1-1.9.3.0/common.mk	2012-01-12 17:53:06.000000000 +0000
@@ -12,6 +12,8 @@
 ECHO1 = $(V:1=@$n)
 ECHO = $(ECHO1:0=@echo)
 
+VG=valgrind --trace-children=yes --suppressions=/home/93sam/build/ruby/ignore1.supp
+
 RUBYLIB       = -
 RUBYOPT       = -
 RUN_OPTS      = --disable-gems
@@ -471,27 +473,27 @@
 btest-ruby: miniruby$(EXEEXT) $(RBCONFIG) $(PROGRAM) $(TEST_RUNNABLE)-btest-ruby
 no-btest-ruby: PHONY
 yes-btest-ruby: PHONY
-	@$(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) -I$(srcdir)/lib" -q $(OPTS)
+	@$(VG) $(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM) -I$(srcdir)/lib" -q $(OPTS)
 
 test-sample: miniruby$(EXEEXT) $(RBCONFIG) $(PROGRAM) $(TEST_RUNNABLE)-test-sample
 no-test-sample: PHONY
 yes-test-sample: PHONY
-	@$(RUNRUBY) $(srcdir)/tool/rubytest.rb
+	@$(VG) $(RUNRUBY) $(srcdir)/tool/rubytest.rb
 
 test-knownbugs: test-knownbug
 test-knownbug: miniruby$(EXEEXT) $(PROGRAM) $(RBCONFIG) $(TEST_RUNNABLE)-test-knownbug
 no-test-knownbug: PHONY
 yes-test-knownbug: PHONY
-	-$(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM)" $(OPTS) $(srcdir)/KNOWNBUGS.rb
+	-$(VG) $(RUNRUBY) "$(srcdir)/bootstraptest/runner.rb" --ruby="$(PROGRAM)" $(OPTS) $(srcdir)/KNOWNBUGS.rb
 
 test: test-sample btest-ruby test-knownbug
 
 test-all: $(TEST_RUNNABLE)-test-all
 yes-test-all: PHONY
-	$(RUNRUBY) "$(srcdir)/test/runner.rb" -v --ruby="$(RUNRUBY)" $(TESTS)
+	$(VG) $(RUNRUBY) "$(srcdir)/test/runner.rb" -v --ruby="$(RUNRUBY)" $(TESTS)
 TESTS_BUILD = mkmf
 no-test-all: PHONY
-	$(MINIRUBY) -I"$(srcdir)/lib" "$(srcdir)/test/runner.rb" -v $(TESTS_BUILD)
+	$(VG) $(MINIRUBY) -I"$(srcdir)/lib" "$(srcdir)/test/runner.rb" -v $(TESTS_BUILD)
 
 test-ruby: $(TEST_RUNNABLE)-test-ruby
 no-test-ruby: PHONY
--- ruby1.9.1-1.9.3.0.old/debian/run-test-suites.bash	2011-10-18 16:53:33.000000000 +0000
+++ ruby1.9.1-1.9.3.0/debian/run-test-suites.bash	2012-01-13 18:01:54.000000000 +0000
@@ -7,12 +7,12 @@
 echo "*******************************************************************"
 echo "Running 'make test'"
 echo
-make OPTS=-v test
+#make OPTS=-v test
 echo
 echo "*******************************************************************"
 echo "Running 'make test-all'"
 echo
-make OPTS=-v test-all 2>&1 |tee make-test-all.log || true
+make OPTS=-v test-all TESTS=/home/93sam/build/ruby/ruby1.9.1-1.9.3.0/test/ruby/test_fiber.rb 2>&1 |tee make-test-all.log || true
 echo
 echo "'make test-all' finished. checking number of failures and errors."
 echo "max number allowed: failures:$MAXFAIL errors:$MAXERR"
--- /dev/null	1970-01-01 00:00:05.280000001 +0000
+++ ignore1.supp	2012-01-13 00:38:40.000000000 +0000
@@ -0,0 +1,80 @@
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Cond
+   fun:gc_mark_children
+   fun:mark_locations_array
+}
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Cond
+   fun:mark_locations_array
+   fun:rb_thread_mark
+}
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Cond
+   fun:mark_locations_array
+   fun:mark_current_machine_context
+}
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Cond
+   fun:gc_mark
+   fun:mark_locations_array
+}
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Value8
+   fun:gc_mark
+   fun:mark_locations_array
+}
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Value8
+   fun:gc_mark
+   fun:mark_locations_array
+   fun:mark_current_machine_context
+}
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Value8
+   fun:gc_mark_children
+   fun:mark_locations_array
+}
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Value8
+   fun:gc_mark
+   fun:mark_locations_array
+}
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Value4
+   fun:gc_mark
+   fun:mark_locations_array
+}
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Value4
+   fun:gc_mark
+   fun:mark_locations_array
+   fun:mark_current_machine_context
+}
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Value4
+   fun:gc_mark_children
+   fun:mark_locations_array
+}
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Value4
+   fun:gc_mark
+   fun:mark_locations_array
+}
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Value4
+   fun:mark_locations_array
+   fun:mark_current_machine_context
+}

Reply via email to