From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Jun 13 06:10:01 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3774106566C for ; Sat, 13 Jun 2009 06:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A82428FC15 for ; Sat, 13 Jun 2009 06:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n5D6A1lU018697 for ; Sat, 13 Jun 2009 06:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n5D6A1iA018696; Sat, 13 Jun 2009 06:10:01 GMT (envelope-from gnats) Resent-Date: Sat, 13 Jun 2009 06:10:01 GMT Resent-Message-Id: <200906130610.n5D6A1iA018696@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Yoshisato YANAGISAWA Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A584F106566B; Sat, 13 Jun 2009 06:01:37 +0000 (UTC) (envelope-from osho@pcc-software.org) Received: from aki.pcc-software.org (203.141.144.45.static.zoot.jp [203.141.144.45]) by mx1.freebsd.org (Postfix) with ESMTP id 67A008FC12; Sat, 13 Jun 2009 06:01:37 +0000 (UTC) (envelope-from osho@pcc-software.org) Received: from aki.pcc-software.org (aki.pcc-software.org [10.0.0.2]) by aki.pcc-software.org (Postfix) with ESMTP id 2A0DB3A38A3; Sat, 13 Jun 2009 14:53:13 +0900 (JST) Received: from aki.pcc-software.org (aki.pcc-software.org [10.0.0.2]) by aki.pcc-software.org (Postfix) with ESMTP id B0E8F3A385C; Sat, 13 Jun 2009 14:53:12 +0900 (JST) Received: from ai.pcc-software.org (aki.pcc-software.org [10.0.0.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by aki.pcc-software.org (Postfix) with ESMTPS; Sat, 13 Jun 2009 14:53:12 +0900 (JST) Received: (from osho@localhost) by ai.pcc-software.org (8.14.3/8.14.3/Submit) id n5D5rCVJ025309; Sat, 13 Jun 2009 14:53:12 +0900 (JST) (envelope-from osho) Message-Id: <200906130553.n5D5rCVJ025309@ai.pcc-software.org> Date: Sat, 13 Jun 2009 14:53:12 +0900 (JST) From: Yoshisato YANAGISAWA To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: stas@FreeBSD.org Subject: ports/135533: [PATCH] lang/ruby18: fix segmentation fault in 1.8.7-p160. X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 06:10:02 -0000 >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@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: