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

rautomation/adapter/win_32/functions.rb:298: [BUG] Segmentation fault #26

Closed
Nakilon opened this issue May 4, 2018 · 7 comments
Closed

Comments

@Nakilon
Copy link

Nakilon commented May 4, 2018

Just installed Ruby to code a bit on Windows.

Windows 7
Ruby Installer: Ruby+Devkit 2.4.4-1 (x86)

require "win32/screenshot"

Win32::Screenshot::Take.of(:window, title: "Red Alert 2")
C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adapter/wi
n_32/functions.rb:298: [BUG] Segmentation fault
ruby 2.4.4p296 (2018-03-28 revision 63013) [i386-mingw32]

-- Control frame information -----------------------------------------------
c:0011 p:---- s:0059 e:000058 CFUNC  :enum_windows
c:0010 p:0068 s:0053 E:001c9c METHOD C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomat
ion-0.17.0/lib/rautomation/adapter/win_32/functions.rb:298
c:0009 p:0011 s:0044 E:000914 METHOD C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomat
ion-0.17.0/lib/rautomation/adapter/win_32/functions.rb:140
c:0008 p:0031 s:0039 e:000038 METHOD C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomat
ion-0.17.0/lib/rautomation/adapter/win_32/window.rb:48
c:0007 p:0008 s:0035 e:000034 METHOD C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomat
ion-0.17.0/lib/rautomation/adapter/win_32/window.rb:90
c:0006 p:0008 s:0030 e:000029 METHOD C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomat
ion-0.17.0/lib/rautomation/adapter/win_32/window.rb:80
c:0005 p:0010 s:0026 e:000025 METHOD C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomat
ion-0.17.0/lib/rautomation/window.rb:124
c:0004 p:0155 s:0022 e:000021 METHOD C:/Ruby24/lib/ruby/gems/2.4.0/gems/win32scr
eenshot-2.1.0/lib/win32/screenshot/take.rb:71
c:0003 p:0065 s:0013 e:000012 METHOD C:/Ruby24/lib/ruby/gems/2.4.0/gems/win32scr
eenshot-2.1.0/lib/win32/screenshot/take.rb:49
c:0002 p:0029 s:0006 e:000005 EVAL   main.rb:3 [FINISH]
c:0001 p:0000 s:0003 E:0022b0 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
main.rb:3:in `<main>'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/win32screenshot-2.1.0/lib/win32/screenshot/ta
ke.rb:49:in `of'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/win32screenshot-2.1.0/lib/win32/screenshot/ta
ke.rb:71:in `window'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/window.rb:
124:in `active?'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adapter/wi
n_32/window.rb:80:in `active?'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adapter/wi
n_32/window.rb:90:in `exists?'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adapter/wi
n_32/window.rb:48:in `hwnd'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adapter/wi
n_32/functions.rb:140:in `window_hwnd'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adapter/wi
n_32/functions.rb:298:in `find_hwnd'
C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adapter/wi
n_32/functions.rb:298:in `enum_windows'

-- C level backtrace information -------------------------------------------
C:\Windows\SysWOW64\ntdll.dll(NtWaitForSingleObject+0x15) [0x77aff8e1]
C:\Windows\syswow64\kernel32.dll(WaitForSingleObjectEx+0x43) [0x76b51194]
C:\Windows\syswow64\kernel32.dll(WaitForSingleObject+0x12) [0x76b51148]
C:\Ruby24\bin\msvcrt-ruby240.dll(rb_print_backtrace+0x40) [0x710f82b0]
C:\Windows\SysWOW64\ntdll.dll(RtlKnownExceptionFilter+0xb7) [0x77b55b57]

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

* Loaded script: main.rb

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 C:/Ruby24/lib/ruby/2.4.0/i386-mingw32/enc/encdb.so
    5 C:/Ruby24/lib/ruby/2.4.0/i386-mingw32/enc/trans/transdb.so
    6 C:/Ruby24/lib/ruby/2.4.0/i386-mingw32/enc/windows_1251.so
    7 C:/Ruby24/lib/ruby/2.4.0/unicode_normalize.rb
    8 C:/Ruby24/lib/ruby/2.4.0/i386-mingw32/rbconfig.rb
    9 C:/Ruby24/lib/ruby/2.4.0/rubygems/compatibility.rb
   10 C:/Ruby24/lib/ruby/2.4.0/rubygems/defaults.rb
   11 C:/Ruby24/lib/ruby/2.4.0/rubygems/deprecate.rb
   12 C:/Ruby24/lib/ruby/2.4.0/rubygems/errors.rb
   13 C:/Ruby24/lib/ruby/2.4.0/rubygems/version.rb
   14 C:/Ruby24/lib/ruby/2.4.0/rubygems/requirement.rb
   15 C:/Ruby24/lib/ruby/2.4.0/rubygems/platform.rb
   16 C:/Ruby24/lib/ruby/2.4.0/rubygems/basic_specification.rb
   17 C:/Ruby24/lib/ruby/2.4.0/rubygems/stub_specification.rb
   18 C:/Ruby24/lib/ruby/2.4.0/rubygems/util/list.rb
   19 C:/Ruby24/lib/ruby/2.4.0/i386-mingw32/stringio.so
   20 C:/Ruby24/lib/ruby/2.4.0/uri/rfc2396_parser.rb
   21 C:/Ruby24/lib/ruby/2.4.0/uri/rfc3986_parser.rb
   22 C:/Ruby24/lib/ruby/2.4.0/uri/common.rb
   23 C:/Ruby24/lib/ruby/2.4.0/uri/generic.rb
   24 C:/Ruby24/lib/ruby/2.4.0/uri/ftp.rb
   25 C:/Ruby24/lib/ruby/2.4.0/uri/http.rb
   26 C:/Ruby24/lib/ruby/2.4.0/uri/https.rb
   27 C:/Ruby24/lib/ruby/2.4.0/uri/ldap.rb
   28 C:/Ruby24/lib/ruby/2.4.0/uri/ldaps.rb
   29 C:/Ruby24/lib/ruby/2.4.0/uri/mailto.rb
   30 C:/Ruby24/lib/ruby/2.4.0/uri.rb
   31 C:/Ruby24/lib/ruby/2.4.0/rubygems/specification.rb
   32 C:/Ruby24/lib/ruby/2.4.0/rubygems/exceptions.rb
   33 C:/Ruby24/lib/ruby/site_ruby/2.4.0/ruby_installer/runtime/singleton.rb
   34 C:/Ruby24/lib/ruby/site_ruby/2.4.0/ruby_installer/runtime.rb
   35 C:/Ruby24/lib/ruby/site_ruby/2.4.0/ruby_installer/runtime/msys2_installati
on.rb
   36 C:/Ruby24/lib/ruby/2.4.0/i386-mingw32/fiddle.so
   37 C:/Ruby24/lib/ruby/2.4.0/fiddle/function.rb
   38 C:/Ruby24/lib/ruby/2.4.0/fiddle/closure.rb
   39 C:/Ruby24/lib/ruby/2.4.0/fiddle.rb
   40 C:/Ruby24/lib/ruby/site_ruby/2.4.0/ruby_installer/runtime/dll_directory.rb

   41 C:/Ruby24/lib/ruby/2.4.0/i386-mingw32/enc/utf_16le.so
   42 C:/Ruby24/lib/ruby/2.4.0/i386-mingw32/enc/trans/utf_16_32.so
   43 C:/Ruby24/lib/ruby/2.4.0/rubygems/defaults/operating_system.rb
   44 C:/Ruby24/lib/ruby/2.4.0/rubygems/dependency.rb
   45 C:/Ruby24/lib/ruby/2.4.0/rubygems/core_ext/kernel_gem.rb
   46 C:/Ruby24/lib/ruby/2.4.0/monitor.rb
   47 C:/Ruby24/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb
   48 C:/Ruby24/lib/ruby/2.4.0/rubygems.rb
   49 C:/Ruby24/lib/ruby/2.4.0/rubygems/path_support.rb
   50 C:/Ruby24/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/ver
sion.rb
   51 C:/Ruby24/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/cor
e_ext/name_error.rb
   52 C:/Ruby24/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/lev
enshtein.rb
   53 C:/Ruby24/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/jar
o_winkler.rb
   54 C:/Ruby24/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/spe
ll_checker.rb
   55 C:/Ruby24/lib/ruby/2.4.0/delegate.rb
   56 C:/Ruby24/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/spe
ll_checkers/name_error_checkers/class_name_checker.rb
   57 C:/Ruby24/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/spe
ll_checkers/name_error_checkers/variable_name_checker.rb
   58 C:/Ruby24/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/spe
ll_checkers/name_error_checkers.rb
   59 C:/Ruby24/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/spe
ll_checkers/method_name_checker.rb
   60 C:/Ruby24/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/spe
ll_checkers/null_checker.rb
   61 C:/Ruby24/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean/for
matter.rb
   62 C:/Ruby24/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib/did_you_mean.rb
   63 C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.23-x86-mingw32/lib/2.4/ffi_c.so

   64 C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.23-x86-mingw32/lib/ffi/platform
.rb
   65 C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.23-x86-mingw32/lib/ffi/types.rb

   66 C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.23-x86-mingw32/lib/ffi/library.
rb
   67 C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.23-x86-mingw32/lib/ffi/errno.rb

   68 C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.23-x86-mingw32/lib/ffi/pointer.
rb
   69 C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.23-x86-mingw32/lib/ffi/memorypo
inter.rb
   70 C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.23-x86-mingw32/lib/ffi/struct_l
ayout_builder.rb
   71 C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.23-x86-mingw32/lib/ffi/struct.r
b
   72 C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.23-x86-mingw32/lib/ffi/union.rb

   73 C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.23-x86-mingw32/lib/ffi/manageds
truct.rb
   74 C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.23-x86-mingw32/lib/ffi/callback
.rb
   75 C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.23-x86-mingw32/lib/ffi/io.rb
   76 C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.23-x86-mingw32/lib/ffi/autopoin
ter.rb
   77 C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.23-x86-mingw32/lib/ffi/variadic
.rb
   78 C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.23-x86-mingw32/lib/ffi/enum.rb
   79 C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.23-x86-mingw32/lib/ffi/ffi.rb
   80 C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.23-x86-mingw32/lib/ffi.rb
   81 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/versi
on.rb
   82 C:/Ruby24/lib/ruby/2.4.0/i386-mingw32/etc.so
   83 C:/Ruby24/lib/ruby/2.4.0/fileutils.rb
   84 C:/Ruby24/lib/ruby/2.4.0/tmpdir.rb
   85 C:/Ruby24/lib/ruby/2.4.0/tempfile.rb
   86 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/utili
ties.rb
   87 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/confi
guration.rb
   88 C:/Ruby24/lib/ruby/2.4.0/benchmark.rb
   89 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/logge
r.rb
   90 C:/Ruby24/lib/ruby/2.4.0/timeout.rb
   91 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/shell
.rb
   92 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/tool/
animate.rb
   93 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/tool/
compare.rb
   94 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/tool/
composite.rb
   95 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/tool/
conjure.rb
   96 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/tool/
convert.rb
   97 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/tool/
display.rb
   98 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/tool/
identify.rb
   99 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/tool/
import.rb
  100 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/tool/
mogrify.rb
  101 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/tool/
montage.rb
  102 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/tool/
stream.rb
  103 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/tool.
rb
  104 C:/Ruby24/lib/ruby/2.4.0/i386-mingw32/pathname.so
  105 C:/Ruby24/lib/ruby/2.4.0/pathname.rb
  106 C:/Ruby24/lib/ruby/2.4.0/i386-mingw32/date_core.so
  107 C:/Ruby24/lib/ruby/2.4.0/date.rb
  108 C:/Ruby24/lib/ruby/2.4.0/time.rb
  109 C:/Ruby24/lib/ruby/2.4.0/open-uri.rb
  110 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/image
/info.rb
  111 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick/image
.rb
  112 C:/Ruby24/lib/ruby/gems/2.4.0/gems/mini_magick-4.3.6/lib/mini_magick.rb
  113 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/wait
_helper.rb
  114 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/helper.rb
  115 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/butt
on.rb
  116 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/text
_field.rb
  117 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/elem
ent_collections.rb
  118 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/wind
ow.rb
  119 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation.rb
  120 C:/Ruby24/lib/ruby/gems/2.4.0/gems/win32screenshot-2.1.0/lib/win32/screens
hot/version.rb
  121 C:/Ruby24/lib/ruby/gems/2.4.0/gems/win32screenshot-2.1.0/lib/win32/screens
hot/take.rb
  122 C:/Ruby24/lib/ruby/gems/2.4.0/gems/win32screenshot-2.1.0/lib/win32/screens
hot/image.rb
  123 C:/Ruby24/lib/ruby/gems/2.4.0/gems/win32screenshot-2.1.0/lib/win32/screens
