GNU bug report logs -
#9581
24.0.50; dbus-unregister-object fails if service is nil
Previous Next
Reported by: Julien Danjou <julien <at> danjou.info>
Date: Thu, 22 Sep 2011 23:02:01 UTC
Severity: normal
Found in version 24.0.50
Done: Michael Albinus <michael.albinus <at> gmx.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Mon, 26 Sep 2011 15:57:57 +0200
with message-id <87ipofbe3e.fsf <at> gmx.de>
and subject line Re: bug#9581: 24.0.50; dbus-unregister-object fails if service is nil
has caused the debbugs.gnu.org bug report #9581,
regarding 24.0.50; dbus-unregister-object fails if service is nil
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
9581: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9581
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
If you use `dbus-register-signal' with a nil SERVICE value, like:
(dbus-register-signal :session nil
"/org/gtk/Private/RemoteVolumeMonitor"
"org.gtk.Private.RemoteVolumeMonitor" "VolumeAdded"
'identity)
This is valid and works fine. However, on unregister it fails:
Debugger entered--Lisp error: (dbus-error "Call to ReleaseName has wrong args (b, expected s)")
dbus-call-method(:session "org.freedesktop.DBus" "/org/freedesktop/DBus" "org.freedesktop.DBus" "ReleaseName" nil)
dbus-unregister-object(((:session "org.gtk.Private.RemoteVolumeMonitor" "VolumeAdded") (nil "/org/gtk/Private/RemoteVolumeMonitor" identity)))
Why does it fail? Because of the following code in
`dbus-unregister-object':
#+begin_src emacs-lisp
(unless found
(dbus-call-method
bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus
"ReleaseName" service))))
+end_src
And here service is… nil. Which is translated to a boolean (b) but
should be a string (s).
But honestly, I'm not sure what the good fix is. To me, this code is
totally wrong in such a case.
When using `dbus-register-signal', this happens:
1. the dbus_bus_add_match() function is called to add a match on the bus
2. the (match callback) pair is recorded into
`dbus-registered-objets-table'
This makes things work. When a signal happens, something is looking into
`dbus-registered-objets-table' and call the callback function.
But to stop listening for a signal, the function to use is
`dbus-unregister-object', and it is doing this:
1. remove the (match callback) pair from `dbus-registered-objets-table'
2. call ReleaseName on the service we were listening
While I agree on point 1., the point 2. is totally irrelevant in such a
case. There's no need to do such a thing, the name has never been
requested with RequestName before.
I think that:
- step 2 should be removed or another function should be created which
does not send a ReleaseName
- dbus_bus_remove_match() should be used to remove the watch from the
bus, which would be a lot cleaner.
--
Julien Danjou
[Message part 3 (message/rfc822, inline)]
Julien Danjou <julien <at> danjou.info> writes:
> I think you can close this bug, and maybe reopen one if you want to
> track the other changes you want to do after the pretest. You call. :)
OK, closed.
I don't believe we need another bug report just to remind myself ... I
tend to forget everything (ask my wife!), but this patch is already
prepared in my local repo. I should find it after the release.
Thanks for your patient testing, and best regards, Michael.
This bug report was last modified 13 years and 240 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.