jarmo / RAutomation

RAutomation
MIT License
100 stars 33 forks source link

Seg Fault with windows 8.1 #80

Closed klcsig closed 10 years ago

klcsig commented 10 years ago

Using rautomation on windows 8.1, the script is failing on window.exists? with a segfault. The same script runs fine on other windows OSs .

The script is very basic

require "rautomation" require "getoptlong"

@download_location = 'c:\tmp'

begin

window = RAutomation::Window.new(:title => /File Upload/i, :adapter => :win_32)
window.exists?

window.text_field(:class => "Edit", :index => 0).set @download_location

window.send_keys(:enter)

rescue Exception => e fail "Error: Exception: #{e.message}" end

The result of running the script is

C:\mysvn\cucumber\testsFirefox\features\step_definitions>ruby clickOpen.rb C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/w in_32/functions.rb:294: [BUG] Segmentation fault ruby 1.9.3p448 (2013-06-27) [i386-mingw32]

-- Control frame information ----------------------------------------------- c:0009 p:---- s:0035 b:0035 l:000034 d:000034 CFUNC :enum_windows c:0008 p:0080 s:0030 b:0030 l:000728 d:000728 METHOD C:/Ruby193/lib/ruby/gems/1. 9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_32/functions.rb:294 c:0007 p:0013 s:0022 b:0022 l:001b60 d:001b60 METHOD C:/Ruby193/lib/ruby/gems/1. 9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_32/functions.rb:140 c:0006 p:0034 s:0018 b:0018 l:000017 d:000017 METHOD C:/Ruby193/lib/ruby/gems/1. 9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_32/window.rb:48 c:0005 p:0011 s:0015 b:0015 l:000014 d:000014 METHOD C:/Ruby193/lib/ruby/gems/1. 9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_32/window.rb:90 c:0004 p:0013 s:0011 b:0011 l:000010 d:000010 METHOD C:/Ruby193/lib/ruby/gems/1. 9.1/gems/rautomation-0.13.0/lib/rautomation/window.rb:138 c:0003 p:0074 s:0008 b:0008 l:0018e4 d:00179c EVAL clickOpen.rb:10 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:0000 s:0002 b:0002 l:0018e4 d:0018e4 TOP

-- Ruby level backtrace information ---------------------------------------- clickOpen.rb:10:in <main>' C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/window.rb :138:inexists?' C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/w in_32/window.rb:90:in exists?' C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/w in_32/window.rb:48:inhwnd' C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/w in_32/functions.rb:140:in window_hwnd' C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/w in_32/functions.rb:294:infind_hwnd' C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/w in_32/functions.rb:294:in `enum_windows'

-- C level backtrace information ------------------------------------------- C:\WINDOWS\SYSTEM32\ntdll.dll(ZwWaitForSingleObject+0xc) [0x7772bc3c] C:\WINDOWS\SYSTEM32\KERNELBASE.dll(WaitForSingleObject+0x12) [0x758110c0] C:\Ruby193\bin\msvcrt-ruby191.dll(rb_vm_bugreport+0xf9) [0x62e5bec5] C:\Ruby193\bin\msvcrt-ruby191.dll(rb_name_err_mesg_new+0x17a) [0x62d3a87a] C:\Ruby193\bin\msvcrt-ruby191.dll(rb_bug+0x2f) [0x62d3b557] C:\Ruby193\bin\msvcrt-ruby191.dll(rb_check_safe_str+0x194) [0x62dee898] [0x004011e6] C:\WINDOWS\SYSTEM32\KERNELBASE.dll(UnhandledExceptionFilter+0x142) [0x758c945d] C:\WINDOWS\SYSTEM32\ntdll.dll(LdrSetAppCompatDllRedirectionCallback+0x12a9e) [0x 777989e5]

-- Other runtime 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.

leviwilson commented 10 years ago

Try locking your Gemfile for ffi to be 1.9.0.

https://github.com/ffi/ffi/issues/302 On Nov 13, 2013 8:54 AM, "klcsig" notifications@github.com wrote:

Using rautomation on windows 8.1, the script is failing on window.exists? with a segfault. The same script runs fine on other windows OSs .

The script is very basic

require "rautomation" require "getoptlong"

@download_location = 'c:\tmp'

begin

window = RAutomation::Window.new(:title => /File Upload/i, :adapter => :win_32) window.exists?

window.text_field(:class => "Edit", :index => 0).set @download_location

window.send_keys(:enter)

rescue Exception => e fail "Error: Exception: #{e.message}" end

The result of running the script is

C:\mysvn\cucumber\testsFirefox\features\step_definitions>ruby clickOpen.rb

C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/w in_32/functions.rb:294: [BUG] Segmentation fault ruby 1.9.3p448 (2013-06-27) [i386-mingw32]

-- Control frame information

c:0009 p:---- s:0035 b:0035 l:000034 d:000034 CFUNC :enum_windows c:0008 p:0080 s:0030 b:0030 l:000728 d:000728 METHOD C:/Ruby193/lib/ruby/gems/1. 9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_32/functions.rb:294 c:0007 p:0013 s:0022 b:0022 l:001b60 d:001b60 METHOD C:/Ruby193/lib/ruby/gems/1. 9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_32/functions.rb:140 c:0006 p:0034 s:0018 b:0018 l:000017 d:000017 METHOD C:/Ruby193/lib/ruby/gems/1. 9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_32/window.rb:48 c:0005 p:0011 s:0015 b:0015 l:000014 d:000014 METHOD C:/Ruby193/lib/ruby/gems/1. 9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_32/window.rb:90 c:0004 p:0013 s:0011 b:0011 l:000010 d:000010 METHOD C:/Ruby193/lib/ruby/gems/1. 9.1/gems/rautomation-0.13.0/lib/rautomation/window.rb:138 c:0003 p:0074 s:0008 b:0008 l:0018e4 d:00179c EVAL clickOpen.rb:10 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:0000 s:0002 b:0002 l:0018e4 d:0018e4 TOP

-- Ruby level backtrace information

clickOpen.rb:10:in

'

C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/window.rb :138:inexists?'

C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/w in_32/window.rb:90:in exists?'

C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/w in_32/window.rb:48:inhwnd'

C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/w in_32/functions.rb:140:in window_hwnd'

C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/w in_32/functions.rb:294:infind_hwnd'

C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/w in_32/functions.rb:294:in `enum_windows'

