JRuby

gem install activerecord-jdbc-adapter hangs while installing ri doc on clean svn co and build of JRuby r5607

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.1RC1
  • Fix Version/s: JRuby 1.1RC2
  • Component/s: None
  • Labels:
    None
  • Environment:
    MacOS 10.4.11, JRuby trunk, r5607
  • Number of attachments :
    0

Description

I created a clean svn co and ant build of Jruby trunk.
Didn't install anything. Set JRUBY_HOME and prefixed existing PATH with $JRUBY_HOME/bin.

$ which gem
/Users/stephen/dev/jruby_start/bin/gem
$ gem install activerecord-jdbc-adapter
Bulk updating Gem source index for: http://gems.rubyforge.org
Successfully installed activerecord-jdbc-adapter-0.7.1
1 gem installed
Installing ri documentation for activerecord-jdbc-adapter-0.7.1...

... hangs at this point  ...

The same thing happens when doing a gem install from a local gem file created while building and testing my local working copy of activerecord-jdbc.

Tried installing rails – everything works.

Activity

Hide
Stephen Bannasch added a comment -

The regression happened in r5537.

Following along from the test above this worked:

$ gem uninstall activerecord-jdbc-adapter; svn up -r 5536; ant clean; ant; gem install activerecord-jdbc-adapter

While this hung installing the ri doc:

$ gem uninstall activerecord-jdbc-adapter; svn up -r 5537; ant clean; ant; gem install activerecord-jdbc-adapter
Show
Stephen Bannasch added a comment - The regression happened in r5537. Following along from the test above this worked:
$ gem uninstall activerecord-jdbc-adapter; svn up -r 5536; ant clean; ant; gem install activerecord-jdbc-adapter
While this hung installing the ri doc:
$ gem uninstall activerecord-jdbc-adapter; svn up -r 5537; ant clean; ant; gem install activerecord-jdbc-adapter
Hide
Stephen Bannasch added a comment -

Evidently adding java to the platforms fu_windows? (in fileutils.rb) checks for causes the problem.

See: JRUBY-1928 for the reason this was added back in r5537.

I suspect that the problem interaction can be traced to:

  • lib/ruby/1.8/rdoc/ri/ri_writer.rb

Which has the only two locations in all of rdoc which calls anything in Fileutils:

  • FileUtils.rm_rf
  • FileUtils.mkdir_p

But ... I couldn't get them to fail with r5537 applied.AND this problem only happens to me so far installing the activerecord-jdbc-adapter gem – not for example when installing rails – very strange ...

I don't know how to get a stack trace

Reverting the addition of "java" in the RUBY_PLATFORM check solved the problem.

changeset 5537: http://svn.jruby.codehaus.org/changelog/jruby/?cs=5537

My changeset that fixes the problem (for me):

Index: lib/ruby/1.8/fileutils.rb
===================================================================
--- lib/ruby/1.8/fileutils.rb   (revision 5607)
+++ lib/ruby/1.8/fileutils.rb   (working copy)
@@ -1047,7 +1047,7 @@
     private
 
     def fu_windows?
-      /mswin|mingw|bccwin|wince|emx|java/ =~ RUBY_PLATFORM
+      /mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM
     end
 
     def fu_copy_stream0(src, dest, blksize)   #:nodoc:
Show
Stephen Bannasch added a comment - Evidently adding java to the platforms fu_windows? (in fileutils.rb) checks for causes the problem. See: JRUBY-1928 for the reason this was added back in r5537. I suspect that the problem interaction can be traced to:
  • lib/ruby/1.8/rdoc/ri/ri_writer.rb
Which has the only two locations in all of rdoc which calls anything in Fileutils:
  • FileUtils.rm_rf
  • FileUtils.mkdir_p
But ... I couldn't get them to fail with r5537 applied.AND this problem only happens to me so far installing the activerecord-jdbc-adapter gem – not for example when installing rails – very strange ... I don't know how to get a stack trace Reverting the addition of "java" in the RUBY_PLATFORM check solved the problem. changeset 5537: http://svn.jruby.codehaus.org/changelog/jruby/?cs=5537 My changeset that fixes the problem (for me):
Index: lib/ruby/1.8/fileutils.rb
===================================================================
--- lib/ruby/1.8/fileutils.rb   (revision 5607)
+++ lib/ruby/1.8/fileutils.rb   (working copy)
@@ -1047,7 +1047,7 @@
     private
 
     def fu_windows?
