ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: Aman Gupta <redmine@ruby-lang.org>
To: ruby-core@ruby-lang.org
Subject: [ruby-core:34141] [Backport87-Backport#4236][Open] zlib.c requires RB_GC_GUARD backport from 1.9
Date: Thu, 6 Jan 2011 08:40:44 +0900	[thread overview]
Message-ID: <4d25017be4ac1_1dc2b21c478453@redmine.ruby-lang.org> (raw)

Backport #4236: zlib.c requires RB_GC_GUARD backport from 1.9
http://redmine.ruby-lang.org/issues/show/4236

Author: Aman Gupta
Status: Open, Priority: Normal
Category: ext

This issue was fixed in 1.9 r28080 via this patch: http://redmine.ruby-lang.org/repositories/diff/ruby-19?rev=28080

But the issue also exists in 1.8 branch, so the same patch should be backported. To replicate:

<pre><code class="ruby">
unless File.exists?("test.gz")
  File.open("test","w"){|f| f.write "helloworld "*1024 }
  `gzip test`
end

require 'zlib'

class Zlib::GzipReader
  class << self
    alias new_orig new
    def new(*args)
     GC.stress=true
      new_orig(*args)
    ensure
     GC.stress=false
    end
  end
end

def parse_gzip(i=0)
  Zlib::GzipReader.new(File.open('test.gz','r'))
end

5.times do |i|
  parse_gzip
end
</code></pre>

$ ruby simple.rb 
simple.rb:13:in `initialize': not in gzip format (Zlib::GzipFile::Error)
	from simple.rb:13:in `new_orig'
	from simple.rb:13:in `new'
	from simple.rb:21:in `parse_gzip'
	from simple.rb:25
	from simple.rb:24:in `times'
	from simple.rb:24


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

                 reply	other threads:[~2011-01-05 23:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4d25017be4ac1_1dc2b21c478453@redmine.ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).