jarmo / RAutomation

RAutomation
MIT License
100 stars 33 forks source link

Segmentation Fault in functions.rb:317 #31

Closed fauziaabbasi closed 12 years ago

fauziaabbasi commented 12 years ago

I have a Windows Security box open and am trying to access it via rautomation. I can get the handle for the box, but when I run any rautomation feature, it gives me segmentation fault. Here is my script:

require 'watir' require 'rautomation'

ww = RAutomation::Window.new(:title=>"Windows Security") ww.exists?

here is the error: C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/functions.rb:317: [BUG] Segmentation fault ruby 1.9.3p194 (2012-04-20) [i386-mingw32]

-- Control frame information ----------------------------------------------- c:0009 p:---- s:0034 b:0034 l:000033 d:000033 CFUNC :enum_windows c:0008 p:0080 s:0029 b:0029 l:001a98 d:001a98 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/functions.rb:317 c:0007 p:0013 s:0021 b:0021 l:000e80 d:000e80 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/functions.rb:141 c:0006 p:0034 s:0017 b:0017 l:000016 d:000016 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/window.rb:48 c:0005 p:0011 s:0014 b:0014 l:000013 d:000013 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/window.rb:90 c:0004 p:0013 s:0010 b:0010 l:000009 d:000009 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/window.rb:138 c:0003 p:0073 s:0007 b:0007 l:00044c d:001638 EVAL C:/Devkit/secondtest.rb:13 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:0000 s:0002 b:0002 l:00044c d:00044c TOP

-- Ruby level backtrace information ---------------------------------------- C:/Devkit/secondtest.rb:13:in <main>' C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/window.rb:138:inexists?' C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/window.rb:90:in exists?' C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/window.rb:48:inhwnd' C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/functions.rb:141:in window_hwnd' C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/functions.rb:317:infind_hwnd' C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/functions.rb:317:in `enum_windows'

Running it on Windows 7 with ffi (1.1.0), rautomation(0.7.2), ruby (0.9.9) and watir (3.0.0)

hmcgowan commented 12 years ago

Hi Jarmo,

We just saw this too and I think it might have been related to an FFI version. Let me know if you need help reproducing it and I can get the details for you.

jarmo commented 12 years ago

This is caused by this (https://github.com/ffi/ffi/issues/213) and fixed in ffi version 1.1.3.