-      /mswin|mingw|bccwin|wince|emx|java/ =~ RUBY_PLATFORM
+      /mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM
     end
 
     def fu_copy_stream0(src, dest, blksize)   #:nodoc:
Hide
Stephen Bannasch added a comment -

adding: puts caller to fu_windows? displays a whole bunch of this:

/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1303:in `platform_support'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1297:in `remove_file'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1297:in `remove'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:756:in `remove_entry'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:754:in `postorder_traverse'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1335:in `each'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1172:in `postorder_traverse'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1335:in `each'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1172:in `postorder_traverse'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1335:in `remove_entry'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:754:in `rm_r'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:608:in `each'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:608:in `rm_r'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:608:in `rm_rf'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb:87:in `install_ri'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb:39:in `generate_ri'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:103:in `execute'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:102:in `each'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:102:in `execute'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:102:in `invoke'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:104:in `process_args'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:74:in `run'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:39:in `run'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:69
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1303:in `platform_support'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1291:in `remove_dir1'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1291:in `remove'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:756:in `remove_entry'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:754:in `postorder_traverse'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1335:in `each'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1172:in `postorder_traverse'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1335:in `remove_entry'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:754:in `rm_r'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:608:in `each'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:608:in `rm_r'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:608:in `rm_rf'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb:87:in `install_ri'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb:39:in `generate_ri'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:103:in `execute'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:102:in `each'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:102:in `execute'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:102:in `invoke'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:104:in `process_args'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:74:in `run'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:39:in `run'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:69
Show
Stephen Bannasch added a comment - adding: puts caller to fu_windows? displays a whole bunch of this:
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1303:in `platform_support'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1297:in `remove_file'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1297:in `remove'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:756:in `remove_entry'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:754:in `postorder_traverse'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1335:in `each'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1172:in `postorder_traverse'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1335:in `each'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1172:in `postorder_traverse'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1335:in `remove_entry'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:754:in `rm_r'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:608:in `each'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:608:in `rm_r'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:608:in `rm_rf'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb:87:in `install_ri'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb:39:in `generate_ri'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:103:in `execute'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:102:in `each'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:102:in `execute'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:102:in `invoke'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:104:in `process_args'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:74:in `run'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:39:in `run'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:69
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1303:in `platform_support'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1291:in `remove_dir1'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1291:in `remove'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:756:in `remove_entry'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:754:in `postorder_traverse'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1335:in `each'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1172:in `postorder_traverse'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1335:in `remove_entry'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:754:in `rm_r'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:608:in `each'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:608:in `rm_r'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:608:in `rm_rf'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb:87:in `install_ri'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb:39:in `generate_ri'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:103:in `execute'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:102:in `each'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:102:in `execute'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:102:in `invoke'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:104:in `process_args'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:74:in `run'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:39:in `run'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:69
Hide
Stephen Bannasch added a comment -

adding a delimiter might help:

With r5537 in place and this advanced forensic tool embedded in fu_windows?:

puts "-"*10
puts caller

results in 149 of these and this is the final one where the process hangs:
(code)
----------
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1308:in `platform_support'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1296:in `remove_dir1'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1296:in `remove'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:758:in `remove_entry'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:756:in `postorder_traverse'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1340:in `remove_entry'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:756:in `rm_r'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:610:in `each'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:610:in `rm_r'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:610:in `rm_rf'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/rdoc/ri/ri_writer.rb:29:in `remove_class'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/rdoc/generators/ri_generator.rb:257:in `update_or_replace'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/rdoc/generators/ri_generator.rb:130:in `generate_class_info'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/rdoc/generators/ri_generator.rb:126:in `process_class'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/rdoc/generators/ri_generator.rb:85:in `generate'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/rdoc/generators/ri_generator.rb:84:in `each'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/rdoc/generators/ri_generator.rb:84:in `generate'
/Users/stephen/dev/jruby_start/lib/ruby/1.8/rdoc/generators/ri_generator.rb:84:in `document'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb:106:in `run_rdoc'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb:90:in `install_ri'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb:39:in `generate_ri'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:103:in `execute'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:102:in `each'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:102:in `execute'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:102:in `invoke'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:104:in `process_args'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:74:in `run'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:39:in `run'
/Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:69
(code)