hot/bitmap_maker.rb
  124 C:/Ruby24/lib/ruby/gems/2.4.0/gems/win32screenshot-2.1.0/lib/win32/screens
hot.rb
  125 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/win_32/constants.rb
  126 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/win_32/keys.rb
  127 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/win_32/functions.rb
  128 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/win_32/locators.rb
  129 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/win_32/window.rb
  130 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/win_32/button_helper.rb
  131 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/win_32/control.rb
  132 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/win_32/button.rb
  133 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/win_32/checkbox.rb
  134 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/win_32/radio.rb
  135 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/win_32/text_field.rb
  136 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/win_32/select_list.rb
  137 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/win_32/table.rb
  138 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/win_32/label.rb
  139 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/win_32/list_box.rb
  140 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/win_32/mouse.rb
  141 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/win_32/password_field.rb
  142 C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adap
ter/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.
@Nakilon
Copy link
Author

Nakilon commented May 4, 2018

Also tried on another window (steam app, title: "Friends").
Also tried in both 16bit and 32bit screen color.
Also tried as admin user.

@Nakilon Nakilon changed the title Just installed Ruby to code a bit on Windows rautomation/adapter/wi n_32/functions.rb:298: [BUG] Segmentation fault May 4, 2018
@Nakilon Nakilon changed the title rautomation/adapter/wi n_32/functions.rb:298: [BUG] Segmentation fault rautomation/adapter/win_32/functions.rb:298: [BUG] Segmentation fault May 4, 2018
@Nakilon
Copy link
Author

Nakilon commented May 4, 2018

If I downgrade ffi to 1.9.18 the code:

require "rautomation"
RAutomation::Window.new({context: :window, title: "Friends"}).active?

emits:

C:/Ruby24/lib/ruby/gems/2.4.0/gems/rautomation-0.17.0/lib/rautomation/adapter/win_32/functions.rb:268:in `block in element_properties': undefined method `window_context' for RAutomation::Adapter::Win32::Functions:Module (NoMethodError)

Downgrading to 1.9.17:

C:/Ruby24/lib/ruby/gems/2.4.0/gems/ffi-1.9.17-x86-mingw32/lib/ffi/library.rb:147:in `block in ffi_lib': Could not open library 'user32': ???????? ????? ???????. (LoadError)

Downgrading to rautomation 0.15.0 and ffi -v 1.9.0 --remote --platform=ruby causes Could not open library 'user32.dll' too.

@Nakilon
Copy link
Author

Nakilon commented May 4, 2018

With Ruby 2.0, uninstalled iteratively win32screnshot, rautomation, ffi and lowered versions of win32screenshot, until 1.0.6, where I got rake's executable "rake" conflicts with C:/Ruby22/bin/rake -- all the same CFUNC :enum_windows segmentation fault message.

@Nakilon Nakilon closed this as completed May 4, 2018
@Nakilon Nakilon reopened this May 4, 2018
@Andrek25
Copy link

Andrek25 commented Dec 5, 2018

I have the same problem, and this is what i did:

window = RAutomation::Window.new(:title => /Title/i, :adapter => :autoit)
Win32::Screenshot::Take.of(:window, rautomation: window).write!("test.bmp")

You can also try with: :adapter => :win_32 or :adapter => :ms_uia but i am not a really expert so i think that is not the best way to solve it.

Windows 7 (32 Bits)
Ruby 2.4.4p296 (2018-03-28 revision 63013) [i386-mingw32]

I'm late but that's all :)

@jarmo
Copy link
Owner

jarmo commented Dec 11, 2019

These problems might have been solved in version 3.0.0 (make sure that you are using 32bit Ruby, since win32screenshot does not work with 64bit version!).

@jarmo jarmo closed this as completed Dec 11, 2019
@tsujp
Copy link

tsujp commented Dec 25, 2021

These problems might have been solved in version 3.0.0 (make sure that you are using 32bit Ruby, since win32screenshot does not work with 64bit version!).

I'm new to this, does this mean it's impossible to interact with gdi32.dll with 64 bit Ruby? Does FFI not provide a way? Having to use 32 bit Ruby because of this kinda sucks.

@jarmo
Copy link
Owner

jarmo commented Dec 26, 2021

@tsujp unfortunately that's the case, yes. It is because RAutomation does not work with 64bit Ruby as of this moment. It is an older library, which is not actively maintained anymore, but PR-s are all welcome.

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

4 participants