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
What Ruby version or gems is required for Uia work? #14
Comments
I'm wondering if it's the unicode characters
…On Sun, Aug 5, 2018, 11:51 AM Leonid Vlasov ***@***.***> wrote:
Hi! Great work. I'm playing with Uia but i have got "Segmentation fault":
C:/msys64/mingw32/lib/ruby/gems/2.5.0/gems/uia-0.6/lib/uia/library/win32.rb:31: [BUG] Segmentation fault
ruby 2.5.1p57 (2018-03-29 revision 63029) [i386-mingw32]
-- Control frame information -----------------------------------------------
c:0033 p:---- s:0176 e:000175 CFUNC :enum_child_windows
c:0032 p:0039 s:0169 E:001da0 METHOD C:/msys64/mingw32/lib/ruby/gems/2.5.0/gems/uia-0.6/lib/uia/library/win32.rb:31
c:0031 p:0016 s:0161 E:0002dc METHOD C:/msys64/mingw32/lib/ruby/gems/2.5.0/gems/uia-0.6/lib/uia/finder.rb:80
c:0030 p:0159 s:0154 e:000153 METHOD C:/msys64/mingw32/lib/ruby/gems/2.5.0/gems/uia-0.6/lib/uia/finder.rb:25
c:0029 p:0006 s:0149 e:000148 METHOD C:/msys64/mingw32/lib/ruby/gems/2.5.0/gems/uia-0.6/lib/uia.rb:20
c:0028 p:0013 s:0144 e:000143 BLOCK test/test_helper.rb:12 [FINISH]
c:0027 p:0035 s:0141 e:000140 METHOD test/test_helper.rb:22
c:0026 p:0023 s:0133 E:002180 METHOD test/test_helper.rb:12
c:0025 p:0005 s:0129 e:000128 BLOCK test/test_helper.rb:35 [FINISH]
Failure rises while find application window:
def run_app
@app = ChildProcess.build('notepad').start--> wait_until { Uia.find_element title: /блокнот/i }
@app
end
Gems:
ffi (1.9.25 x86-mingw32)
uia (0.6)
Thanks.
Leonid.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#14>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAjD4uQzT9w0GcxwRjYTvl3m68axUQrMks5uNxSLgaJpZM4Vvbf2>
.
|
I will try to take a look later on this afternoon and see if I can see what might be going on. It's been a while since I have maintained this gem but what you are trying should absolutely work. |
Unicode does not matter. I call def run_app
@app = ChildProcess.build(PATH).start
wait_until { Uia.find_element title: /MainFormWindow/i }
@app
end but fault appears also. I suppose it's ffi bug. I've replaced callback pointer to zero and "segmentation fault" error doesn't appear, but uia doesn't work too (: def find_window(parent, &block)
found_window = nil
window_callback = FFI::Function.new(:bool, [:long, :pointer], {convention: :stdcall}) do |handle, _|
found_window = handle if block.call handle
!found_window
end
# Win32.enum_child_windows parent, window_callback, 0
Win32.enum_child_windows parent, 0, 0
found_window
end Have you any idea? |
You're using the 32-bit version of ruby, correct? Not the x64? |
Of course ruby 2.5.1p57 (2018-03-29 revision 63029) [i386-mingw32] |
Solved (conditionally) Cause of this is bug in the ffi gem. Error is present in the ffi x86-mingw32 from v1.9.21 up to last v1.9.25 and reproduces in the Rubies:
Ruby v2.1 and v2.2 haven't tested. From v1.9.4 up to 1.9.18, ffi working fine in the same Ruby versions as above, excluded Ruby v2.5. ffi less than v1.9.21 does not compatible with Ruby 2.5. Conclusion. For perfectly using uia gem required:
Set this dependencys in your gemspec or Gemfile and enjoy. For @leviwilson best regards and thanks for great work. |
ffi/ffi#302 was the original issue that I had bumped to |
I'm understand what is happening less and less more )) Bug is not in the ffi source bug in the ffi gem build! I have built ffi v1.9.25 form sources at my laptop and it perfectly works without any fails. Have you ideas what to do in this case? May be whrites about it trobles in to the msys2 project? Who build gems for prodaction? My be problem on the my laptop only? |
I would follow up with the FFI repository. You should reference the problem
that I linked to you that I had before for reference and mention that
you're seeing the same thing again.
They would better be able to tell you what's going on and why it's not
working. I believe it has something to do when you call win32 functions
that have callbacks for whatever reason (like enumerate windows does).
…On Thu, Aug 9, 2018 at 10:53 AM Leonid Vlasov ***@***.***> wrote:
I'm understand what is happening less and less more ))
Bug is not in the ffi source bug in the ffi gem *build!*
I have built ffi v1.9.25 form sources at my laptop and it perfectly works
without any fails.
Have you ideas what to do in this case?
May be whrites about it trobles in to the msys2 project? Who build gems
for prodaction? My be problem on the my laptop only?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAjD4lgqkCZwWEE1sgZUylUspwOOhH3bks5uPE0HgaJpZM4Vvbf2>
.
|
I will to do so. Thanks for your time again. |
Hi! Great work. I'm playing with Uia but i have got "Segmentation fault":
Failure rises while find application window:
Gems:
Thanks.
Leonid.
The text was updated successfully, but these errors were encountered: