jarmo / RAutomation

RAutomation
MIT License
100 stars 33 forks source link

Msuia: Segmentation fault when value_control #99

Closed markhumphreysjhc closed 8 years ago

markhumphreysjhc commented 9 years ago

I have created a very simple test application (in Delphi XE5 in case that makes a difference somehow), and am trying to get to the values in a Edit box on the main window. When I run the tests (as noted below) I get a segmentation fault.

system 'start "" "Project2.exe" ' sleep 3

window = RAutomation::Window.new(:title => /System Security/i, :adapter => :ms_uia)

puts "text_fields Values" window.text_fields.each {|field| puts field.value}

xtest_field0 = window.value_control(:id => "Edit1") xtest_field1 = window.value_control(:id => "edtPassword")

puts xtest_field0.exists? puts xtest_field1.exists?

puts xtest_field0 puts xtest_field0.value << SEGMENTATION FAULT HERE

xtest_field0.set "MHDEV1" puts xtest_field0.value

_uia/uia_dll.rb:414: [BUG] Segmentation fault ruby 2.1.5p273 (2014-11-13 revision 48405) [i386-mingw32]

-- Control frame information ----------------------------------------------- c:0006 p:---- s:0027 e:000026 CFUNC :Control_GetValue c:0005 p:0040 s:0021 e:000020 METHOD C:/Ruby21/lib/ruby/gems/2.1.0/gems/rautomat ion-0.17.0/lib/rautomation/adapter/ms_uia/uia_dll.rb:414 c:0004 p:0011 s:0015 e:000014 METHOD C:/Ruby21/lib/ruby/gems/2.1.0/gems/rautomat ion-0.17.0/lib/rautomation/adapter/ms_uia/uia_dll.rb:152 c:0003 p:0016 s:0011 e:000010 METHOD C:/Ruby21/lib/ruby/gems/2.1.0/gems/rautomat ion-0.17.0/lib/rautomation/adapter/ms_uia/value_control.rb:9 c:0002 p:0176 s:0008 E:000cb8 EVAL test.rb:80 [FINISH] c:0001 p:0000 s:0002 E:000e84 TOP [FINISH]

test.rb:80:in <main>' C:/Ruby21/lib/ruby/gems/2.1.0/gems/rautomation-0.17.0/lib/rautomation/adapter/ms _uia/value_control.rb:9:invalue' C:/Ruby21/lib/ruby/gems/2.1.0/gems/rautomation-0.17.0/lib/rautomation/adapter/ms _uia/uia_dll.rb:152:in get_control_value' C:/Ruby21/lib/ruby/gems/2.1.0/gems/rautomation-0.17.0/lib/rautomation/adapter/ms _uia/uia_dll.rb:414:instring_from' C:/Ruby21/lib/ruby/gems/2.1.0/gems/rautomation-0.17.0/lib/rautomation/adapter/ms _uia/uia_dll.rb:414:in `Control_GetValue'

-- C level backtrace information ------------------------------------------- C:\WINDOWS\SYSTEM32\ntdll.dll(NtWaitForSingleObject+0xc) [0x777FC67C] C:\WINDOWS\SYSTEM32\KERNELBASE.dll(WaitForSingleObject+0x12) [0x75FD2C02] C:\Ruby21\bin\msvcrt-ruby210.dll(rb_vm_bugreport+0xa7) [0x6D394A17] C:\Ruby21\bin\msvcrt-ruby210.dll(rb_name_err_mesg_new+0x69f) [0x6D248F7F] C:\Ruby21\bin\msvcrt-ruby210.dll(rb_bug+0x2e) [0x6D249D5E] C:\Ruby21\bin\msvcrt-ruby210.dll(rb_check_safe_str+0x34b) [0x6D31486B] [0x00401866] C:\WINDOWS\SYSTEM32\KERNELBASE.dll(UnhandledExceptionFilter+0x165) [0x7608F675] C:\WINDOWS\SYSTEM32\ntdll.dll(LdrSetAppCompatDllRedirectionCallback+0x12a0d) [0x 7786F3AD]

-- Other runtime information -----------------------------------------------

Is there anymore information that I can add ?

Thanks

Mark H

leviwilson commented 9 years ago

This is probably due to your version of the ffi gem. This issue has popped up from time to time. Try the suggestion here and let me know if that gets you past your issue.

jarmo commented 9 years ago

Can't be that exact reason, because rautomation-0.17.0 is used which means that he should be using ffi ~> 1.9.0. Although, maybe 1.9.0 has problems with Ruby 2.1.5.

What version of ffi are you actually using?

jarmo commented 8 years ago

Closing this due to inactivity.