Project

General

Profile

Actions

Bug #10282

closed

Reproducible segfault when inspecting this method

Bug #10282: Reproducible segfault when inspecting this method

Added by schnittchen (Thomas Stratmann) about 11 years ago. Updated about 11 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) about 11 years ago Actions #1 [ruby-core:65248]

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.

Updated by Anonymous about 11 years ago Actions #2

  • 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) about 11 years ago Actions #3 [ruby-core:65272]

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) about 11 years ago Actions #4 [ruby-core:65732]

  • 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: PDF Atom