tenderlove/asmrepl

Cannot execute on Ubuntu 20.04 (while install seems fine)

romulusFR opened this issue · 5 comments

Hi @tenderlove

sudo apt-get install libcapstone-dev was done first as required then gem install asmrepl went fine, outoupt on a second execution is as follows :

Successfully installed asmrepl-1.0.0
Parsing documentation for asmrepl-1.0.0
Done installing documentation for asmrepl after 0 seconds
1 gem installed

However, when I execute asmrepl I've the following error. Unfortunately, i dunno know ruby to debug it.

/home/romulus/gems/gems/asmrepl-1.0.0/lib/asmrepl/assembler.rb:6: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!
/home/romulus/gems/gems/asmrepl-1.0.0/lib/asmrepl/repl.rb:82: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!
/home/romulus/gems/gems/asmrepl-1.0.0/lib/asmrepl/repl.rb:82: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!
/home/romulus/gems/gems/asmrepl-1.0.0/lib/asmrepl/repl.rb:82: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!
/home/romulus/gems/gems/asmrepl-1.0.0/lib/asmrepl/repl.rb:82: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!
Traceback (most recent call last):
	10: from /home/romulus/gems/bin/asmrepl:23:in `<main>'
	 9: from /home/romulus/gems/bin/asmrepl:23:in `load'
	 8: from /home/romulus/gems/gems/asmrepl-1.0.0/bin/asmrepl:3:in `<top (required)>'
	 7: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	 6: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	 5: from /home/romulus/gems/gems/asmrepl-1.0.0/lib/asmrepl.rb:3:in `<top (required)>'
	 4: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	 3: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	 2: from /home/romulus/gems/gems/asmrepl-1.0.0/lib/asmrepl/repl.rb:3:in `<top (required)>'
	 1: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- crabstone (LoadError)

Here are some details about my environment

~ ❯ neofetch --stdout
romulus@wn20-ens-st02 
--------------------- 
OS: Ubuntu 20.04.3 LTS x86_64 
Host: 20U1000WFR ThinkPad L14 Gen 1 
Kernel: 5.11.0-40-generic 
Uptime: 4 days, 1 hour, 56 mins 
Packages: 74548 (apt), 27 (snap) 
Shell: bash 5.0.17 
Resolution: 1920x1080 
DE: GNOME 3.36.9 
WM: Mutter 
WM Theme: Adwaita 
Theme: Yaru [GTK2/3] 
Icons: Yaru [GTK2/3] 
Terminal: gnome-terminal 
CPU: Intel i5-10210U (8) @ 4.200GHz 
GPU: Intel UHD Graphics 
Memory: 5435MiB / 7612MiB 

~ ❯ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
~ ❯ gem -v
3.1.2

I pushed a new version 1.0.1 that should address this problem. Sorry about that!

I had the same error - amazing to see it fixed 1 minute prior to me having installed! However now I see a different error when I execute asmrepl:

/var/lib/gems/2.7.0/gems/asmrepl-1.0.1/lib/asmrepl/assembler.rb:6: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!
/var/lib/gems/2.7.0/gems/asmrepl-1.0.1/lib/asmrepl/repl.rb:70: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!
Traceback (most recent call last):
        6: from /usr/local/bin/asmrepl:23:in `<main>'
        5: from /usr/local/bin/asmrepl:23:in `load'
        4: from /var/lib/gems/2.7.0/gems/asmrepl-1.0.1/bin/asmrepl:5:in `<top (required)>'
        3: from /var/lib/gems/2.7.0/gems/asmrepl-1.0.1/lib/asmrepl/repl.rb:46:in `start'
        2: from /var/lib/gems/2.7.0/gems/asmrepl-1.0.1/lib/asmrepl/linux.rb:173:in `state'
        1: from /var/lib/gems/2.7.0/gems/asmrepl-1.0.1/lib/asmrepl/linux.rb:102:in `malloc'
/var/lib/gems/2.7.0/gems/asmrepl-1.0.1/lib/asmrepl/linux.rb:92:in `block in <class:ThreadState>': uninitialized constant Fiddle::SIZEOF_INT64_T (NameError)
Did you mean?  Fiddle::SIZEOF_INTPTR_T
               Fiddle::SIZEOF_UINTPTR_T

Details about my env:

> neofetch --stdout
OS: Ubuntu 20.04 LTS on Windows 10 x86_64
Kernel: 4.4.0-18362-Microsoft
Uptime: 12 hours, 43 mins
Packages: 1543 (dpkg)
Shell: bash 5.0.16
Terminal: /dev/tty1
CPU: Intel i7-10510U (8) @ 2.304GHz
Memory: 8612MiB / 16166MiB
> ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
> gem -v
3.1.2

Odd. I think we just need to replace SIZEOF_INT64_T with SIZEOF_UINTPTR_T. They should be the same width. I didn't realize SIZEOF_INT64_T wouldn't be defined everywhere.

@danokeeffe should be fixed in 1.0.2 (hopefully). Let me know if it's still broken! 🙇🏻‍♂️

It's fine by now. Thanks!