Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6.6
    • Fix Version/s: JRuby 1.6.6
    • Component/s: Ruby 1.9.2
    • Labels:
      None
    • Number of attachments :
      0

      Description

      JRuby 1.6.6 (HEAD) fails while 1.6.5 works (in 1.9 mode). Both work in 1.8 mode.

      https://raw.github.com/gist/1657018/94e0e09ad9e6113e72eef7daf7fea9c21c4b9da9/gistfile1.txt

        Activity

        Hide
        Michael Klishin added a comment -

        Strings on 1.9 no longer respond to #each (you can get the same behavior by iterating over String#bytes). This seems to be a faulty 1.6.5 behavior that is fixed now. Check for yourself: https://gist.github.com/d3c4071b798b7b29fedd

        Show
        Michael Klishin added a comment - Strings on 1.9 no longer respond to #each (you can get the same behavior by iterating over String#bytes). This seems to be a faulty 1.6.5 behavior that is fixed now. Check for yourself: https://gist.github.com/d3c4071b798b7b29fedd
        Hide
        Arturas Slajus added a comment - - edited

        Thats not the problem.

        1.6.6:

        arturas@zeus:~/work/spacegame/server$ jruby --1.9 -S rspec spec/controllers/players_controller_spec.rb 
        "server_player_id"
        NoMethodError: undefined method `each' for "server_player_id":String
        

        1.6.5:

        arturas@zeus:~/work/spacegame/server$ jruby --1.9 -S rspec spec/controllers/players_controller_spec.rb 
        ["server_player_id", "web_player_id", "version"]
        

        Array somehow gets expanded when being passed to block.

        Show
        Arturas Slajus added a comment - - edited Thats not the problem. 1.6.6: arturas@zeus:~/work/spacegame/server$ jruby --1.9 -S rspec spec/controllers/players_controller_spec.rb "server_player_id" NoMethodError: undefined method `each' for "server_player_id":String 1.6.5: arturas@zeus:~/work/spacegame/server$ jruby --1.9 -S rspec spec/controllers/players_controller_spec.rb ["server_player_id", "web_player_id", "version"] Array somehow gets expanded when being passed to block.
        Hide
        Hiro Asari added a comment -

        This looks like a duplicate of JRUBY-6366. Does RSpec 2.8 exhibit the same problem?

        Show
        Hiro Asari added a comment - This looks like a duplicate of JRUBY-6366 . Does RSpec 2.8 exhibit the same problem?
        Hide
        Arturas Slajus added a comment - - edited

        Yes it does.

        arturas@zeus:~/work/spacegame/server$ rvm use jruby-head-n166
        Using /home/arturas/.rvm/gems/jruby-head-n166
        arturas@zeus:~/work/spacegame/server$ bundle install
        ...
        Installing rspec-core (2.8.0) 
        Installing rspec-expectations (2.8.0) 
        Installing rspec-mocks (2.8.0) 
        Installing rspec (2.8.0) 
        ...
        Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
        arturas@zeus:~/work/spacegame/server$ jruby --1.9 -S rspec spec/controllers/players_controller_spec.rb 
        NoMethodError: undefined method `each' for "server_player_id":String
                         (root) at /home/arturas/work/spacegame/server/spec/shared/with_param_options.rb:2
        arturas@zeus:~/work/spacegame/server$ rspec --version
        2.8.0
        
        Show
        Arturas Slajus added a comment - - edited Yes it does. arturas@zeus:~/work/spacegame/server$ rvm use jruby-head-n166 Using /home/arturas/.rvm/gems/jruby-head-n166 arturas@zeus:~/work/spacegame/server$ bundle install ... Installing rspec-core (2.8.0) Installing rspec-expectations (2.8.0) Installing rspec-mocks (2.8.0) Installing rspec (2.8.0) ... Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. arturas@zeus:~/work/spacegame/server$ jruby --1.9 -S rspec spec/controllers/players_controller_spec.rb NoMethodError: undefined method `each' for "server_player_id":String (root) at /home/arturas/work/spacegame/server/spec/shared/with_param_options.rb:2 arturas@zeus:~/work/spacegame/server$ rspec --version 2.8.0
        Hide
        Hiro Asari added a comment -

        Can you show us a test spec, preferably one that does not involve Rails?

        Show
        Hiro Asari added a comment - Can you show us a test spec, preferably one that does not involve Rails?
        Hide
        Arturas Slajus added a comment -
        arturas@arturaz-fujitsu:~$ rvm use jruby-head-n166
        Using /home/arturas/.rvm/gems/jruby-head-n166
        arturas@arturaz-fujitsu:~$ gem install rspec
        Fetching: rspec-core-2.8.0.gem (100%)
        Fetching: diff-lcs-1.1.3.gem (100%)
        Fetching: rspec-expectations-2.8.0.gem (100%)
        Fetching: rspec-mocks-2.8.0.gem (100%)
        Fetching: rspec-2.8.0.gem (100%)
        Successfully installed rspec-core-2.8.0
        Successfully installed diff-lcs-1.1.3
        Successfully installed rspec-expectations-2.8.0
        Successfully installed rspec-mocks-2.8.0
        Successfully installed rspec-2.8.0
        5 gems installed
        arturas@arturaz-fujitsu:~$ cat test_spec.rb 
        require 'rspec'
        
        describe "test" do
          shared_examples_for "test shared" do |array|
            it "be an array" do
              puts array.inspect
              array.should be_instance_of(Array)
            end
          end
        
          it_behaves_like "test shared", [1,2,3,4]
        end
        arturas@arturaz-fujitsu:~$ jruby --1.8 -S rspec test_spec.rb 
        [1, 2, 3, 4]
        .
        
        Finished in 0.009 seconds
        1 example, 0 failures
        arturas@arturaz-fujitsu:~$ jruby --1.9 -S rspec test_spec.rb 
        1
        F
        
        Failures:
        
          1) test behaves like test shared be an array
             Failure/Error: array.should be_instance_of(Array)
               expected 1 to be an instance of Array
             Shared Example Group: "test shared" called from ./test_spec.rb:11
             # ./test_spec.rb:7:in `(root)'
        
        Finished in 0.013 seconds
        1 example, 1 failure
        
        Failed examples:
        
        rspec ./test_spec.rb:5 # test behaves like test shared be an array
        
        Show
        Arturas Slajus added a comment - arturas@arturaz-fujitsu:~$ rvm use jruby-head-n166 Using /home/arturas/.rvm/gems/jruby-head-n166 arturas@arturaz-fujitsu:~$ gem install rspec Fetching: rspec-core-2.8.0.gem (100%) Fetching: diff-lcs-1.1.3.gem (100%) Fetching: rspec-expectations-2.8.0.gem (100%) Fetching: rspec-mocks-2.8.0.gem (100%) Fetching: rspec-2.8.0.gem (100%) Successfully installed rspec-core-2.8.0 Successfully installed diff-lcs-1.1.3 Successfully installed rspec-expectations-2.8.0 Successfully installed rspec-mocks-2.8.0 Successfully installed rspec-2.8.0 5 gems installed arturas@arturaz-fujitsu:~$ cat test_spec.rb require 'rspec' describe "test" do shared_examples_for "test shared" do |array| it "be an array" do puts array.inspect array.should be_instance_of(Array) end end it_behaves_like "test shared", [1,2,3,4] end arturas@arturaz-fujitsu:~$ jruby --1.8 -S rspec test_spec.rb [1, 2, 3, 4] . Finished in 0.009 seconds 1 example, 0 failures arturas@arturaz-fujitsu:~$ jruby --1.9 -S rspec test_spec.rb 1 F Failures: 1) test behaves like test shared be an array Failure/Error: array.should be_instance_of(Array) expected 1 to be an instance of Array Shared Example Group: "test shared" called from ./test_spec.rb:11 # ./test_spec.rb:7:in `(root)' Finished in 0.013 seconds 1 example, 1 failure Failed examples: rspec ./test_spec.rb:5 # test behaves like test shared be an array
        Hide
        Hiro Asari added a comment -

        Thanks. I suspect this is a duplicate of JRUBY-6238.

        Show
        Hiro Asari added a comment - Thanks. I suspect this is a duplicate of JRUBY-6238 .
        Hide
        Hiro Asari added a comment -

        git bisect shows:

        3e25b5517747b1db03c731db12d8bfbfbb64abb0 is the first bad commit
        commit 3e25b5517747b1db03c731db12d8bfbfbb64abb0
        Author: Thomas E. Enebo <tom.enebo@gmail.com>
        Date:   Fri Dec 23 14:09:19 2011 -0600
        
            Fixes to_ary behavior of 1.9 in interp only
        
        :040000 040000 0167272bde3e35757c1d47366a7247702255637b eb9d75feb3022755192b20a9f4d6b96fc2cc196f M	src
        bisect run success
        
        Show
        Hiro Asari added a comment - git bisect shows: 3e25b5517747b1db03c731db12d8bfbfbb64abb0 is the first bad commit commit 3e25b5517747b1db03c731db12d8bfbfbb64abb0 Author: Thomas E. Enebo <tom.enebo@gmail.com> Date: Fri Dec 23 14:09:19 2011 -0600 Fixes to_ary behavior of 1.9 in interp only :040000 040000 0167272bde3e35757c1d47366a7247702255637b eb9d75feb3022755192b20a9f4d6b96fc2cc196f M src bisect run success
        Hide
        Hiro Asari added a comment -

        This is not a duplicate of JRUBY-6238.

        Show
        Hiro Asari added a comment - This is not a duplicate of JRUBY-6238 .
        Hide
        Hiro Asari added a comment -

        So, in the third chunk of the commit above seems to be the source of the problem. Removing the logical branch would fix this problem without introducing new spec failures. However, I believe the commit is a part of an effort to deal with 1.9 splat args, so I will defer to Tom for a proper fix.

        Show
        Hiro Asari added a comment - So, in the third chunk of the commit above seems to be the source of the problem. Removing the logical branch would fix this problem without introducing new spec failures. However, I believe the commit is a part of an effort to deal with 1.9 splat args, so I will defer to Tom for a proper fix.
        Hide
        Thomas E Enebo added a comment -

        Looking into this since this affects real world code and causes regression from 1.6.5.1.

        Show
        Thomas E Enebo added a comment - Looking into this since this affects real world code and causes regression from 1.6.5.1.
        Hide
        Thomas E Enebo added a comment -

        [jruby-1_6 15ebbbe], [master 469236a] for interpreter hackage. 1.7 rewrite of block paths cannot come soon enough...Can you beat on us a little more and make sure we have no more regressions? JIT fixes to come...

        Show
        Thomas E Enebo added a comment - [jruby-1_6 15ebbbe] , [master 469236a] for interpreter hackage. 1.7 rewrite of block paths cannot come soon enough...Can you beat on us a little more and make sure we have no more regressions? JIT fixes to come...
        Hide
        Charles Oliver Nutter added a comment -

        Compiler side of fix on master@fef22be and jruby-1_6@e82af9a.

        Reopen if things still look busted, or open another bug if there's a different failure. Hopefully we're good

        Show
        Charles Oliver Nutter added a comment - Compiler side of fix on master@fef22be and jruby-1_6@e82af9a. Reopen if things still look busted, or open another bug if there's a different failure. Hopefully we're good
        Hide
        Arturas Slajus added a comment -

        As far as this bug goes it seems ok right now

        Show
        Arturas Slajus added a comment - As far as this bug goes it seems ok right now

          People

          • Assignee:
            Thomas E Enebo
            Reporter:
            Arturas Slajus
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: