Bug #10282
closedReproducible segfault when inspecting this method
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 10 years ago
- File 0001-object.c-rb_class_real-do-not-dereference-0-VALUE.patch 0001-object.c-rb_class_real-do-not-dereference-0-VALUE.patch added
- Category set to core
- Target version set to 2.2.0
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN to 2.0.0: DONTNEED, 2.1: REQUIRED
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 10 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) about 10 years ago
normalperson@yhbt.net 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 10 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.