Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest version of COSMOS crashing #840

Closed
michaellmonaghan opened this issue Jul 19, 2018 · 6 comments
Closed

Latest version of COSMOS crashing #840

michaellmonaghan opened this issue Jul 19, 2018 · 6 comments
Labels
Milestone

Comments

@michaellmonaghan
Copy link
Contributor

michaellmonaghan commented Jul 19, 2018

I just installed COSMOS on my mac. The launcher and other tools work fine, but the CmdTlmServer crashes when the gui is loaded. The error is FATAL: ArgumentError : tr is not a class method referring to this line

$ cosmos install example
...
$ cd example
$ bundle install
...
$ bundle show
Gems included by the bundle:
  * bundler (1.16.3)
  * coderay (1.1.2)
  * cosmos (4.2.4)
  * httpclient (2.8.3)
  * json (2.1.0)
  * method_source (0.9.0)
  * mini_portile2 (2.3.0)
  * nokogiri (1.8.4)
  * opengl-bindings (1.6.6)
  * pry (0.11.3)
  * pry-doc (0.13.4)
  * puma (3.12.0)
  * qtbindings (4.8.6.5)
  * rack (2.0.5)
  * rake (12.3.1)
  * rdoc (6.0.4)
  * ruby-termios (0.9.6)
  * rubyzip (1.2.1)
  * snmp (1.2.0)
  * uuidtools (2.1.5)
  * yard (0.9.15)
$ bundle exe ruby tools/CmdTlmServer
2018/07/19 16:17:37.957  FATAL: Fatal Exception! Exiting...
2018/07/19 16:17:37.957  FATAL: ArgumentError : tr is not a class method

/Users/mlmonagh/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/cosmos-4.2.4/lib/cosmos/tools/cmd_tlm_server/gui/targets_tab.rb:71:in `method_missing'
/Users/mlmonagh/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/cosmos-4.2.4/lib/cosmos/tools/cmd_tlm_server/gui/targets_tab.rb:71:in `block in populate_targets_table'
/Users/mlmonagh/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/cosmos-4.2.4/lib/cosmos/tools/cmd_tlm_server/gui/targets_tab.rb:70:in `each'
/Users/mlmonagh/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/cosmos-4.2.4/lib/cosmos/tools/cmd_tlm_server/gui/targets_tab.rb:70:in `populate_targets_table'
/Users/mlmonagh/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/cosmos-4.2.4/lib/cosmos/tools/cmd_tlm_server/gui/targets_tab.rb:47:in `populate'
/Users/mlmonagh/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/cosmos-4.2.4/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_gui.rb:173:in `block in start'
/Users/mlmonagh/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/qtbindings-4.8.6.5/lib/Qt4.rb:104:in `block in execute_in_main_thread'
/Users/mlmonagh/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/qtbindings-4.8.6.5/lib/Qt4.rb:57:in `callback_timeout'
/Users/mlmonagh/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/qtbindings-4.8.6.5/lib/Qt/qtruby4.rb:479:in `qt_metacall'
/Users/mlmonagh/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/qtbindings-4.8.6.5/lib/Qt/qtruby4.rb:479:in `method_missing'
/Users/mlmonagh/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/qtbindings-4.8.6.5/lib/Qt/qtruby4.rb:479:in `exec'
/Users/mlmonagh/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/cosmos-4.2.4/lib/cosmos/gui/qt_tool.rb:297:in `block in run'
/Users/mlmonagh/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/cosmos-4.2.4/lib/cosmos/top_level.rb:717:in `set_working_dir'
/Users/mlmonagh/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/cosmos-4.2.4/lib/cosmos/gui/qt_tool.rb:278:in `run'
/Users/mlmonagh/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/cosmos-4.2.4/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_gui.rb:647:in `block in run'
/Users/mlmonagh/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/cosmos-4.2.4/lib/cosmos/top_level.rb:532:in `catch_fatal_exception'
/Users/mlmonagh/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/cosmos-4.2.4/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_gui.rb:608:in `run'
tools/CmdTlmServer:15:in `block in <main>'
/Users/mlmonagh/example/tools/tool_launch.rb:16:in `tool_launch'
tools/CmdTlmServer:13:in `<main>'

Could this be a problem with incompatible versions?

@michaellmonaghan michaellmonaghan changed the title Latest version of CmdTlmServer crashing Latest version of COSMOS CmdTlmServer crashing Jul 19, 2018
@michaellmonaghan michaellmonaghan changed the title Latest version of COSMOS CmdTlmServer crashing Latest version of COSMOS crashing Jul 19, 2018
@michaellmonaghan
Copy link
Contributor Author

Just reinstalled brew and ran the installer script, no luck.

@ghost
Copy link

ghost commented Jul 23, 2018

Weird. It appears that your as built version of the qtbindings didn't map the tr method (which I think is a translation method for internationalization of labels) to the top level Qt::Object. I'm not sure why this happened but I think I can provide a work around.

Ensure you have a user_version.rb file in your project's lib directory. Normally this file simply sets the USER_VERSION constant like so:

USER_VERSION = "Undefined"

Change this to override the tr method which is missing:

module Qt
  Object.singleton_class.class_eval do
    define_method(:tr) do |label|
      return label
    end
  end
end

@ghost
Copy link

ghost commented Jul 23, 2018

@ryanatball Should we simply remove these methods? We're only using them in a few places and have no plans to do other languages in COSMOS.

@ghost
Copy link

ghost commented Jul 23, 2018

@jasonatball Yes we should remove all uses of tr() as we don't do any internationalization anyways, and that may be a good enough fix for whatever the root cause is here. It should work though... tr() should be a defined method.

I haven't had a chance to try this on a Mac yet.

@michaellmonaghan
Copy link
Contributor Author

@jasonatball your work around did the trick!

@ghost ghost mentioned this issue Jul 30, 2018
@michaellmonaghan
Copy link
Contributor Author

It seems odd that a function would be missing for a particular architecture so I've been debugging. I'll leave this here in case it is of any use.

$ bundle console
irb(main):001:0> require 'Qt'
=> true
irb(main):002:0> puts(Qt::Object.singleton_methods)
connect
staticMetaObject
const_missing
method_missing
new
ancestors
slots
signals
private_slots
q_signal
q_slot
q_classinfo
=> nil

@ghost ghost closed this as completed Aug 6, 2018
@ghost ghost added the bug label Aug 30, 2018
@ghost ghost added this to the v4.3.0 milestone Aug 30, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant