Project

General

Profile

Actions

Bug #10282

closed

Reproducible segfault when inspecting this method

Added by schnittchen (Thomas Stratmann) over 9 years ago. Updated over 9 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
2.1.2
[ruby-core:65214]

Description

The example code can be found here (in this exact comment): https://github.com/pry/pry/issues/1299#issuecomment-56389004

I have taken the time to reduce it as far as this. It should be easily reproduced on other systems/versions now.


Files

Updated by normalperson (Eric Wong) over 9 years ago

This looks to be a simple dereference bug.
However, this is my first time looking a prepend so maybe there's a subtle
behavior change I missed.

"make check" and rubyspec passes, at least.

Actions #2

Updated by Anonymous over 9 years ago

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

Applied in changeset r47715.


object.c (rb_class_real): do not dereference 0 VALUE

  • test/ruby/test_module.rb (test_inspect_segfault):
    Test case and bug report by Thomas Stratmann.
    [ruby-core:65214] [Bug #10282]

Updated by normalperson (Eric Wong) over 9 years ago

wrote:

File 0001-object.c-rb_class_real-do-not-dereference-0-VALUE.patch added

This looks to be a simple dereference bug.
However, this is my first time looking a prepend so maybe there's a subtle
behavior change I missed.

Committed as r47715; I don't think this breaks existing code
(but even if it did, it's better than segfaulting).

"make check" and rubyspec passes, at least.

Updated by nagachika (Tomoyuki Chikanaga) over 9 years ago

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

Backported into ruby_2_1 at r47957.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0