[#18121] [Ruby 1.8.7 - Bug #405] (Open) ssl.rb:31: [BUG] Bus Error — Anonymous <redmine@...>

Issue #405 has been reported by Anonymous.

14 messages 2008/08/04

[#18130] Re: New array methods cycle, choice, shuffle (plus bug in cycle) — Brian Candler <B.Candler@...>

> Seriously though... Array.first is a noun.

10 messages 2008/08/05

[#18319] NEW Command: absolute_path() -- — "C.E. Thornton" <admin@...>

Core,

14 messages 2008/08/16
[#18321] Re: NEW Command: absolute_path() -- — Yukihiro Matsumoto <matz@...> 2008/08/18

Hi,

[#18381] [Bug #496] DRb.start_service(nil) is very slow — Hongli Lai <redmine@...>

Bug #496: DRb.start_service(nil) is very slow

11 messages 2008/08/25

[ruby-core:18174] Re: [PATCH] error.c (Init_Exception): Rename class "fatal" to "Fatal"

From: "Jeremy Kemper" <jeremy@...>
Date: 2008-08-07 18:48:39 UTC
List: ruby-core #18174
On Thu, Aug 7, 2008 at 1:37 AM, Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
> Hi,
>
> At Wed, 6 Aug 2008 22:05:00 +0900,
> Otto Hilska wrote in [ruby-core:18148]:
>> It's still available for the scripts. For example, running in Rails
>> environment:
>>
>>  >> Object.subclasses
>> SyntaxError: (eval):1:in `subclasses_of': compile error
>> (eval):1: syntax error, unexpected tIDENTIFIER, expecting tCONSTANT
>> defined?(::fatal) && ::fatal.object_id == k.object_id
>>                  ^
>
> What do you mean by that error?

It's a method which searches ObjectSpace for subclasses of a set of
superclasses. It may find some classes which have been remove_const
but not garbage collected, so this eval checks whether the class is
'live'.

The full method:

  # Exclude this class unless it's a subclass of our supers and is defined.
  # We check defined? in case we find a removed class that has yet to be
  # garbage collected. This also fails for anonymous classes -- please
  # submit a patch if you have a workaround.
  def subclasses_of(*superclasses) #:nodoc:
    subclasses = []

    superclasses.each do |sup|
      ObjectSpace.each_object(class << sup; self; end) do |k|
        if k != sup && (k.name.blank? || eval("defined?(::#{k}) &&
::#{k}.object_id == k.object_id"))
          subclasses << k
        end
      end
    end

    subclasses
  end


>> If 'fatal' should not be used in scripts, changing the name should not
>> cause compatibility issues either. So what are the reasons for keeping
>> it lower-case?
>
> `fatal' means the case that user scripts can't/shouldn't
> raise/rescue it.
>
> First, why and how do you need it?

It's not used purposefully. The script above assumes that every Ruby
class has a valid Ruby name. It seems a fair assumption.

Best,
jeremy

In This Thread