Recently I've been trying to work with an Ice client written in Ruby. I have been able to generate the appropriate modules using slice2rb, and I can establish a connection just fine. The problem with stringify happens when I call certain methods on the generated module.
The ice file for this project can be found here: http://geeksharp.com/dl/Murmur.ice
Here's the log for my session with IRB:
So you'll notice I'm using Ruby Enterprise Edition, however I have tested this with my vendor-supplied (Ubuntu) default ruby install and the same problem happens. I was even able to compile IceRuby on MacOSX at home using Ruby 1.8.7, and again, I get the same problem.Code:irb(main):001:0> $LOAD_PATH << '/opt/Ice-3.4.1/ruby' => ["/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/site_ruby/1.8", "/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/site_ruby/1.8/i686-linux", "/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/site_ruby", "/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/vendor_ruby/1.8", "/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/vendor_ruby/1.8/i686-linux", "/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/vendor_ruby", "/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8", "/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/i686-linux", ".", "/opt/Ice-3.4.1/ruby"] irb(main):002:0> require "murmur.rb" => true irb(main):003:0> comm = Ice.initialize() => #<Ice::CommunicatorI:0x93d3520> irb(main):004:0> proxy = comm.stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502") => Meta -t:tcp -h 127.0.0.1 -p 6502 irb(main):005:0> meta = Murmur::MetaPrx::checkedCast(proxy) => Meta -t:tcp -h 127.0.0.1 -p 6502 irb(main):006:0> server = meta.getServer(1) => s/1 -t:tcp -h 127.0.0.1 -p 6502 irb(main):007:0> users = server.getUsers() ArgumentError: string contains null byte from ./murmur.rb:111:in `__stringify' from ./murmur.rb:111:in `inspect' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/irb.rb:310:in `output_value' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/irb.rb:159:in `eval_input' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/irb.rb:271:in `signal_status' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/irb.rb:155:in `eval_input' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/irb.rb:154:in `eval_input' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/irb.rb:71:in `start' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/irb.rb:70:in `catch' from /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/irb.rb:70:in `start' from /opt/ruby-enterprise-1.8.7-2010.02/bin/irb:13 irb(main):008:0>
Just to see if there was a problem with the Murmur program (Mumble) I decided to try the same thing in C# and Python. Using slice2cs and slice2py, I generated modules from the slice definition I linked above. When using C# and Python to perform this same function, I did not encounter any problems. For reference, here's the python code I used:
You can see at the end that I call the same method as in the Ruby code, but within Python I have no problems. Any help would be greatly appreciated. I'd much prefer to use Ruby for this project, and I was hoping that the IceRuby libraries would be able to handle it for me.Code:import Murmur_ice import Ice import Murmur murmur_host = '127.0.0.1' murmur_port = '6502' murmur_server_id = 1 comm = Ice.initialize() meta = Murmur.MetaPrx.checkedCast(comm.stringToProxy('Meta:tcp -h %(host)s -p %(port)s' % {'host': murmur_host, 'port': murmur_port})) server = meta.getServer(murmur_server_id) userdict = server.getUsers()
Thanks in advance for your help! If I've left anything out, or if one of your developers would like a shell account on my server to investigate this issue, I'll be happy to oblige.

Reply With Quote