Project

General

Profile

Actions

Bug #17780

closed

Backport for super_method aliases in ruby 2.7.3 causes Segfault

Added by dewyze (John DeWyze) almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Target version:
-
ruby -v:
2.7.3p183
[ruby-core:103272]

Description

This error was discovered while trying to run bundle exec srb init on a new rails project.

Thanks to Peter Zhu for debugging this, finding the breaking commit, and providing a minimum example:

Breaking commit: https://github.com/ruby/ruby/commit/c98aa2db60f43e839d7a82897c22b5ceecbed417

Minimum example:

module Test
  def foo
    puts "hello"
  end
  alias :f :foo
end
method = Test.instance_method(:f)
super_method = method.super_method

Files

crash.log (20.1 KB) crash.log peterzhu2118 (Peter Zhu), 04/07/2021 06:33 PM

Updated by peterzhu2118 (Peter Zhu) almost 3 years ago

  • Assignee set to peterzhu2118 (Peter Zhu)

Updated by peterzhu2118 (Peter Zhu) almost 3 years ago

Note that this bug is reproducible on 2.6.7, 2.7.3, 3.0.1, master.

Updated by peterzhu2118 (Peter Zhu) almost 3 years ago

Crash log is attached below.

Actions #6

Updated by jeremyevans0 (Jeremy Evans) almost 3 years ago

  • Backport changed from 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN to 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED
Actions #7

Updated by Anonymous almost 3 years ago

  • Status changed from Open to Closed

Applied in changeset git|d8a13e504992a45d52063f7c925408d7aad3595a.


[Bug #17780] Fix Method#super_method for module alias

Method#super_method crashes for aliased module methods because they are
not defined on a class. This bug was introduced in
c60aaed1856b2b6f90de0992c34771830019e021 as part of bug #17130.

Updated by nagachika (Tomoyuki Chikanaga) almost 3 years ago

  • Backport changed from 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED to 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONE

ruby_3_0 410216c9db033a72f4dd119c366bc58dd54383ec merged revision(s) d8a13e504992a45d52063f7c925408d7aad3595a.

Actions #9

Updated by usa (Usaku NAKAMURA) over 2 years ago

  • Backport changed from 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONE to 2.6: REQUIRED, 2.7: DONE, 3.0: DONE

Updated by usa (Usaku NAKAMURA) over 2 years ago

  • Backport changed from 2.6: REQUIRED, 2.7: DONE, 3.0: DONE to 2.6: DONE, 2.7: DONE, 3.0: DONE

ruby_2_6 r67945 merged revision(s) d8a13e50.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0