Project

General

Profile

Actions

Bug #8880

closed

Refinements bug in ruby 2.1.0dev (2013-09-08) [x86_64-linux]

Added by Anonymous over 10 years ago. Updated over 10 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 2.1.0dev (2013-09-08) [x86_64-linux]
[ruby-core:57079]

Description

Hi,

I found a bug in the refinements implementation of Ruby 2.1.0. It is related to https://bugs.ruby-lang.org/issues/8722. On ruby 2.0.0p0 (2013-02-24 revision 39474) this does not occur.

The VM segfaults when the attached code is executed. The problem is that a used refinement is modified afterwards.

Daniel


Files

broken.rb (179 Bytes) broken.rb Anonymous, 09/09/2013 10:13 AM

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

#8722 is irrelevant, and it occurs regardless of eval.

Seems refined method definition doesn't increase seq in the class.

Actions #2

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r42896.
Daniel, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


vm_method.c: clear cache after refine method

  • vm_method.c (rb_add_refined_method_entry): clear cache in the
    refined class since refining a method entry is modifying the class.
    [ruby-core:57079] [Bug #8880]

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN to 1.9.3: DONTNEED, 2.0.0: DONTNEED
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0