Project

General

Profile

Bug #10707

Segmentation fault when get refined new method in BasicObject

Added by hanachin (Seiei Miyagi) about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-01-07 trunk 49171) [x86_64-darwin13]
[ruby-core:67389]

Description

following code cause SEGV in ruby-trunk, 2.2.0, 2.1.5

module RefinementBug
  refine BasicObject do
    def foo
    end
  end
end

method(:foo)

it should be raise NameError like:

/Users/hanachin/tmp/bug.rb:8:in `method': undefined method `foo' for class `Object' (NameError)
    from /Users/hanachin/tmp/bug.rb:8:in `<main>'

bug.rb View (89 Bytes) hanachin (Seiei Miyagi), 01/07/2015 12:56 PM

miniruby_2015-01-07-215224_Module.crash (10.4 KB) hanachin (Seiei Miyagi), 01/07/2015 12:56 PM

0001-vm_method.c-no-klass-no-method-entry.patch View (1.37 KB) hanachin (Seiei Miyagi), 01/07/2015 01:02 PM

Associated revisions

Revision 49184
Added by nobu (Nobuyoshi Nakada) about 2 years ago

vm_method.c: no super klass, no original method entry

  • vm_method.c (rb_method_entry): if no super class, no original method entry. [Bug #10707]

Revision 49184
Added by nobu (Nobuyoshi Nakada) about 2 years ago

vm_method.c: no super klass, no original method entry

  • vm_method.c (rb_method_entry): if no super class, no original method entry. [Bug #10707]

Revision 49184
Added by nobu (Nobuyoshi Nakada) about 2 years ago

vm_method.c: no super klass, no original method entry

  • vm_method.c (rb_method_entry): if no super class, no original method entry. [Bug #10707]

Revision 49331
Added by naruse (Yui NARUSE) about 2 years ago

merge revision(s) 49184: [Backport #10707]

* vm_method.c (rb_method_entry): if no super class, no original
  method entry.   [Bug #10707]

Revision 50131
Added by nagachika (Tomoyuki Chikanaga) almost 2 years ago

merge revision(s) r49184: [Backport #10707]

* vm_method.c (rb_method_entry): if no super class, no original
  method entry.   [Bug #10707]

History

#2 [ruby-core:67426] Updated by nobu (Nobuyoshi Nakada) about 2 years ago

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

Applied in changeset r49184.


vm_method.c: no super klass, no original method entry

  • vm_method.c (rb_method_entry): if no super class, no original method entry. [Bug #10707]

#3 [ruby-core:67434] Updated by nagachika (Tomoyuki Chikanaga) about 2 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: UNKNOWN, 2.1: REQUIRED, 2.2: REQUIRED

#4 Updated by usa (Usaku NAKAMURA) about 2 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: REQUIRED

#5 [ruby-core:67682] Updated by naruse (Yui NARUSE) about 2 years ago

  • Backport changed from 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: DONE

ruby_2_2 r49331 merged revision(s) 49184.

#6 Updated by nagachika (Tomoyuki Chikanaga) almost 2 years ago

  • Backport changed from 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: DONE to 2.0.0: DONTNEED, 2.1: DONE, 2.2: DONE

Backported into ruby_2_1 branch at r50131.

Also available in: Atom PDF