wuhlcom
wuhlcom

Reputation: 119

Use Watir::Browse.new open the Firefox appears Segmentation fault Error

My setup:windows 7 ,ruby 1.9.3
I have tried this on four PCs(windows 7),only one is normal
I have tried ruby 2.1.6,it also appears
I have tried the 0.7.0 version of watir-driver,no use!

* LOCAL GEMS *

bigdecimal (1.1.0)
childprocess (0.5.6)
ffi (1.9.9 x86-mingw32)
io-console (0.3)
json (1.5.5)
minitest (2.5.1)
multi_json (1.11.1)
rake (0.9.2.2)
rdoc (3.9.5)
rubyzip (1.1.7)
selenium-webdriver (2.46.2)
watir-webdriver (0.8.0)
websocket (1.2.2)

the code:

1 require 'watir-webdriver'
2 browser = Watir::Browser.new
3 browser.go_to "https://www.baidu.com"
4 browser.close

Error info:there is part of the error info

    C:\Ruby193\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) E:/Automation/Automation/watir_test/web_test1.rb
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.5.6/lib/childprocess/windows/lib.rb:311: [BUG] Segmentation fault
    ruby 1.9.3p551 (2014-11-13) [i386-mingw32]

    -- Control frame information -----------------------------------------------
    c:0022 p:---- s:0087 b:0087 l:000086 d:000086 CFUNC  :get_osfhandle
    c:0021 p:0122 s:0083 b:0083 l:000082 d:000082 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.5.6/lib/childprocess/windows/lib.rb:311
    c:0020 p:0066 s:0077 b:0076 l:000075 d:000075 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.5.6/lib/childprocess/windows/lib.rb:270
    c:0019 p:0213 s:0072 b:0072 l:000071 d:000071 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.5.6/lib/childprocess.rb:153
    c:0018 p:0054 s:0067 b:0067 l:000066 d:000066 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/common/socket_lock.rb:64
    c:0017 p:0051 s:0063 b:0063 l:000062 d:000062 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/common/socket_lock.rb:49
    c:0016 p:0011 s:0059 b:0059 l:000058 d:000058 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/common/socket_lock.rb:35
    c:0015 p:0017 s:0055 b:0055 l:001c9c d:001c9c METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/firefox/launcher.rb:51
    c:0014 p:0175 s:0052 b:0052 l:000051 d:000051 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/firefox/bridge.rb:41
    c:0013 p:---- s:0042 b:0042 l:000041 d:000041 FINISH
    c:0012 p:---- s:0040 b:0040 l:000039 d:000039 CFUNC  :new
    c:0011 p:0200 s:0036 b:0036 l:000035 d:000035 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/common/driver.rb:50
    c:0010 p:0021 s:0029 b:0029 l:000028 d:000028 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver.rb:84
    c:0009 p:0129 s:0025 b:0025 l:000024 d:000024 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.8.0/lib/watir-webdriver/browser.rb:45
    c:0008 p:---- s:0020 b:0020 l:000019 d:000019 FINISH
    c:0007 p:---- s:0018 b:0018 l:000017 d:000017 CFUNC  :new
    c:0006 p:0029 s:0015 b:0015 l:000014 d:000014 TOP    E:/Automation/Automation/watir_test/web_test1.rb:4
    c:0005 p:---- s:0012 b:0012 l:000011 d:000011 FINISH
    c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC  :load
    c:0003 p:0051 s:0006 b:0006 l:000abc d:001d64 EVAL   -e:1
    c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
    c:0001 p:0000 s:0002 b:0002 l:000abc d:000abc TOP   

    -- Ruby level backtrace information ----------------------------------------
    -e:1:in `<main>'
    -e:1:in `load'
    E:/Automation/Automation/watir_test/web_test1.rb:4:in `<top (required)>'
    E:/Automation/Automation/watir_test/web_test1.rb:4:in `new'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.8.0/lib/watir-webdriver/browser.rb:45:in `initialize'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver.rb:84:in `for'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/common/driver.rb:50:in `for'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/common/driver.rb:50:in `new'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/firefox/bridge.rb:41:in `initialize'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/firefox/launcher.rb:51:in `launch'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/common/socket_lock.rb:35:in `locked'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/common/socket_lock.rb:49:in `lock'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/common/socket_lock.rb:64:in `can_lock?'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.5.6/lib/childprocess.rb:153:in `close_on_exec'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.5.6/lib/childprocess/windows/lib.rb:270:in `dont_inherit'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.5.6/lib/childprocess/windows/lib.rb:311:in `handle_for'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.5.6/lib/childprocess/windows/lib.rb:311:in `get_osfhandle'

    -- C level backtrace information -------------------------------------------
 .
 .
 .
 .
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html


This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Upvotes: 0

Views: 162

Answers (1)

TheHatz
TheHatz

Reputation: 11

I believe I can be of assistance. I was experiencing this exact issue. The issue is with the latest version of the ffi gem. I was able to force the version of ffi to be 1.9.8. This corrected my issue. The issue with ffi has been reported. You can follow along here: https://github.com/ffi/ffi/issues/440

Upvotes: 1

Related Questions