Details

    • Type: Task Task
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6.4
    • Fix Version/s: JRuby 1.6.5, JRuby 1.7.0.pre1
    • Component/s: Extensions
    • Labels:
      None
    • Environment:
      any
    • Number of attachments :
      0

      Description

      Zlib::Inflate accepts MAX_WBITS + 16 (means gzip inflation) and MAX_WBITS + 32 (automatic detection of zip/gzip) as a windowBits value. And Zlib::Deflate accepts MAX_WBITS + 16 (means gzip deflation).

      These features are from zlib 1.2.1. CRuby just passes windowBits value to zlib (inflateInit2 and deflateInit2) so it supports the extra features when underlying zlib supports it. You cannot use these features when you compile CRuby with zlib 1.1.X.

      I heard that Rack started using this feature. JRuby should also support it even though those features are undocumented at CRuby level.

        Activity

        Hide
        Hiroshi Nakamura added a comment -

        windowBits, not related to Windows.

        Show
        Hiroshi Nakamura added a comment - windowBits, not related to Windows.
        Hide
        Hiroshi Nakamura added a comment -

        Fixed master at 7b9f9996. And here's current Rack test result: 6F0E

        % jruby -S bacon -I./lib:./test -a -q -t '^(?!Rack::Adapter|Rack::Session::Memcache|Rack::Server)'
        ................................................................Wed Aug 24 21:40:06 +0900 2011: Reaping 1 threads for slow workers because of 'shutdown'
        Waiting for 1 requests to finish, could take 60.0 seconds.
        ........................................................................................................................................................................................................Skipping Rack::Handler::CGI tests (lighttpd is required). Install lighttpd and try again.
        ............F..F.........................................................................................................................FF..F.F...........................................................................Skipping Rack::Handler::FastCGI tests (FCGI is required). `gem install fcgi` and try again.
        ..............................................................The signal QUIT is in use by the JVM and will not work correctly on this platform
        SOCKET: SET COMM INACTIVITY UNIMPLEMENTED 30
        .SOCKET: SET COMM INACTIVITY UNIMPLEMENTED 30
        .SOCKET: SET COMM INACTIVITY UNIMPLEMENTED 30
        .SOCKET: SET COMM INACTIVITY UNIMPLEMENTED 30
        SOCKET: SET COMM INACTIVITY UNIMPLEMENTED 30
        .SOCKET: SET COMM INACTIVITY UNIMPLEMENTED 30
        .SOCKET: SET COMM INACTIVITY UNIMPLEMENTED 30
        .SOCKET: SET COMM INACTIVITY UNIMPLEMENTED 30
        .
        Bacon::Error: ["foobar"].==(["foo", "bar"]) failed
        	./test/spec_deflater.rb:54:in `(root)': Rack::Deflater - should flush deflated chunks to the client as they become ready
        	org/jruby/RubyKernel.java:1977:in `instance_eval'
        	./test/spec_deflater.rb:38:in `(root)'
        	org/jruby/RubyKernel.java:1977:in `instance_eval'
        	./test/spec_deflater.rb:7:in `(root)'
        	org/jruby/RubyKernel.java:1050:in `load'
        	./test/spec_deflater.rb:115:in `(root)'
        	org/jruby/RubyArray.java:1603:in `each'
        	org/jruby/RubyKernel.java:1050:in `load'
        
        Bacon::Error: ["foobar"].==(["foo", "bar"]) failed
        	./test/spec_deflater.rb:107:in `(root)': Rack::Deflater - should flush gzipped chunks to the client as they become ready
        	org/jruby/RubyKernel.java:1977:in `instance_eval'
        	./test/spec_deflater.rb:91:in `(root)'
        	org/jruby/RubyKernel.java:1977:in `instance_eval'
        	./test/spec_deflater.rb:7:in `(root)'
        	org/jruby/RubyKernel.java:1050:in `load'
        	./test/spec_deflater.rb:115:in `(root)'
        	org/jruby/RubyArray.java:1603:in `each'
        	org/jruby/RubyKernel.java:1050:in `load'
        
        Bacon::Error: "{\"counter\"=>1}".==("{\"counter\"=>2}") failed
        	./test/spec_session_cookie.rb:89:in `(root)': Rack::Session::Cookie - loads from a cookie
        	org/jruby/RubyKernel.java:1977:in `instance_eval'
        	./test/spec_session_cookie.rb:84:in `(root)'
        	org/jruby/RubyKernel.java:1977:in `instance_eval'
        	./test/spec_session_cookie.rb:4:in `(root)'
        	org/jruby/RubyKernel.java:1050:in `load'
        	./test/spec_session_cookie.rb:115:in `(root)'
        	org/jruby/RubyArray.java:1603:in `each'
        	org/jruby/RubyKernel.java:1050:in `load'
        
        Bacon::Error: not "".==("") failed
        	./test/spec_session_cookie.rb:114:in `(root)': Rack::Session::Cookie - renew session id
        	org/jruby/RubyKernel.java:1977:in `instance_eval'
        	./test/spec_session_cookie.rb:105:in `(root)'
        	org/jruby/RubyKernel.java:1977:in `instance_eval'
        	./test/spec_session_cookie.rb:4:in `(root)'
        	org/jruby/RubyKernel.java:1050:in `load'
        	./test/spec_session_cookie.rb:115:in `(root)'
        	org/jruby/RubyArray.java:1603:in `each'
        	org/jruby/RubyKernel.java:1050:in `load'
        
        Bacon::Error: "{\"counter\"=>1}".==("{\"counter\"=>2}") failed
        	./test/spec_session_cookie.rb:140:in `(root)': Rack::Session::Cookie - loads from a cookie wih integrity hash
        	org/jruby/RubyKernel.java:1977:in `instance_eval'
        	./test/spec_session_cookie.rb:135:in `(root)'
        	org/jruby/RubyKernel.java:1977:in `instance_eval'
        	./test/spec_session_cookie.rb:4:in `(root)'
        	org/jruby/RubyKernel.java:1050:in `load'
        	./test/spec_session_cookie.rb:115:in `(root)'
        	org/jruby/RubyArray.java:1603:in `each'
        	org/jruby/RubyKernel.java:1050:in `load'
        
        Bacon::Error: "{}".=~(/"session_id"=>/) failed
        	./test/spec_session_cookie.rb:168:in `(root)': Rack::Session::Cookie - returns the session id in the session hash
        	org/jruby/RubyKernel.java:1977:in `instance_eval'
        	./test/spec_session_cookie.rb:161:in `(root)'
        	org/jruby/RubyKernel.java:1977:in `instance_eval'
        	./test/spec_session_cookie.rb:4:in `(root)'
        	org/jruby/RubyKernel.java:1050:in `load'
        	./test/spec_session_cookie.rb:115:in `(root)'
        	org/jruby/RubyArray.java:1603:in `each'
        	org/jruby/RubyKernel.java:1050:in `load'
        
        552 tests, 1688 assertions, 6 failures, 0 errors
        zsh: exit 1     /home/nahi/git/jruby/bin/jruby -S bacon -I./lib:./test -a -q -t 
        

        I still get 2F from Zlib::Inflate, but it's from different internal buffer mgmt and I don't think I can adjust. (["foo", "bar"] vs ["foobar"]). Test should be changed as follows I think.

            inflater = Zlib::Inflate.new(Zlib::MAX_WBITS + 32)
            response[2].each { |part| buf << inflater.inflate(part) }
            buf << inflater.finish
            buf.delete_if { |part| part.empty? }
            buf.should.equal(%w(foo bar))
        
        ->
        
            inflater = Zlib::Inflate.new(Zlib::MAX_WBITS + 32)
            response[2].each { |part| buf << inflater.inflate(part) }
            buf << inflater.finish
            buf.join.should.equal("foobar")
        

        The testcase already ignores any "" in chunk. No need to care about chunking then.

        I don't know about other 4F... Appears to be unrelated to Zlib.

        Any objection to merge it to jruby-1_6?

        Show
        Hiroshi Nakamura added a comment - Fixed master at 7b9f9996. And here's current Rack test result: 6F0E % jruby -S bacon -I./lib:./test -a -q -t '^(?!Rack::Adapter|Rack::Session::Memcache|Rack::Server)' ................................................................Wed Aug 24 21:40:06 +0900 2011: Reaping 1 threads for slow workers because of 'shutdown' Waiting for 1 requests to finish, could take 60.0 seconds. ........................................................................................................................................................................................................Skipping Rack::Handler::CGI tests (lighttpd is required). Install lighttpd and try again. ............F..F.........................................................................................................................FF..F.F...........................................................................Skipping Rack::Handler::FastCGI tests (FCGI is required). `gem install fcgi` and try again. ..............................................................The signal QUIT is in use by the JVM and will not work correctly on this platform SOCKET: SET COMM INACTIVITY UNIMPLEMENTED 30 .SOCKET: SET COMM INACTIVITY UNIMPLEMENTED 30 .SOCKET: SET COMM INACTIVITY UNIMPLEMENTED 30 .SOCKET: SET COMM INACTIVITY UNIMPLEMENTED 30 SOCKET: SET COMM INACTIVITY UNIMPLEMENTED 30 .SOCKET: SET COMM INACTIVITY UNIMPLEMENTED 30 .SOCKET: SET COMM INACTIVITY UNIMPLEMENTED 30 .SOCKET: SET COMM INACTIVITY UNIMPLEMENTED 30 . Bacon::Error: ["foobar"].==(["foo", "bar"]) failed ./test/spec_deflater.rb:54:in `(root)': Rack::Deflater - should flush deflated chunks to the client as they become ready org/jruby/RubyKernel.java:1977:in `instance_eval' ./test/spec_deflater.rb:38:in `(root)' org/jruby/RubyKernel.java:1977:in `instance_eval' ./test/spec_deflater.rb:7:in `(root)' org/jruby/RubyKernel.java:1050:in `load' ./test/spec_deflater.rb:115:in `(root)' org/jruby/RubyArray.java:1603:in `each' org/jruby/RubyKernel.java:1050:in `load' Bacon::Error: ["foobar"].==(["foo", "bar"]) failed ./test/spec_deflater.rb:107:in `(root)': Rack::Deflater - should flush gzipped chunks to the client as they become ready org/jruby/RubyKernel.java:1977:in `instance_eval' ./test/spec_deflater.rb:91:in `(root)' org/jruby/RubyKernel.java:1977:in `instance_eval' ./test/spec_deflater.rb:7:in `(root)' org/jruby/RubyKernel.java:1050:in `load' ./test/spec_deflater.rb:115:in `(root)' org/jruby/RubyArray.java:1603:in `each' org/jruby/RubyKernel.java:1050:in `load' Bacon::Error: "{\"counter\"=>1}".==("{\"counter\"=>2}") failed ./test/spec_session_cookie.rb:89:in `(root)': Rack::Session::Cookie - loads from a cookie org/jruby/RubyKernel.java:1977:in `instance_eval' ./test/spec_session_cookie.rb:84:in `(root)' org/jruby/RubyKernel.java:1977:in `instance_eval' ./test/spec_session_cookie.rb:4:in `(root)' org/jruby/RubyKernel.java:1050:in `load' ./test/spec_session_cookie.rb:115:in `(root)' org/jruby/RubyArray.java:1603:in `each' org/jruby/RubyKernel.java:1050:in `load' Bacon::Error: not "".==("") failed ./test/spec_session_cookie.rb:114:in `(root)': Rack::Session::Cookie - renew session id org/jruby/RubyKernel.java:1977:in `instance_eval' ./test/spec_session_cookie.rb:105:in `(root)' org/jruby/RubyKernel.java:1977:in `instance_eval' ./test/spec_session_cookie.rb:4:in `(root)' org/jruby/RubyKernel.java:1050:in `load' ./test/spec_session_cookie.rb:115:in `(root)' org/jruby/RubyArray.java:1603:in `each' org/jruby/RubyKernel.java:1050:in `load' Bacon::Error: "{\"counter\"=>1}".==("{\"counter\"=>2}") failed ./test/spec_session_cookie.rb:140:in `(root)': Rack::Session::Cookie - loads from a cookie wih integrity hash org/jruby/RubyKernel.java:1977:in `instance_eval' ./test/spec_session_cookie.rb:135:in `(root)' org/jruby/RubyKernel.java:1977:in `instance_eval' ./test/spec_session_cookie.rb:4:in `(root)' org/jruby/RubyKernel.java:1050:in `load' ./test/spec_session_cookie.rb:115:in `(root)' org/jruby/RubyArray.java:1603:in `each' org/jruby/RubyKernel.java:1050:in `load' Bacon::Error: "{}".=~(/"session_id"=>/) failed ./test/spec_session_cookie.rb:168:in `(root)': Rack::Session::Cookie - returns the session id in the session hash org/jruby/RubyKernel.java:1977:in `instance_eval' ./test/spec_session_cookie.rb:161:in `(root)' org/jruby/RubyKernel.java:1977:in `instance_eval' ./test/spec_session_cookie.rb:4:in `(root)' org/jruby/RubyKernel.java:1050:in `load' ./test/spec_session_cookie.rb:115:in `(root)' org/jruby/RubyArray.java:1603:in `each' org/jruby/RubyKernel.java:1050:in `load' 552 tests, 1688 assertions, 6 failures, 0 errors zsh: exit 1 /home/nahi/git/jruby/bin/jruby -S bacon -I./lib:./test -a -q -t I still get 2F from Zlib::Inflate, but it's from different internal buffer mgmt and I don't think I can adjust. ( ["foo", "bar"] vs ["foobar"] ). Test should be changed as follows I think. inflater = Zlib::Inflate.new(Zlib::MAX_WBITS + 32) response[2].each { |part| buf << inflater.inflate(part) } buf << inflater.finish buf.delete_if { |part| part.empty? } buf.should.equal(%w(foo bar)) -> inflater = Zlib::Inflate.new(Zlib::MAX_WBITS + 32) response[2].each { |part| buf << inflater.inflate(part) } buf << inflater.finish buf.join.should.equal("foobar") The testcase already ignores any "" in chunk. No need to care about chunking then. I don't know about other 4F... Appears to be unrelated to Zlib. Any objection to merge it to jruby-1_6?
        Hide
        Hiroshi Nakamura added a comment -

        I got no objection, but now JZlib author @ymnk is trying to rewrite RubyZlib.java with JZlib. I think it would need a little more time to merge it into master.

        I'm working for JRUBY-5778 now, and when I finished that work, I'll merge RubyZlib.java updates to jruby-1_6.

        Show
        Hiroshi Nakamura added a comment - I got no objection, but now JZlib author @ymnk is trying to rewrite RubyZlib.java with JZlib. I think it would need a little more time to merge it into master. I'm working for JRUBY-5778 now, and when I finished that work, I'll merge RubyZlib.java updates to jruby-1_6.
        Hide
        Hiroshi Nakamura added a comment -

        Merged to jruby-1_6 as well as master, from 7d492071 to 74a927bd. Closing since the original issue should be fixed. (JZlib should be handled at another ticket)

        Show
        Hiroshi Nakamura added a comment - Merged to jruby-1_6 as well as master, from 7d492071 to 74a927bd. Closing since the original issue should be fixed. (JZlib should be handled at another ticket)

          People

          • Assignee:
            Hiroshi Nakamura
            Reporter:
            Hiroshi Nakamura
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: