Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Zlib failures #25

Closed
dgtized opened this Issue · 2 comments

2 participants

@dgtized
Collaborator

On ubuntu 9.04 using zlib1g-dev library for zlib, the standard spec run has 30 some odd failures do to Zlib.

  3) Ar#replace replaces a file ERROR
  ArgumentError: method 'to_i': given 1, expected 0
                           Ar#each {} at kernel/common/ar.rb:46
                            File.open at kernel/common/file.rb:69
                      Kernel(Ar)#open at kernel/common/kernel.rb:200
                              Ar#each at kernel/common/ar.rb:63
         Enumerable(Ar)#map (collect) at kernel/common/enumerable_186.rb:17
                              Ar#list at kernel/common/ar.rb:80
      #.__script__ {} at spec/core/ar/replace_spec.rb:66
         Kernel(Object)#instance_eval at kernel/common/eval.rb:119
            Enumerable(Array)#all? {} at kernel/common/enumerable.rb:266
                           Array#each at kernel/bootstrap/array.rb:152
               Enumerable(Array)#all? at kernel/common/enumerable.rb:266
                           Array#each at kernel/bootstrap/array.rb:152
                      main.__script__ at spec/core/ar/replace_spec.rb:5
   Rubinius::CompiledMethod#as_script at kernel/common/compiled_method.rb:219
          Compiler::Utils.single_load at kernel/compiler/compile.rb:244
         Compiler::Utils.unified_load at kernel/compiler/compile.rb:89
                          Kernel.load at kernel/common/kernel.rb:672
         Kernel(Object)#instance_eval at kernel/common/eval.rb:119
                           Array#each at kernel/bootstrap/array.rb:152
   Rubinius::CompiledMethod#as_script at kernel/common/compiled_method.rb:219
          Compiler::Utils.single_load at kernel/compiler/compile.rb:244
  Compiler::Utils.load_from_extension at kernel/compiler/compile.rb:329
              Rubinius::Loader#script at kernel/loader.rb:326
                Rubinius::Loader#main at kernel/loader.rb:406
                    Object#__script__ at kernel/loader.rb:454

  4)  An exception occurred during: before :each
  Zlib::Deflate#deflate deflates some data ERROR
  Zlib::Error: unknown zlib error -6: incompatible version
                    Zlib.handle_error at lib/zlib.rb:1471
             Zlib::Deflate#initialize at lib/zlib.rb:627
      #.__script__ {} at spec/frozen/library/zlib/deflate/deflate_spec.rb:7
         Kernel(Object)#instance_eval at kernel/common/eval.rb:119
            Enumerable(Array)#all? {} at kernel/common/enumerable.rb:266
                           Array#each at kernel/bootstrap/array.rb:152
               Enumerable(Array)#all? at kernel/common/enumerable.rb:266
                           Array#each at kernel/bootstrap/array.rb:152
                      main.__script__ at spec/frozen/library/zlib/deflate/deflate_spec.rb:4
   Rubinius::CompiledMethod#as_script at kernel/common/compiled_method.rb:219
          Compiler::Utils.single_load at kernel/compiler/compile.rb:244
         Compiler::Utils.unified_load at kernel/compiler/compile.rb:89
                          Kernel.load at kernel/common/kernel.rb:672
         Kernel(Object)#instance_eval at kernel/common/eval.rb:119
                           Array#each at kernel/bootstrap/array.rb:152
   Rubinius::CompiledMethod#as_script at kernel/common/compiled_method.rb:219
          Compiler::Utils.single_load at kernel/compiler/compile.rb:244
  Compiler::Utils.load_from_extension at kernel/compiler/compile.rb:329
              Rubinius::Loader#script at kernel/loader.rb:326
                Rubinius::Loader#main at kernel/loader.rb:406
                    Object#__script__ at kernel/loader.rb:454

A little more specific information on this bug:

$ cat exp/deflate.rb
require 'zlib'
 
data = "\000" * 10
zipped = Zlib::Deflate.deflate data
 
p zipped
 
$ ruby exp/deflate.rb
"x\234c`\200\001\000\000\n\000\001"
 
$ rbx exp/deflate.rb
An exception occurred running exp/deflate.rb
    No method 'end' on an instance of NilClass. (NoMethodError)
 
Backtrace:
  Kernel(NilClass)#end (method_missing) at kernel/delta/kernel.rb:47
                 Zlib::Deflate.deflate at lib/zlib.rb:601
                       main.__script__ at exp/deflate.rb:4
    Rubinius::CompiledMethod#as_script at kernel/common/compiled_method.rb:219
           Compiler::Utils.single_load at kernel/compiler/compile.rb:244
   Compiler::Utils.load_from_extension at kernel/compiler/compile.rb:329
               Rubinius::Loader#script at kernel/loader.rb:326
                 Rubinius::Loader#main at kernel/loader.rb:404
                     Object#__script__ at kernel/loader.rb:452

The following example triggers the incompatible version error:

 
$ cat exp/deflate2.rb
require 'zlib'
 
d = Zlib::Deflate.new
d.set_dictionary 'aaaaaaaaaa'
d << 'abcdefghij'
 
p d.finish
 
$ ruby exp/deflate2.rb
"x\273\024\341\003\313KLJNIMK\317\310\314\002\000\025\206\003\370"
$ rbx exp/deflate2.rb
An exception occurred running exp/deflate2.rb
    unknown zlib error -6: incompatible version (Zlib::Error)
 
Backtrace:
                    Zlib.handle_error at lib/zlib.rb:1471
             Zlib::Deflate#initialize at lib/zlib.rb:627
                      main.__script__ at exp/deflate2.rb:3
   Rubinius::CompiledMethod#as_script at kernel/common/compiled_method.rb:219
          Compiler::Utils.single_load at kernel/compiler/compile.rb:244
  Compiler::Utils.load_from_extension at kernel/compiler/compile.rb:329
              Rubinius::Loader#script at kernel/loader.rb:326
                Rubinius::Loader#main at kernel/loader.rb:404
                    Object#__script__ at kernel/loader.rb:452
@dgtized
Collaborator

It would appear that one of the following commits fixed this error. Please reopen this ticket if anyone is still experiencing this error.

commit 4b85853bd54b2cad6c409412a3186d0203a1fa7f
Author: Brian Lopez 
Date:   Fri Oct 23 20:52:51 2009 -0700

    add specs for passing negative or zero value length to Zlib::GzipReader#read

commit 9a8911427ef09e7e68fc59a92b670ac2afe67a66
Author: Brian Lopez 
Date:   Fri Oct 23 20:52:20 2009 -0700

    add support code for Zlib::GzipReader#read to handle negative length being passed

commit 42202e8c677faca98cc2cf212a498892ed26c176
Author: Brian Lopez 
Date:   Fri Oct 23 20:47:57 2009 -0700

    add missing specs for Zlib::GzipReader#eof? bug

commit 9001c7f8df36193c32367efa9778b1c339652628
Author: Brian Lopez 
Date:   Fri Oct 23 20:44:04 2009 -0700

    Fix a bug in Zlib::GzipReader#eof? where it would return true even though there was data left in the buffer
@brianmario

So the only strange thing is that these commits had to do with Zlib::GzipReader, not Zlib::Deflate. Has something else changed on the Ubuntu system you were testing with?
Not saying it's not fixed, just seems odd that these commits would have done it.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.