ports/135533: [PATCH] lang/ruby18: fix segmentation fault in 1.8.7-p160.

Yoshisato YANAGISAWA osho at pcc-software.org
Sat Jun 13 06:10:02 UTC 2009


>Number:         135533
>Category:       ports
>Synopsis:       [PATCH] lang/ruby18: fix segmentation fault in 1.8.7-p160.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 13 06:10:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Yoshisato YANAGISAWA
>Release:        FreeBSD 7.2-RELEASE-p1 amd64
>Organization:
>Environment:
System: FreeBSD ai.pcc-software.org 7.2-RELEASE-p1 FreeBSD 7.2-RELEASE-p1 #25: Wed Jun 10 23:31:06 JST 2009
>Description:

Ruby 1.8.7-p160 cause segmentation fault used with tDiary.
According to http://www.hinet.mydns.jp/tdiary/?date=20090506 (in Japanese),
this problem happens in a following procedure:
1. add method to an object with "instance_eval" method.
2. make a clone of the object.
3. Call the added method in the cloned object.
   then SEGV.

Added file(s):
- files/patch-class.c

Port maintainer (stas at FreeBSD.org) is cc'd.

>How-To-Repeat:

Just execute:
ruby -ve "C=0; o=''; o.instance_eval('def m; C; end'); o.clone.m"

>Fix:

Since this problem doesn't occur in latest stable snapshot,
I pulled some code from it.

--- ruby-1.8.7.160,1.patch begins here ---
--- /usr/ports/lang/ruby18/files/patch-class.c	1970-01-01 09:00:00.000000000 +0900
+++ /tmp/ruby18/files/patch-class.c	2009-06-13 11:17:46.000000000 +0900
@@ -0,0 +1,11 @@
+--- class.c	2009-01-16 11:00:48.000000000 +0900
++++ class.c	2009-06-13 11:16:16.000000000 +0900
+@@ -153,7 +153,7 @@
+ 		data.klass = obj;
+ 		break;
+ 	      default:
+-		data.klass = 0;
++		data.klass = Qnil;
+ 		break;
+ 	    }
+ 
--- ruby-1.8.7.160,1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list