Project

General

Profile

Bug #9150

Segfault in case statement execution, possibly related to refinements

Added by bradleybuda (Bradley Buda) about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.0.0p353 (2013-11-22 revision 43783) [x86_64-darwin13.0.0]
[ruby-core:58563]

Description

This code consistently segfaults in 2.0.0p353:

require 'active_support/all'

case 3600
when 1.week then true
end

This is after gem install activesupport --version=3.2.13. The code works fine in 2.0.0p247.

I ran a git bisect between the two patches and I've narrowed it down to this change: https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/42869 . I don't know enough about ruby's internals to debug this any further, but according to LLDB the problem is a null pointer dereference in vm_eval.c:

141 {
142 VALUE ret;
143
144 if (!ci->me->def) return Qnil;
145
146 if (th->passed_block) {
147 ci->blockptr = (rb_block_t *)th->passed_block;

ci->me is null on line 144.

I can reproduce this error on both OSX and Linux. Let me know if I can provide any more info to help debug this.


Related issues

Is duplicate of Backport200 - Backport #8872: Case statements do not honor a refinement of the '===' methodClosed09/07/2013Actions

History

Updated by zzak (Zachary Scott) about 6 years ago

  • Status changed from Open to Assigned
  • Assignee set to nagachika (Tomoyuki Chikanaga)

nagachika (Tomoyuki Chikanaga) What do you think?

Updated by shugo (Shugo Maeda) about 6 years ago

I've not investigated this problem yet, but Matz said implicit method calls should not honor refinements, so r42869 might be an undesirable change.

Updated by nagachika (Tomoyuki Chikanaga) about 6 years ago

  • Status changed from Assigned to Closed

duplicated. please move to #8872

Also available in: Atom PDF