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

Comments

Projects
None yet
3 participants
@michaellmonaghan
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 from Latest version of CmdTlmServer crashing to Latest version of COSMOS CmdTlmServer crashing Jul 19, 2018

@michaellmonaghan michaellmonaghan changed the title from Latest version of COSMOS CmdTlmServer crashing to Latest version of COSMOS crashing Jul 19, 2018

@michaellmonaghan

This comment has been minimized.

Contributor

michaellmonaghan commented Jul 23, 2018

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

@jasonatball

This comment has been minimized.

Collaborator

jasonatball 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
@jasonatball

This comment has been minimized.

Collaborator

jasonatball 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.

@ryanatball

This comment has been minimized.

Member

ryanatball 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

This comment has been minimized.

Contributor

michaellmonaghan commented Jul 27, 2018

@jasonatball your work around did the trick!

@jasonatball jasonatball referenced this issue Jul 30, 2018

Merged

Remove tr #850

@michaellmonaghan

This comment has been minimized.

Contributor

michaellmonaghan commented Jul 30, 2018

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

@jasonatball jasonatball closed this Aug 6, 2018

@ryanatball ryanatball added the bug label Aug 30, 2018

@ryanatball ryanatball added this to the v4.3.0 milestone Aug 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment