Skip to content
This repository

Rubinius::EncodingClass::Encoding::CompatibilityError #1644

Closed
tmornini opened this Issue · 16 comments

6 participants

Tom Mornini Davor Babić Eric Hodel Jacob Gillespie Brian Shirai Dirkjan Bussink
Tom Mornini
Collaborator

Hello guys. Saw this on some AWS code I've been playing around with, thought you'd like to see it.

Works fine under 1.9.3

rubinius-2.0.0dev :001 > s = Server.new(:prod)
Rubinius::EncodingClass::Encoding::CompatibilityError: undefined conversion for '5SSH-2.0-Ruby/Net::SSH_2.3.0 x86_64-apple-darwin11.3.0%SSH-2.0-OpenSSH_5.8p1 Debian-7ubuntu1????c?_;;?6?9?{Xbdiffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha256ssh-rsa,ssh-dss?aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,idea-cbc,none,arcfour128,arcfour256?aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,idea-cbc,none,arcfour128,arcfour256nhmac-sha1,hmac-md5,hmac-sha1-96,hmac-md5-96,hmac-sha2-256,hmac-sha2-512,hmac-sha2-256-96,hmac-sha2-512-96,nonenhmac-sha1,hmac-md5,hmac-sha1-96,hmac-md5-96,hmac-sha2-256,hmac-sha2-512,hmac-sha2-256-96,hmac-sha2-512-96,nonenone,zlib@openssh.com,zlibnone,zlib@openssh.com,zlibN' from ASCII-8BIT to US-ASCII

ruby -v
rubinius 2.0.0dev (1.9.3 b6cc3ad yyyy-mm-dd JI) [x86_64-apple-darwin11.3.0]

Davor Babić
Collaborator

How do we reproduce this? What module is Server a part of?

Tom Mornini
Collaborator

None:

class Server

I believe this error is bubbling up out of Net::SSH. As you can see there is no backtrace...

Unfortunately, I cannot share this code at this time. If you have some ideas for me to narrow it down further, I'd be happy to be your remote hands on this. :-)

Eric Hodel
Collaborator

"Debian-7ubuntu1????c?_;;?6?9?" might contain 8-bit characters, so the problem may not be in Rubinius' Encoding but instead in Rubinius' byte slicing where Net::SSH is reading the sshd info.

Davor Babić
Collaborator

That's true. But there's still a ton of encoding-related stuff that needs to be implemented before Rubinius is 100% 1.9 compatible.

I've got exams coming up next week but I'll try to see if I can find the root cause of this after that, unless someone has already had time to deal with it.

http://status.rubini.us/

Tom Mornini
Collaborator

I'll try to get a simple case together in the next couple of days. It will likely require an AWS account to demonstrate it...

Davor Babić
Collaborator

Well, I've got an AWS account so it shouldn't be a problem. I'll look into this for you after next week.

Tom Mornini
Collaborator

No problem. I'll get a simple test case together this weekend.

Jacob Gillespie

I'm getting the same error running Capistrano on rbx-head (1.9 mode).

Full message from Capistrano (running cap deploy):

** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: [redacted] (Rubinius::EncodingClass::Encoding::CompatibilityError: undefined conversion for '5SSH-2.0-Ruby/Net::SSH_2.3.0 x86_64-apple-darwin11.3.0%SSH-2.0-OpenSSH_5.8p1 Debian-7ubuntu1?g`֬?h??t?ټ?z^bdiffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha256ssh-rsa,ssh-dss?aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,idea-cbc,none,arcfour128,arcfour256?aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,idea-cbc,none,arcfour128,arcfour256nhmac-sha1,hmac-md5,hmac-sha1-96,hmac-md5-96,hmac-sha2-256,hmac-sha2-512,hmac-sha2-256-96,hmac-sha2-512-96,nonenhmac-sha1,hmac-md5,hmac-sha1-96,hmac-md5-96,hmac-sha2-256,hmac-sha2-512,hmac-sha2-256-96,hmac-sha2-512-96,nonenone,zlib@openssh.com,zlibnone,zlib@openssh.com,zlib:' from ASCII-8BIT to US-ASCII)
Tom Mornini
Collaborator

Here's a simple way to reproduce:

https://github.com/tmornini/rubinius-fog-issue

test.rb lines 8-9 will need to be have AWS credentials before the script will operate. :-)

Jacob Gillespie

Umm... that private key was generated just for this example, right? As in, it's not your personal key for anything? Seeing it in the repo is making me nervous. :)

Tom Mornini
Collaborator

@jacobwg Yes, just for this. :-)

Thanks for checking!

Brian Shirai
Owner

@tmornini When you get a chance, would you please try this again?

Tom Mornini
Collaborator

Yikes!

rubinius-fog-issue $ ruby -v
rubinius 2.0.0.n196 (1.9.3 573abcbb 2013-07-15 JI) [x86_64-apple-darwin12.4.0]
rbx-head | master
rubinius-fog-issue $ bundle
The source :rubygems is deprecated because HTTP requests are insecure.
Please change your source to 'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
Using builder (3.0.0) 
Using excon (0.13.3) 
Using formatador (0.2.1) 
Using mime-types (1.18) 
Using multi_json (1.2.0) 
Using net-ssh (2.3.0) 
Using net-scp (1.0.4) 
Using nokogiri (1.5.2) 
Using ruby-hmac (0.4.0) 
Using fog (1.3.1) 
Using bundler (1.3.5) 
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
rbx-head | master
rubinius-fog-issue $ ./test.rb 
An exception occurred running ./test.rb
    Could not open library /Users/tmornini/.rvm/gems/rbx-head/gems/nokogiri-1.5.2/lib/nokogiri/nokogiri.bundle - dlopen(/Users/tmornini/.rvm/gems/rbx-head/gems/nokogiri-1.5.2/lib/nokogiri/nokogiri.bundle, 10): Symbol not found: _rb_gc_register_address (LoadError::InvalidExtensionError)

Backtrace:
  Rubinius::NativeMethod.load_extension at kernel/common/native_method.rb:28
      Rubinius::CodeLoader#load_library at kernel/delta/codeloader.rb:199
           Rubinius::CodeLoader#require at kernel/common/codeloader.rb:132
           Rubinius::CodeLoader.require at kernel/common/codeloader.rb:226
                 Kernel(Object)#require at kernel/common/kernel.rb:639
                     Object#__script__ at /Users/tmornini/.rvm/gems/rbx-head/gems/nokogiri-1.5.2/lib
                                          /nokogiri.rb:27
           Rubinius::CodeLoader.require at kernel/common/codeloader.rb:232
                 Kernel(Object)#require at kernel/common/kernel.rb:639
                     Object#__script__ at /Users/tmornini/.rvm/gems/rbx-head/gems/fog-1.3.1/lib/fog/core
                                          /parser.rb:1
           Rubinius::CodeLoader.require at kernel/common/codeloader.rb:232
                 Kernel(Object)#require at kernel/common/kernel.rb:639
                     Object#__script__ at /Users/tmornini/.rvm/gems/rbx-head/gems/fog-1.3.1/lib/fog
                                          /core.rb:29
           Rubinius::CodeLoader.require at kernel/common/codeloader.rb:232
                 Kernel(Object)#require at kernel/common/kernel.rb:639
                     Object#__script__ at /Users/tmornini/.rvm/gems/rbx-head/gems/fog-1.3.1/lib/fog.rb:1
           Rubinius::CodeLoader.require at kernel/common/codeloader.rb:232
                         Kernel.require at kernel/common/kernel.rb:639
       { } in Bundler::Runtime#require at /Users/tmornini/.rvm/gems/rbx-head@global/gems/bundler-1.3.5
                                          /lib/bundler/runtime.rb:72
                             Array#each at kernel/bootstrap/array.rb:68
       { } in Bundler::Runtime#require at /Users/tmornini/.rvm/gems/rbx-head@global/gems/bundler-1.3.5
                                          /lib/bundler/runtime.rb:70
                             Array#each at kernel/bootstrap/array.rb:68
              Bundler::Runtime#require at /Users/tmornini/.rvm/gems/rbx-head@global/gems/bundler-1.3.5
                                          /lib/bundler/runtime.rb:59
                       Bundler.require at /Users/tmornini/.rvm/gems/rbx-head@global/gems/bundler-1.3.5
                                          /lib/bundler.rb:132
                      Object#__script__ at test.rb:6
       Rubinius::CodeLoader#load_script at kernel/delta/codeloader.rb:68
       Rubinius::CodeLoader.load_script at kernel/delta/codeloader.rb:119
                Rubinius::Loader#script at kernel/loader.rb:644
                  Rubinius::Loader#main at kernel/loader.rb:845