-- C level backtrace information

C:\WINDOWS\SYSTEM32\ntdll.dll(ZwWaitForSingleObject+0xc) [0x7772bc3c] C:\WINDOWS\SYSTEM32\KERNELBASE.dll(WaitForSingleObject+0x12) [0x758110c0] C:\Ruby193\bin\msvcrt-ruby191.dll(rb_vm_bugreport+0xf9) [0x62e5bec5] C:\Ruby193\bin\msvcrt-ruby191.dll(rb_name_err_mesg_new+0x17a) [0x62d3a87a] C:\Ruby193\bin\msvcrt-ruby191.dll(rb_bug+0x2f) [0x62d3b557] C:\Ruby193\bin\msvcrt-ruby191.dll(rb_check_safe_str+0x194) [0x62dee898] [0x004011e6] C:\WINDOWS\SYSTEM32\KERNELBASE.dll(UnhandledExceptionFilter+0x142) [0x758c945d] C:\WINDOWS\SYSTEM32\ntdll.dll(LdrSetAppCompatDllRedirectionCallback+0x12a9e) [0x 777989e5]

-- Other runtime information

-

Loaded script: clickOpen.rb

Loaded features:

0 enumerator.so 1 C:/Ruby193/lib/ruby/1.9.1/i386-mingw32/enc/encdb.so 2 C:/Ruby193/lib/ruby/1.9.1/i386-mingw32/enc/iso_8859_1.so 3 C:/Ruby193/lib/ruby/1.9.1/i386-mingw32/enc/trans/transdb.so 4 C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/defaults.rb 5 C:/Ruby193/lib/ruby/1.9.1/i386-mingw32/rbconfig.rb 6 C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/deprecate.rb 7 C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/exceptions.rb 8 C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/defaults/operating_system.rb 9 C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb 10 C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems.rb 11 C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/version.rb 12 C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/requirement.rb 13 C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/platform.rb 14 C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb 15 C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/path_support.rb 16 C:/Ruby193/lib/ruby/1.9.1/i386-mingw32/enc/utf_16le.so 17 C:/Ruby193/lib/ruby/1.9.1/i386-mingw32/enc/trans/utf_16_32.so 18 C:/Ruby193/lib/ruby/1.9.1/i386-mingw32/enc/trans/single_byte.so 19 C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb 20 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/wai t_helper.rb 21 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/helper.rb 22 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/but ton.rb 23 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/tex t_field.rb 24 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ele ment_collections.rb 25 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/win dow.rb 26 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation.rb 27 C:/Ruby193/lib/ruby/1.9.1/getoptlong.rb 28 C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/1.9/ffi_c.so

29 C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/ffi/platform .rb 30 C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/ffi/types.rb

31 C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/ffi/library. rb 32 C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/ffi/errno.rb

33 C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/ffi/pointer. rb 34 C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/ffi/memorypo inter.rb 35 C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/ffi/struct_l ayout_builder.rb 36 C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/ffi/struct.r b 37 C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/ffi/union.rb

38 C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/ffi/manageds truct.rb 39 C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/ffi/callback .rb 40 C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/ffi/io.rb 41 C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/ffi/autopoin ter.rb 42 C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/ffi/variadic .rb 43 C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/ffi/enum.rb 44 C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/ffi/ffi.rb 45 C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/ffi.rb 46 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/win_32/constants.rb 47 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/win_32/keys.rb 48 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/win_32/functions.rb 49 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/win_32/locators.rb 50 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/win_32/window.rb 51 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/win_32/button_helper.rb 52 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/win_32/control.rb 53 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/win_32/button.rb 54 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/win_32/checkbox.rb 55 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/win_32/radio.rb 56 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/win_32/text_field.rb 57 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/win_32/select_list.rb 58 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/win_32/table.rb 59 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/win_32/label.rb 60 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/win_32/list_box.rb 61 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/win_32/mouse.rb 62 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/win_32/password_field.rb 63 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/ada pter/win_32.rb

[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.

— Reply to this email directly or view it on GitHubhttps://github.com/jarmo/RAutomation/issues/80 .

klcsig commented 10 years ago

Locking ffi to 1.9.0 worked