GNU bug report logs - #11415
24.1.50; Dbus hangs indefinitely during batch mode & daemon startup

Previous Next

Package: emacs;

Reported by: "Ryan C. Thompson" <rct <at> thompsonclan.org>

Date: Sat, 5 May 2012 21:57:02 UTC

Severity: normal

Tags: patch

Found in version 24.1.50

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 11415 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: "Ryan C. Thompson" <rct <at> thompsonclan.org>
Cc: 11415 <at> debbugs.gnu.org
Subject: Re: bug#11415: 24.1.50;
	Dbus hangs indefinitely during batch mode & daemon startup
Date: Sun, 06 May 2012 12:59:54 +0200
"Ryan C. Thompson" <rct <at> thompsonclan.org> writes:

> It seems that during the startup of any emacs without a terminal
> (i.e. "--batch" or "--daemon"), recent emacs snapshots cannot make dbus
> calls. Worse, any attempt to make a dbus call will hang
> indefinitely. This stops me from being able to use some of my config in
> emacs, since it is dbus based and cannot be loaded on startup in daemon
> mode.
>
> Specifically, I can easily reproduce the bug like this:
>
> emacs-snapshot -Q --batch -l dbus --eval '(message
>  "DBus system names: %s"
>  (dbus-call-method :system dbus-service-dbus
>   dbus-path-dbus dbus-interface-dbus "ListNames"))'

In Emacs 24.1.50, `dbus-call-method' changed from a synchronous call to
an asynchronous one (see etc/NEWS). If Emacs runs in batch mode, it
doesn't seem to read incoming events. Therefore, the return event of the
call is not read.

I will see what can be done. Either we must enable Emacs to receive some
special input events also in batch mode. Or we must check inside
`dbus-call-method', whether Emacs runs daemonized, and use the blocking
call then.

I would prefer the first alternative, because receiving D-Bus signals and
running Emacs as D-Bus enabled server does not work either when Emacs
does not accept incoming events.

> There is no backtrace or anything, because the dbus call never
> returns.

In theory, it shall accept at least timeouts, like 

emacs -Q --daemon -l dbus --eval \
  '(message "DBus system names: %s" \
     (dbus-call-method \
      :system dbus-service-dbus dbus-path-dbus dbus-interface-dbus \
      "ListNames" :timeout 5000))'

But it doesn't, which is another bug to be fixed.

Best regards, Michael.




This bug report was last modified 13 years and 7 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.