Show
Stephen Bannasch added a comment - adding a delimiter might help: With r5537 in place and this advanced forensic tool embedded in fu_windows?:
puts "-"*10
puts caller
results in 149 of these and this is the final one where the process hangs: (code) ---------- /Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1308:in `platform_support' /Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1296:in `remove_dir1' /Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1296:in `remove' /Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:758:in `remove_entry' /Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:756:in `postorder_traverse' /Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:1340:in `remove_entry' /Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:756:in `rm_r' /Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:610:in `each' /Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:610:in `rm_r' /Users/stephen/dev/jruby_start/lib/ruby/1.8/fileutils.rb:610:in `rm_rf' /Users/stephen/dev/jruby_start/lib/ruby/1.8/rdoc/ri/ri_writer.rb:29:in `remove_class' /Users/stephen/dev/jruby_start/lib/ruby/1.8/rdoc/generators/ri_generator.rb:257:in `update_or_replace' /Users/stephen/dev/jruby_start/lib/ruby/1.8/rdoc/generators/ri_generator.rb:130:in `generate_class_info' /Users/stephen/dev/jruby_start/lib/ruby/1.8/rdoc/generators/ri_generator.rb:126:in `process_class' /Users/stephen/dev/jruby_start/lib/ruby/1.8/rdoc/generators/ri_generator.rb:85:in `generate' /Users/stephen/dev/jruby_start/lib/ruby/1.8/rdoc/generators/ri_generator.rb:84:in `each' /Users/stephen/dev/jruby_start/lib/ruby/1.8/rdoc/generators/ri_generator.rb:84:in `generate' /Users/stephen/dev/jruby_start/lib/ruby/1.8/rdoc/generators/ri_generator.rb:84:in `document' /Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb:106:in `run_rdoc' /Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb:90:in `install_ri' /Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/doc_manager.rb:39:in `generate_ri' /Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:103:in `execute' /Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:102:in `each' /Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:102:in `execute' /Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:102:in `invoke' /Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:104:in `process_args' /Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:74:in `run' /Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:39:in `run' /Users/stephen/dev/jruby_start/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:69 (code)
Hide
Charles Oliver Nutter added a comment -

It turns out this is a problem in fileutils.rb, in platform_support:

def platform_support
      return yield unless fu_windows?
      first_time_p = true
      begin
        yield
      rescue Errno::ENOENT
        raise
      rescue => err
        if first_time_p
          first_time_p = false
          begin
            File.chmod 0700, path()   # Windows does not have symlink
            retry
          rescue SystemCallError
          end
        end
        raise err
      end
    end

retry behavior seems to be broken in the compiler, and it's retrying the wrong section. Here's a reduced case:

begin
  puts 'here'
  raise
rescue
  begin
    puts 'there'
    retry
  rescue
  end
end

The retry in this case should go back to the top of the outer begin/rescue, causing the output to alternate between 'here' and 'there'. In the interpreter it works correctly. In the compiled version, it only prints out 'there'. So retry is broken in the compiler.

Updating to blocker for RC2.

Show
Charles Oliver Nutter added a comment - It turns out this is a problem in fileutils.rb, in platform_support:
def platform_support
      return yield unless fu_windows?
      first_time_p = true
      begin
        yield
      rescue Errno::ENOENT
        raise
      rescue => err
        if first_time_p
          first_time_p = false
          begin
            File.chmod 0700, path()   # Windows does not have symlink
            retry
          rescue SystemCallError
          end
        end
        raise err
      end
    end
retry behavior seems to be broken in the compiler, and it's retrying the wrong section. Here's a reduced case:
begin
  puts 'here'
  raise
rescue
  begin
    puts 'there'
    retry
  rescue
  end
end
The retry in this case should go back to the top of the outer begin/rescue, causing the output to alternate between 'here' and 'there'. In the interpreter it works correctly. In the compiled version, it only prints out 'there'. So retry is broken in the compiler. Updating to blocker for RC2.
Hide
Stephen Bannasch added a comment -

Turn off compilation as a workaround if you've got this problem:

jruby -X-C -S gem install ...
Show
Stephen Bannasch added a comment - Turn off compilation as a workaround if you've got this problem:
jruby -X-C -S gem install ...
Hide
Charles Oliver Nutter added a comment -

Fixed in 5611. I updated the existing retry-in-rescue rubyspec to cover this case as well.

Show
Charles Oliver Nutter added a comment - Fixed in 5611. I updated the existing retry-in-rescue rubyspec to cover this case as well.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: