Bug 135533 - [PATCH] lang/ruby18: fix segmentation fault in 1.8.7-p160.
Summary: [PATCH] lang/ruby18: fix segmentation fault in 1.8.7-p160.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Stanislav Sedov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-13 07:10 UTC by Yoshisato Yanagisawa
Modified: 2009-06-18 14:10 UTC (History)
1 user (show)

See Also:


Attachments
ruby-1.8.7.160,1.patch (407 bytes, patch)
2009-06-13 07:10 UTC, Yoshisato Yanagisawa
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yoshisato Yanagisawa 2009-06-13 07:10:01 UTC
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.

Fix: Since this problem doesn't occur in latest stable snapshot,
I pulled some code from it.
How-To-Repeat: 
Just execute:
ruby -ve "C=0; o=''; o.instance_eval('def m; C; end'); o.clone.m"
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2009-06-13 07:10:11 UTC
Responsible Changed
From-To: freebsd-ports-bugs->stas

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2009-06-18 13:43:40 UTC
stas        2009-06-18 12:43:26 UTC

  FreeBSD ports repository

  Modified files:
    Mk                   bsd.ruby.mk 
  Added files:
    lang/ruby18/files    patch-class.c patch-gc.c 
                         patch-lib_uri_generic.rb 
  Log:
  - Fix the bug in ruby GC when object finalizer were never called. This has
    been triggered by portupgrade which uses finalizers to remove lockfiles.
  - Fix the bug in URI module that smashed uri paths in merge method for
    ftp uris. [1]
  - Fix segmentation fault when cloning objects with dynamically created
    methods (via instance_eval). [2]
  
  PR:             ports/131775 [1], ports/135533 [2]
  Submitted by:   Yoshisato YANAGISAWA <osho@pcc-software.org> [2],
                  Helmut Schneider <jumper99@gmx.de> [1],
                  Jaakko Heinonen <jh@saunalahti.fi> [1],
                  Peter Hofer <ph@desktopbsd.net> [1]
  Obtained from:  ruby_1_8 svn tree (rev 22679) [2]
  
  Revision  Changes    Path
  1.183     +2 -2      ports/Mk/bsd.ruby.mk
  1.1       +11 -0     ports/lang/ruby18/files/patch-class.c (new)
  1.3       +11 -0     ports/lang/ruby18/files/patch-gc.c (new)
  1.1       +19 -0     ports/lang/ruby18/files/patch-lib_uri_generic.rb (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 3 Stanislav Sedov freebsd_committer freebsd_triage 2009-06-18 14:10:43 UTC
State Changed
From-To: open->closed

Committed. Thanks!