jarmo / RAutomation

RAutomation
MIT License
100 stars 33 forks source link

Illegal Instruction #120

Closed aswerlein511 closed 6 years ago

aswerlein511 commented 6 years ago

I have looked into this issue before and found similar bugs raised for this issue. I found solutions that did not work for me. This library used to work for me, and then suddenly it stopped working.

OS - windows 7 ruby -v 2.3.3 rautomation -v 0.17.0 ffi -v 1.9.23

First possible solution: lock ffi gem to version 1.9.0

Doing that causes different issues with failing to execute the second command 'window =' with failing to require 'ffic'

Here is the code I am trying to execute:

require 'rautomation'

window = RAutomation::Window.new(title: /cmd/i)

window.title

Here is the stack trace that follows:

C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomation-0.17.0/lib/rautomation/adapter/wi n_32/functions.rb:298: [BUG] Illegal instruction ruby 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32]

-- Control frame information ----------------------------------------------- c:0029 p:---- s:0117 e:000116 CFUNC :enum_windows c:0028 p:0068 s:0112 E:0021ac METHOD C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomat ion-0.17.0/lib/rautomation/adapter/win_32/functions.rb:298 c:0027 p:0011 s:0104 E:00007c METHOD C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomat ion-0.17.0/lib/rautomation/adapter/win_32/functions.rb:140 c:0026 p:0031 s:0100 e:000099 METHOD C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomat ion-0.17.0/lib/rautomation/adapter/win_32/window.rb:48 c:0025 p:0008 s:0097 e:000096 METHOD C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomat ion-0.17.0/lib/rautomation/adapter/win_32/window.rb:90 c:0024 p:0010 s:0093 e:000092 METHOD C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomat ion-0.17.0/lib/rautomation/window.rb:138 c:0023 p:0008 s:0090 e:000089 METHOD C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomat ion-0.17.0/lib/rautomation/window.rb:155 c:0022 p:0008 s:0087 e:000086 BLOCK C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomat ion-0.17.0/lib/rautomation/window.rb:224 c:0021 p:0049 s:0085 e:000084 METHOD C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomat ion-0.17.0/lib/rautomation/wait_helper.rb:15 c:0020 p:0015 s:0078 E:001408 METHOD C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomat ion-0.17.0/lib/rautomation/window.rb:224 c:0019 p:0008 s:0075 e:000074 METHOD C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomat ion-0.17.0/lib/rautomation/window.rb:105 c:0018 p:0007 s:0072 e:000071 EVAL (irb):4 [FINISH] c:0017 p:---- s:0070 e:000069 CFUNC :eval c:0016 p:0025 s:0063 e:000062 METHOD C:/Ruby23/lib/ruby/2.3.0/irb/workspace.rb:8 7 c:0015 p:0027 s:0056 e:000054 METHOD C:/Ruby23/lib/ruby/2.3.0/irb/context.rb:380

c:0014 p:0024 s:0050 e:000049 BLOCK C:/Ruby23/lib/ruby/2.3.0/irb.rb:489 c:0013 p:0041 s:0042 e:000041 METHOD C:/Ruby23/lib/ruby/2.3.0/irb.rb:623 c:0012 p:0011 s:0037 e:000036 BLOCK C:/Ruby23/lib/ruby/2.3.0/irb.rb:486 c:0011 p:0128 s:0033 e:000032 BLOCK C:/Ruby23/lib/ruby/2.3.0/irb/ruby-lex.rb:24 6 [FINISH] c:0010 p:---- s:0030 e:000029 CFUNC :loop c:0009 p:0009 s:0027 e:000026 BLOCK C:/Ruby23/lib/ruby/2.3.0/irb/ruby-lex.rb:23 2 [FINISH] c:0008 p:---- s:0025 e:000024 CFUNC :catch c:0007 p:0018 s:0021 e:000020 METHOD C:/Ruby23/lib/ruby/2.3.0/irb/ruby-lex.rb:23 1 c:0006 p:0037 s:0018 E:000e28 METHOD C:/Ruby23/lib/ruby/2.3.0/irb.rb:485 c:0005 p:0009 s:0015 e:000014 BLOCK C:/Ruby23/lib/ruby/2.3.0/irb.rb:395 [FINISH ] c:0004 p:---- s:0013 e:000012 CFUNC :catch c:0003 p:0174 s:0009 E:001fa0 METHOD C:/Ruby23/lib/ruby/2.3.0/irb.rb:394 c:0002 p:0023 s:0004 E:000cf0 EVAL C:/Ruby23/bin/irb.cmd:19 [FINISH] c:0001 p:0000 s:0002 E:000720 (none) [FINISH]

-- Ruby level backtrace information ---------------------------------------- C:/Ruby23/bin/irb.cmd:19:in <main>' C:/Ruby23/lib/ruby/2.3.0/irb.rb:394:instart' C:/Ruby23/lib/ruby/2.3.0/irb.rb:394:in catch' C:/Ruby23/lib/ruby/2.3.0/irb.rb:395:inblock in start' C:/Ruby23/lib/ruby/2.3.0/irb.rb:485:in eval_input' C:/Ruby23/lib/ruby/2.3.0/irb/ruby-lex.rb:231:ineach_top_level_statement' C:/Ruby23/lib/ruby/2.3.0/irb/ruby-lex.rb:231:in catch' C:/Ruby23/lib/ruby/2.3.0/irb/ruby-lex.rb:232:inblock in each_top_level_stateme nt' C:/Ruby23/lib/ruby/2.3.0/irb/ruby-lex.rb:232:in loop' C:/Ruby23/lib/ruby/2.3.0/irb/ruby-lex.rb:246:inblock (2 levels) in each_top_le vel_statement' C:/Ruby23/lib/ruby/2.3.0/irb.rb:486:in block in eval_input' C:/Ruby23/lib/ruby/2.3.0/irb.rb:623:insignal_status' C:/Ruby23/lib/ruby/2.3.0/irb.rb:489:in block (2 levels) in eval_input' C:/Ruby23/lib/ruby/2.3.0/irb/context.rb:380:inevaluate' C:/Ruby23/lib/ruby/2.3.0/irb/workspace.rb:87:in evaluate' C:/Ruby23/lib/ruby/2.3.0/irb/workspace.rb:87:ineval' (irb):4:in irb_binding' C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomation-0.17.0/lib/rautomation/window.rb: 105:intitle' C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomation-0.17.0/lib/rautomation/window.rb: 224:in wait_until_present' C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomation-0.17.0/lib/rautomation/wait_helpe r.rb:15:inwait_until' C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomation-0.17.0/lib/rautomation/window.rb: 224:in block in wait_until_present' C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomation-0.17.0/lib/rautomation/window.rb: 155:inpresent?' C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomation-0.17.0/lib/rautomation/window.rb: 138:in exists?' C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomation-0.17.0/lib/rautomation/adapter/wi n_32/window.rb:90:inexists?' C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomation-0.17.0/lib/rautomation/adapter/wi n_32/window.rb:48:in hwnd' C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomation-0.17.0/lib/rautomation/adapter/wi n_32/functions.rb:140:inwindow_hwnd' C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomation-0.17.0/lib/rautomation/adapter/wi n_32/functions.rb:298:in find_hwnd' C:/Ruby23/lib/ruby/gems/2.3.0/gems/rautomation-0.17.0/lib/rautomation/adapter/wi n_32/functions.rb:298:inenum_windows'

-- C level backtrace information ------------------------------------------- C:\WINDOWS\SysWOW64\ntdll.dll(NtWaitForSingleObject+0x15) [0x77A5F901] C:\WINDOWS\syswow64\kernel32.dll(WaitForSingleObjectEx+0x43) [0x76E91194] C:\WINDOWS\syswow64\kernel32.dll(WaitForSingleObject+0x12) [0x76E91148] C:\Ruby23\bin\msvcrt-ruby230.dll(rb_vm_bugreport+0xaa) [0x6305F9EA] C:\Ruby23\bin\msvcrt-ruby230.dll(rb_bug_context+0x49) [0x62F06209] C:\Ruby23\bin\msvcrt-ruby230.dll(rb_check_safe_obj+0x139) [0x62FD0539] [0x00401834] C:\WINDOWS\SysWOW64\ntdll.dll(RtlKnownExceptionFilter+0xb7) [0x77AB50D7]

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

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

jarmo commented 6 years ago

It's hard to say what it causing it. Does it also happen with the latest version of ffi? If not, then try one version before that and so on until you've tried at least 3-5 versions. After that, try different Ruby version.

Not sure that this is even RAutomation's issue, but it probably lies in FFI instead. Closing it until further information.

aswerlein511 commented 6 years ago

@jarmo : I was able to version lock the ffi gem to version 1.9.18 and that worked for me. Thanks for the advice