[#30589] [Bug #3391] Use single exclamation mark instead of double exclamation mark for IRB — Diego Viola <redmine@...>

Bug #3391: Use single exclamation mark instead of double exclamation mark for IRB

10 messages 2010/06/04

[#30672] [Bug #3411] Time.local 1916,5,1 #=> 1916-04-30 23:00:00 +0100 — Benoit Daloze <redmine@...>

Bug #3411: Time.local 1916,5,1 #=> 1916-04-30 23:00:00 +0100

12 messages 2010/06/08

[#30699] [Bug #3419] 1.9.2-preview3 possible bug with Rails 3 active_record sqlite_adapter — Joe Sak <redmine@...>

Bug #3419: 1.9.2-preview3 possible bug with Rails 3 active_record sqlite_adapter

9 messages 2010/06/09

[#30734] [Bug #3428] ri outputs ansi escape sequences even when stdout is not a tty — caleb clausen <redmine@...>

Bug #3428: ri outputs ansi escape sequences even when stdout is not a tty

11 messages 2010/06/11

[#30756] [Feature #3436] Spawn the timer thread lazily — Maximilian Gass <redmine@...>

Feature #3436: Spawn the timer thread lazily

15 messages 2010/06/13
[#32686] [Ruby 1.9-Feature#3436] Spawn the timer thread lazily — Mark Somerville <redmine@...> 2010/10/04

Issue #3436 has been updated by Mark Somerville.

[ruby-core:30707] [Bug #3420] Module#method calling <=> causes SystemStackError

From: Florian Aßmann <redmine@...>
Date: 2010-06-10 06:53:57 UTC
List: ruby-core #30707
Bug #3420: Module#method calling <=> causes SystemStackError
http://redmine.ruby-lang.org/issues/show/3420

Author: Florian Aテ殞ann
Status: Open, Priority: Normal
Category: core
ruby -v: 1.9.2-head

It seems the SystemStackError will be raised when compar.c calls the spaceship:

    static VALUE
    cmp_eq(VALUE *a)
    {
        VALUE c = rb_funcall(a[0], cmp, 1, a[1]);
        ...

    ruby-1.9.2-head >
      BrokenComparable = Module.new { def ==(other) self <=> other end }
      BrokenClass = Class.new { include BrokenComparable }
      BrokenClass.new == nil
    SystemStackError: stack level too deep

The current implementation of the spaceship operator ...

    static VALUE
    rb_mod_cmp(VALUE mod, VALUE arg)
    {
        *snip*
        cmp = rb_class_inherited_p(mod, arg);
        ...

... imho tries to lookup the method in the parent classes but fails because
it's actually implemented in the Kernel module:

    ruby-1.9.2-head > Object.instance_methods(false)
     => [] 
    ruby-1.9.2-head > Object.superclass.instance_methods(false)
     => [:==, :equal?, :!, :!=, :instance_eval, :instance_exec, :__send__] 
    ruby-1.9.2-head > Object.superclass.superclass.methods(false)
     => [] 
    ruby-1.9.2-head > Object.superclass.superclass.class.instance_methods(false)
     => [:to_i, :to_f, :to_s, :to_a, :inspect, :&, :|, :^, :nil?, :to_r, :rationalize, :to_c] 
    ruby-1.9.2-head > Object.superclass.superclass.class.superclass.instance_methods(false)
     => [] 
    ruby-1.9.2-head > Object.superclass.superclass.class.superclass.superclass.instance_methods(false)
     => [:==, :equal?, :!, :!=, :instance_eval, :instance_exec, :__send__] 
    ...

    ruby-1.9.2-head > Kernel.instance_methods(false)
     => [:nil?, :===, :=~, :!~, :eql?, :hash, :<=>, :class, :singleton_class, :clone, :dup, :initialize_dup, :initialize_clone, :taint, :tainted?, :untaint, :untrust, :untrusted?, :trust, :freeze, :frozen?, :to_s, :inspect, :methods, :singleton_methods, :protected_methods, :private_methods, :public_methods, :instance_variables, :instance_variable_get, :instance_variable_set, :instance_variable_defined?, :instance_of?, :kind_of?, :is_a?, :tap, :send, :public_send, :respond_to?, :respond_to_missing?, :extend, :display, :method, :public_method, :define_singleton_method, :__id__, :object_id, :to_enum, :enum_for] 

But I'm neither familiar with C nor the ruby source so this is just a guess.

For reference http://github.com/rails/rails/commit/0042f4166f783085eb909d69d542b5323d8af5d6#commitcomment-91341.

Regards
Florian Aテ殞ann


----------------------------------------
http://redmine.ruby-lang.org

In This Thread

Prev Next