[csw-devel] SF.net SVN: gar:[11440] csw/mgar/pkg/ruby/trunk

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Thu Oct 28 03:53:17 CEST 2010


Revision: 11440
          http://gar.svn.sourceforge.net/gar/?rev=11440&view=rev
Author:   bdwalton
Date:     2010-10-28 01:53:17 +0000 (Thu, 28 Oct 2010)

Log Message:
-----------
ruby: create new patch to (hopefully) address mantis 4399, a segfault problem

Modified Paths:
--------------
    csw/mgar/pkg/ruby/trunk/Makefile

Added Paths:
-----------
    csw/mgar/pkg/ruby/trunk/files/0002-Correct-potential-segfault-caused-during-garbage-col.patch

Modified: csw/mgar/pkg/ruby/trunk/Makefile
===================================================================
--- csw/mgar/pkg/ruby/trunk/Makefile	2010-10-28 01:30:37 UTC (rev 11439)
+++ csw/mgar/pkg/ruby/trunk/Makefile	2010-10-28 01:53:17 UTC (rev 11440)
@@ -76,8 +76,8 @@
 
 # See: http://rubyforge.org/tracker/index.php?func=detail&aid=17607&group_id=426&atid=1698
 PATCHFILES = rdoc_parse_order_fix.patch
+PATCHFILES += 0002-Correct-potential-segfault-caused-during-garbage-col.patch
 
-
 CONFIGURE_ARGS  = $(DIRPATHS)
 CONFIGURE_ARGS += --enable-pthread
 CONFIGURE_ARGS += --enable-shared

Added: csw/mgar/pkg/ruby/trunk/files/0002-Correct-potential-segfault-caused-during-garbage-col.patch
===================================================================
--- csw/mgar/pkg/ruby/trunk/files/0002-Correct-potential-segfault-caused-during-garbage-col.patch	                        (rev 0)
+++ csw/mgar/pkg/ruby/trunk/files/0002-Correct-potential-segfault-caused-during-garbage-col.patch	2010-10-28 01:53:17 UTC (rev 11440)
@@ -0,0 +1,31 @@
+From 59b6ed9081932b52f0f5fb1be2fdd51d3d3cb3b4 Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Thu, 28 Oct 2010 03:49:46 +0200
+Subject: [PATCH] Correct potential segfault caused during garbage collection
+
+This fix was suggested at: http://www.ruby-forum.com/topic/198545
+
+It's an attempt to stop ruby from segfaulting during heavy object
+allocation.  This is in effort to resolve Mantis ID 4399.
+
+Signed-off-by: Ben Walton <bwalton at opencsw.org>
+---
+ gc.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/gc.c b/gc.c
+index 4b1bd37..326c907 100644
+--- a/gc.c
++++ b/gc.c
+@@ -433,7 +433,7 @@ rb_newobj()
+     if (during_gc)
+ 	rb_bug("object allocation during garbage collection phase");
+ 
+-    if (ruby_gc_stress || !freelist) garbage_collect();
++    if (ruby_gc_stress || !freelist || !freelist->as.free.next) garbage_collect();
+ 
+     obj = (VALUE)freelist;
+     freelist = freelist->as.free.next;
+-- 
+1.7.3
+


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list