Ticket #34 (closed defect: fixed)

Opened 9 years ago

Last modified 9 years ago

No introspect with ubuntu karmic

Reported by: flagospub@… Owned by: anonymous
Priority: normal Milestone:
Component: library Version: 0.2.1
Keywords: introspect ubuntu Cc: miaoufkirsh@…, lsdark73@…, flagospub@…

Description

I tried to execute the script given on Cc. This was inspired from the ones givent into example directory. When executing introspect function, it gave me this error:

/usr/local/lib/site_ruby/1.8/dbus/bus.rb:546:in `process': undefined method `get_node' for nil:NilClass (NoMethodError)
	from /usr/local/lib/site_ruby/1.8/dbus/bus.rb:498:in `send_sync'
	from /usr/local/lib/site_ruby/1.8/dbus/bus.rb:352:in `introspect_data'
	from /usr/local/lib/site_ruby/1.8/dbus/introspect.rb:444:in `introspect'
	from client_dbus.rb:14

This bug doesn't appear all the time: Sometimes it works, sometimes not ! Please see below:

flagos@flagos-desktop:~/bin/test_opOS$ /usr/bin/ruby1.8 client_dbus.rb
/usr/local/lib/site_ruby/1.8/dbus/bus.rb:546:in `process': undefined method `get_node' for nil:NilClass (NoMethodError)
	from /usr/local/lib/site_ruby/1.8/dbus/bus.rb:498:in `send_sync'
	from /usr/local/lib/site_ruby/1.8/dbus/bus.rb:352:in `introspect_data'
	from /usr/local/lib/site_ruby/1.8/dbus/introspect.rb:444:in `introspect'
	from client_dbus.rb:14

flagos@flagos-desktop:~/bin/test_opOS$ /usr/bin/ruby1.8 client_dbus.rb
We have Rhythmbox Player interface

This bug has been reproduced on 2 others PC of a friend of mine. Another friend with the same distro didn't reproduce this bug...

I don't know if it is related with this particular distro or not. This bug seems to be related with #29 but #29 should has been patched with v0.2.12, which is the version we test.

Change History

Changed 9 years ago by flagospub@…

My attached file is considered as spam (arghhh), i give the content of my script by this way:

#!/usr/bin/env ruby
 
require "dbus"
 
session_bus = DBus::SessionBus.instance
 
# Get the Rhythmbox service
rhythmbox = session_bus.service("org.gnome.Rhythmbox")
 
# Get the object from this service
player = rhythmbox.object("/org/gnome/Rhythmbox/Player")
 
# Introspect it
player.introspect
if player.has_iface? "org.gnome.Rhythmbox.Player"
  puts "We have Rhythmbox Player interface"
end

Please note this bug can also be reproduced with notification system.

Changed 9 years ago by martin.github@…

  • owner changed from nobody to anonymous
  • status changed from new to assigned

Are you sure you are testing 0.2.12? On line 546, there is no get_node call:  http://github.com/mvidner/ruby-dbus/blob/v0.2.12/lib/dbus/bus.rb#L546

Where did you get the library from?

Changed 9 years ago by flagospub@…

  • cc miaoufkirsh@…, lsdark73@…, flagospub@… added; miaoufkirsh@… removed

Hi,

First thank you for your answer!

The version we use is v0.2.12. I get it from this website, on https://trac.luon.net/ruby-dbus/. Therefore, the package seems to have been modified since I download it in some limited places.

When I download it et do installation process again, the bug on get_node is now at line 540, please have a look:

flagos@flagos-desktop:~/bin/test_opOS$ ./client_dbus.rb
We have Rhythmbox Player interface

flagos@flagos-desktop:~/bin/test_opOS$ ./client_dbus.rb
/usr/local/lib/site_ruby/1.8/dbus/bus.rb:540:in `process': undefined method `get_node' for nil:NilClass (NoMethodError)
	from /usr/local/lib/site_ruby/1.8/dbus/bus.rb:492:in `send_sync'
	from /usr/local/lib/site_ruby/1.8/dbus/bus.rb:351:in `introspect_data'
	from /usr/local/lib/site_ruby/1.8/dbus/introspect.rb:444:in `introspect'
	from ./client_dbus.rb:14

Let us know if you need further information to help debug.

Changed 9 years ago by vbernetr

I can confirm this bug, both in the ubuntu package, and on 0.1.12 freshly downloaded from the site. I'm running D-Bus Message Bus Daemon 1.2.16, if that helps.

Sometimes, I get the following :

irb(main):030:0> rb_player.introspect
LocalJumpError: unexpected return
	from ./dbus/bus.rb:355:in `introspect_data'
	from ./dbus/bus.rb:531:in `call'
	from ./dbus/bus.rb:531:in `process'
	from ./dbus/bus.rb:487:in `send_sync'
	from ./dbus/bus.rb:351:in `introspect_data'
	from ./dbus/introspect.rb:444:in `introspect'
	from (irb):30

This appears to be caused by a return in a block which gets passed to send_sync. The offending return is on line 355 in bus.rb.

Changed 9 years ago by martin.github@…

OK, I've got hold of Karmic to try it out.

It turns out that as soon as we connect to the session bus, another process calls Introspect on us for whatever reason. It is /usr/lib/indicator-messages/indicator-messages-service from the package indicator-messages.

The library has a bug in assuming that as long as we don't explicitly export anything, nobody will call us.

Changed 9 years ago by martin.github@…

  • status changed from assigned to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.