Caused by: Could not open library /Users/tmornini/.rvm/gems/rbx-head/gems/nokogiri-1.5.2/lib/nokogiri/nokogiri.bundle - dlopen(/Users/tmornini/.rvm/gems/rbx-head/gems/nokogiri-1.5.2/lib/nokogiri/nokogiri.bundle, 10): Symbol not found: _rb_gc_register_address (LoadError)

Backtrace:
  Rubinius::FFI::DynamicLibrary#initialize at kernel/platform/library.rb:381
     Rubinius::NativeMethod.load_extension at kernel/common/native_method.rb:26
         Rubinius::CodeLoader#load_library at kernel/delta/codeloader.rb:199
              Rubinius::CodeLoader#require at kernel/common/codeloader.rb:132
              Rubinius::CodeLoader.require at kernel/common/codeloader.rb:226
                    Kernel(Object)#require at kernel/common/kernel.rb:639
                        Object#__script__ at /Users/tmornini/.rvm/gems/rbx-head/gems/nokogiri-1.5.2/lib
                                             /nokogiri.rb:27
              Rubinius::CodeLoader.require at kernel/common/codeloader.rb:232
                    Kernel(Object)#require at kernel/common/kernel.rb:639
                        Object#__script__ at /Users/tmornini/.rvm/gems/rbx-head/gems/fog-1.3.1/lib/fog
                                             /core/parser.rb:1
              Rubinius::CodeLoader.require at kernel/common/codeloader.rb:232
                    Kernel(Object)#require at kernel/common/kernel.rb:639
                        Object#__script__ at /Users/tmornini/.rvm/gems/rbx-head/gems/fog-1.3.1/lib/fog
                                             /core.rb:29
              Rubinius::CodeLoader.require at kernel/common/codeloader.rb:232
                    Kernel(Object)#require at kernel/common/kernel.rb:639
                        Object#__script__ at /Users/tmornini/.rvm/gems/rbx-head/gems/fog-1.3.1/lib
                                             /fog.rb:1
              Rubinius::CodeLoader.require at kernel/common/codeloader.rb:232
                            Kernel.require at kernel/common/kernel.rb:639
          { } in Bundler::Runtime#require at /Users/tmornini/.rvm/gems/rbx-head@global/gems
                                             /bundler-1.3.5/lib/bundler/runtime.rb:72
                                Array#each at kernel/bootstrap/array.rb:68
          { } in Bundler::Runtime#require at /Users/tmornini/.rvm/gems/rbx-head@global/gems
                                             /bundler-1.3.5/lib/bundler/runtime.rb:70
                                Array#each at kernel/bootstrap/array.rb:68
                 Bundler::Runtime#require at /Users/tmornini/.rvm/gems/rbx-head@global/gems
                                             /bundler-1.3.5/lib/bundler/runtime.rb:59
                          Bundler.require at /Users/tmornini/.rvm/gems/rbx-head@global/gems
                                             /bundler-1.3.5/lib/bundler.rb:132
                         Object#__script__ at test.rb:6
          Rubinius::CodeLoader#load_script at kernel/delta/codeloader.rb:68
          Rubinius::CodeLoader.load_script at kernel/delta/codeloader.rb:119
                   Rubinius::Loader#script at kernel/loader.rb:644
                     Rubinius::Loader#main at kernel/loader.rb:845
rbx-head | master
rubinius-fog-issue $ 
Dirkjan Bussink
Owner

You probably have to reinstall the nokogiri gem here, that should fix the issue.

Dirkjan Bussink
Owner

Another reason could be that the nokogiri gem was compiled against MRI. In Rubinius rb_gc_register_address is actually a macro that translates into capi_gc_register_address because we pass down additional debug information like FILE and LINE where it was defined.

Tom Mornini
Collaborator

Will try again and re-open if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.