Project

General

Profile

Bug #4360

Zlib::GzipReader#unused raises "called on hidden object" error when called

Added by drbrain (Eric Hodel) over 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3dev (2011-02-01 trunk 30751) [x86_64-darwin10.6.0]
Backport:
[ruby-core:35057]

Description

=begin
When reading concatenated gzip streams #unused is provided for accessing the data that has been read from the IO but not consumed by libz. Unfortunately calling this method raises an exception:

$ ruby19 -v t.rb
ruby 1.9.3dev (2011-02-01 trunk 30751) [x86_64-darwin10.6.0]
aaaa
t.rb:21:in <main>': methodmethod_missing' called on hidden T_STRING object (0x0000010090ee20 flags=0x6105 klass=0x0) (NotImplementedError)

Zlib::GzipReader#unused returns the internal buffer directly but dups it. Copying the input string's contents duplicates fixes the problem. A stupid patch is attached.

This occurs on 1.8.7, 1.9.1 and 1.9.2 as well.
=end


Files

t.rb (353 Bytes) t.rb Test file for reading concatenated gzip streams drbrain (Eric Hodel), 02/03/2011 10:31 AM
zlib.c.unused.patch (478 Bytes) zlib.c.unused.patch Stupid patch to fix Zlib::GzipReader#unused drbrain (Eric Hodel), 02/03/2011 10:31 AM

Related issues

Related to Backport192 - Backport #4369: Backport r30772 Zlib::GzipReader#unused fix to 1_9_2Closed02/05/2011Actions

History

#1

Updated by drbrain (Eric Hodel) over 8 years ago

=begin
See also [ruby-talk:377703]
=end

#2

Updated by naruse (Yui NARUSE) over 8 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r30772.
Eric, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • ext/zlib/zlib.c (gzfile_reader_get_unused): use rb_str_new_shared because gz->z.input is hidden string. [ruby-core:35057] =end

Also available in: Atom PDF