Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6.6
    • Fix Version/s: JRuby 1.6.7
    • Component/s: None
    • Labels:
    • Environment:
      jruby 1.6.6 (ruby-1.8.7-p357) (2012-01-30 5673572) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_26) [Windows 7-amd64-java]
    • Number of attachments :
      0

      Description

      Childprocess 0.3.1 breaks when calling _get_osfhandle with the following message:
      TypeError: unable to resolve type 'intptr_t'
      See stack trace below.

      Gems used:
      selenium-webdriver 2.18.0 (or 2.19.0)
      capybara 1.1.2
      childprocess 0.3.1

      irb(main):001:0> require 'rubygems'
      => true
      irb(main):002:0> require 'capybara'
      => true
      irb(main):003:0> require 'capybara/dsl'
      => true
      irb(main):004:0> Capybara.run_server = false
      => false
      irb(main):005:0> Capybara.current_driver = :selenium
      => :selenium
      irb(main):007:0> include Capybara::DSL
      => Object
      irb(main):008:0> visit 'http://google.com'
      TypeError: unable to resolve type 'intptr_t'
              from f:/dev/jruby-1.6.6/lib/ruby/site_ruby/shared/ffi/types.rb:56:in `find_type'
              from f:/dev/jruby-1.6.6/lib/ruby/site_ruby/shared/ffi/library.rb:329:in `find_type'
              from f:/dev/jruby-1.6.6/lib/ruby/site_ruby/shared/ffi/library.rb:158:in `attach_function'
              from org/jruby/RubyArray.java:1614:in `each'
              from f:/dev/jruby-1.6.6/lib/ruby/site_ruby/shared/ffi/library.rb:150:in `attach_function'
              from f:/dev/jruby-1.6.6/lib/ruby/gems/1.8/gems/childprocess-0.3.1/lib/childprocess/windows/lib.rb:146:in `Lib'
              from f:/dev/jruby-1.6.6/lib/ruby/gems/1.8/gems/childprocess-0.3.1/lib/childprocess/windows/lib.rb:29:in `Windows'
              from f:/dev/jruby-1.6.6/lib/ruby/gems/1.8/gems/childprocess-0.3.1/lib/childprocess/windows/lib.rb:2:in `ChildProcess'
              from f:/dev/jruby-1.6.6/lib/ruby/gems/1.8/gems/childprocess-0.3.1/lib/childprocess/windows/lib.rb:1:in `(root)'
              from org/jruby/RubyKernel.java:1027:in `require'
              from f:/dev/jruby-1.6.6/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
              from f:/dev/jruby-1.6.6/lib/ruby/gems/1.8/gems/childprocess-0.3.1/lib/childprocess/windows/lib.rb:28:in `(root)'
              from f:/dev/jruby-1.6.6/lib/ruby/gems/1.8/gems/childprocess-0.3.1/lib/childprocess/windows.rb:23:in `new'
              from f:/dev/jruby-1.6.6/lib/ruby/gems/1.8/gems/selenium-webdriver-2.18.0/lib/selenium/webdriver/firefox/binary.rb:50:in `execute'
              from f:/dev/jruby-1.6.6/lib/ruby/gems/1.8/gems/selenium-webdriver-2.18.0/lib/selenium/webdriver/firefox/binary.rb:30:in `start_with'
              from f:/dev/jruby-1.6.6/lib/ruby/gems/1.8/gems/selenium-webdriver-2.18.0/lib/selenium/webdriver/firefox/launcher.rb:68:in `start_silent_and_wait'
      ... 6 levels...
              from f:/dev/jruby-1.6.6/lib/ruby/gems/1.8/gems/capybara-1.1.2/lib/capybara/selenium/driver.rb:15:in `browser'
              from f:/dev/jruby-1.6.6/lib/ruby/gems/1.8/gems/capybara-1.1.2/lib/capybara/selenium/driver.rb:36:in `visit'
              from f:/dev/jruby-1.6.6/lib/ruby/gems/1.8/gems/capybara-1.1.2/lib/capybara/session.rb:157:in `visit'
              from f:/dev/jruby-1.6.6/lib/ruby/gems/1.8/gems/capybara-1.1.2/lib/capybara/dsl.rb:165:in `visit'
              from (irb):8:in `evaluate'
              from org/jruby/RubyKernel.java:1077:in `eval'
              from f:/dev/jruby-1.6.6/lib/ruby/1.8/irb.rb:158:in `eval_input'
              from f:/dev/jruby-1.6.6/lib/ruby/1.8/irb.rb:271:in `signal_status'
              from f:/dev/jruby-1.6.6/lib/ruby/1.8/irb.rb:155:in `eval_input'
              from org/jruby/RubyKernel.java:1408:in `loop'
              from org/jruby/RubyKernel.java:1181:in `catch'
              from f:/dev/jruby-1.6.6/lib/ruby/1.8/irb.rb:154:in `eval_input'
              from f:/dev/jruby-1.6.6/lib/ruby/1.8/irb.rb:71:in `start'
              from org/jruby/RubyKernel.java:1181:in `catch'
              from f:/dev/jruby-1.6.6/lib/ruby/1.8/irb.rb:70:in `start'
      

      I think the following change in childprocess causes this to happen: https://github.com/jarib/childprocess/commit/701f486a816992a43739ac0244f487e796c0ec99

        Activity

        Hide
        Zoltan Szugyi added a comment -

        If I do the following, the error above doesn't happen anymore:

        require 'ffi'
        FFI::typedef(:int, :intptr_t) # or :long if running Win32
        
        irb(main):009:0> FFI::TypeDefs.keys
        => [:void, :bool, :string, :char, :uchar, :short, :ushort, :int, :uint, :long, :ulong, :long_long, :ulong_long, :float, :double, :pointer, :int8, :uint8, :int16, :uint16, :int32, :uint32, :int64, :uint64, :buffer_in, :buffer_out, :buffer_inout, :varargs, FFI::StrPtrConverter, :strptr, :intptr_t]
        

        My guess is that there's an error somewhere around line 152-160 in lib/ruby/shared/ffi/types.rb so the platform-specific mappings are not loaded

        Show
        Zoltan Szugyi added a comment - If I do the following, the error above doesn't happen anymore: require 'ffi' FFI::typedef(:int, :intptr_t) # or :long if running Win32 irb(main):009:0> FFI::TypeDefs.keys => [:void, :bool, :string, :char, :uchar, :short, :ushort, :int, :uint, :long, :ulong, :long_long, :ulong_long, :float, :double, :pointer, :int8, :uint8, :int16, :uint16, :int32, :uint32, :int64, :uint64, :buffer_in, :buffer_out, :buffer_inout, :varargs, FFI::StrPtrConverter, :strptr, :intptr_t] My guess is that there's an error somewhere around line 152-160 in lib/ruby/shared/ffi/types.rb so the platform-specific mappings are not loaded
        Hide
        Zoltan Szugyi added a comment -

        Added a "puts err" to types.rb:

        irb(main):001:0> require 'ffi'
        No such file or directory - f:/dev/jruby-1.6.6/lib/ruby/site_ruby/shared/ffi/platform/x86_64-windows/types.conf
        => true
        
        $ ls /f/dev/jruby-1.6.6/lib/ruby/site_ruby/shared/ffi/platform
        errno.rb.ffi  i386-darwin   i386-solaris  powerpc-darwin  sparc-solaris    sysconf.rb.ffi  x86_64-linux    zlib.rb.ffi
        etc.rb.ffi    i386-linux    i386-windows  ppc-darwin      sparcv9-solaris  syslog.rb.ffi   x86_64-openbsd
        fcntl.rb.ffi  i386-openbsd  powerpc-aix   socket.rb.ffi   stat.rb.ffi      x86_64-darwin   x86_64-solaris
        

        Looks like the x86_64-windows directory is missing from the installation. Not sure why.

        Show
        Zoltan Szugyi added a comment - Added a "puts err" to types.rb: irb(main):001:0> require 'ffi' No such file or directory - f:/dev/jruby-1.6.6/lib/ruby/site_ruby/shared/ffi/platform/x86_64-windows/types.conf => true $ ls /f/dev/jruby-1.6.6/lib/ruby/site_ruby/shared/ffi/platform errno.rb.ffi i386-darwin i386-solaris powerpc-darwin sparc-solaris sysconf.rb.ffi x86_64-linux zlib.rb.ffi etc.rb.ffi i386-linux i386-windows ppc-darwin sparcv9-solaris syslog.rb.ffi x86_64-openbsd fcntl.rb.ffi i386-openbsd powerpc-aix socket.rb.ffi stat.rb.ffi x86_64-darwin x86_64-solaris Looks like the x86_64-windows directory is missing from the installation. Not sure why.
        Hide
        Zoltan Szugyi added a comment -

        Nevermind, just noticed that x86_64 is fairly new, that's why it's not part of jruby 1.6.6.

        Show
        Zoltan Szugyi added a comment - Nevermind, just noticed that x86_64 is fairly new, that's why it's not part of jruby 1.6.6.
        Hide
        Wayne Meissner added a comment -

        You can just copy the x86_64-windows dir to the same place in 1.6.6, and use it. Make sure you update to at least e7430fe76a4fcd4f1c1fd88e4aae440aa26c2bd0 though, since the previous version was incorrectly generated.

        Show
        Wayne Meissner added a comment - You can just copy the x86_64-windows dir to the same place in 1.6.6, and use it. Make sure you update to at least e7430fe76a4fcd4f1c1fd88e4aae440aa26c2bd0 though, since the previous version was incorrectly generated.
        Hide
        Charles Oliver Nutter added a comment -

        Sounds like this is fixed for 1.6.7.

        Show
        Charles Oliver Nutter added a comment - Sounds like this is fixed for 1.6.7.

          People

          • Assignee:
            Wayne Meissner
            Reporter:
            Zoltan Szugyi
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: