Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Msuia: Segmentation fault when value_control #99

Closed
markhumphreysjhc opened this issue Mar 19, 2015 · 3 comments
Closed

Msuia: Segmentation fault when value_control #99

markhumphreysjhc opened this issue Mar 19, 2015 · 3 comments

Comments

@markhumphreysjhc
Copy link

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

  • Loaded script: test.rb

Is there anymore information that I can add ?

Thanks

Mark H

@leviwilson
Copy link
Collaborator

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
Copy link
Owner

jarmo commented Mar 19, 2015

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
Copy link
Owner

jarmo commented Jan 9, 2016

Closing this due to inactivity.

@jarmo jarmo closed this as completed Jan 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants