[#35027] [Ruby 1.9-Bug#4352][Open] [patch] Fix eval(s, b) backtrace; make eval(s, b) consistent with eval(s) — "James M. Lawrence" <redmine@...>

Bug #4352: [patch] Fix eval(s, b) backtrace; make eval(s, b) consistent with eval(s)

16 messages 2011/02/01

[#35114] [Ruby 1.9-Bug#4373][Open] http.rb:677: [BUG] Segmentation fault — Christian Fazzini <redmine@...>

Bug #4373: http.rb:677: [BUG] Segmentation fault

59 messages 2011/02/06

[#35171] [Ruby 1.9-Bug#4386][Open] encoding: directive does not affect regex expressions — mathew murphy <redmine@...>

Bug #4386: encoding: directive does not affect regex expressions

9 messages 2011/02/09

[#35237] [Ruby 1.9-Bug#4400][Open] nested at_exit hooks run in strange order — Suraj Kurapati <redmine@...>

Bug #4400: nested at_exit hooks run in strange order

12 messages 2011/02/15

[ruby-core:35094] Re: allocate vs. initialize & JSON segfault

From: Tim Elliott <tle@...>
Date: 2011-02-04 18:35:48 UTC
List: ruby-core #35094
On Thu, Feb 3, 2011 at 5:54 PM, U.Nakamura <usa@garbagecollect.jp> wrote:
> In this case, JSON extension should check whether the members
> of the struct is `empty' or not.
> So, this is a bug of JSON extension.

Here is a similar issue in the OpenSSL extension:

  require 'openssl'
  class OpenSSL::Cipher
    def initialize; end
  end

  c = OpenSSL::Cipher.new
  c.final # => [BUG] Segmentation fault

And here in Syck:

  require 'syck'
  include Syck

  class Scalar
    def initialize; end
  end

  o = Scalar.new
  o.dup
  GC.start # => *** glibc detected *** ruby: double free or corruption

Perhaps we need a warning in README.EXT -- you don't want to leave
your object in an unusable state after the alloc method, i.e.

void rb_define_alloc_func(VALUE klass, VALUE (*func)(VALUE klass));
func has to take the klass as the argument and return a newly
allocated instance. This instance should be as empty as possible,
without any expensive (including external) resources. However, the
instance must be in a usable state to accept method calls. Do not rely
on the initialize method as it is not guaranteed to run.

In This Thread

Prev Next