[Rock-dev] roby shell

Chris Müller ruunhb at googlemail.com
Sun Jan 8 00:48:16 CET 2012


On 06.01.2012 14:28, Allan E. Conquest wrote:
> Hi,
>
>
> allan at XYZ:~/dev/AVALON/supervision$ scripts/shell --host 127.0.0.1
> 14:16:16.434 (Robot) turning ON MQueue usage
> /home/allan/dev/AVALON/tools/utilrb/lib/utilrb/module/const_defined_here_p.rb:9:in
> `const_defined?': nil is not a symbol (TypeError)
>      from
> /home/allan/dev/AVALON/tools/utilrb/lib/utilrb/module/const_defined_here_p.rb:9:in
> `const_defined_here?'
>      from
> /home/allan/dev/AVALON/tools/utilrb/lib/utilrb/module/define_or_reuse.rb:13:in
> `define_or_reuse'
>      from /home/allan/dev/AVALON/tools/roby/lib/roby/interface.rb:146:in
> `reconnect'
>      from /home/allan/dev/AVALON/tools/roby/lib/roby/interface.rb:133:in
> `each'
>      from /home/allan/dev/AVALON/tools/roby/lib/roby/interface.rb:133:in
> `reconnect'
>      from /home/allan/dev/AVALON/tools/roby/lib/roby/interface.rb:109:in
> `initialize'
>      from
> /home/allan/dev/AVALON/tools/roby/lib/roby/app/scripts/shell.rb:60:in `new'
>      from /home/allan/dev/AVALON/tools/roby/lib/roby/app/scripts/shell.rb:60
>      from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
> `gem_original_require'
>      from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
>      from scripts/shell:3
>
Updating our current setup also results in this error on my machine.

I could managed to fix this bug after some small debugging in the roby 
sources. The problem is based on roby/lib/roby/interface.rb:140
in RemoteInterface, method: reconnect.

             remote_models = @interface.task_models
             remote_models.each do |klass|
                 klass = klass.proxy(nil)

                 if klass.respond_to?(:remote_name) && klass.remote_name
                     # This is a local proxy for a remote model. Add it 
in our
                     # namespace as well.
                     path  = klass.remote_name.split '::'
                     klass_name = path.pop
                     mod = Object
                     while !path.empty?
                         name = path.shift
                         mod = mod.define_or_reuse(name) { Module.new }
                     end

# debugging code
                     puts "klass_name: #{klass_name}, name: #{path}"

                     if klass_name # my extension
                       mod.define_or_reuse(klass_name, klass)
                       new_model(klass.remote_name, klass)
                     end # my extension
                 end
             end

it seems there is a klass, that have no remote_name (empty string). This 
results in a nil for the mod.define_or_reuse method
and then it crashes. If you add the if clause, you can work around this 
problem and you can use the shell again.

I could commit this fix, but i guess the final question is rather where 
this object/klass is coming from within the sources.
I also don't know if this error rises if we have all libs on MASTER. 
(This is tested with NEXT completely).

Chris


More information about the Rock-dev mailing list