[Bug 812913] Re: poor console performance if dbus-launch run with "--exit-with-session"

atimonin atimonin at online.ru
Tue Nov 20 11:52:38 UTC 2012


The same problem affects me also (I login to remote server via ssh with X11 forwarding).
The real problem is that dbus-launch is "eating" chars from stdin (tty) while waiting for SIGHUP.
I don't understand what for it's reading stdin while waiting for SIGHUP...
Below is a smple code:
------------
if (tty_fd >= 0)
        {
          if (FD_ISSET (tty_fd, &read_set))
            {
              int bytes_read;
              char discard[512];

              verbose ("TTY ready for reading\n");
              
              bytes_read = read (tty_fd, discard, sizeof (discard));

              verbose ("Read %d bytes from TTY errno = %d\n",
                       bytes_read, errno);
              
              if (bytes_read == 0)
                kill_bus_and_exit (0); /* EOF */
              else if (bytes_read < 0 && errno != EINTR)
                {
                  /* This shouldn't happen I don't think; to avoid
                   * spinning on the fd forever we exit.
                   */
                  fprintf (stderr, "dbus-launch: error reading from stdin: %s\n",
                           strerror (errno));
                  kill_bus_and_exit (0);
                }
            }
          else if (FD_ISSET (tty_fd, &err_set))
            {
              verbose ("TTY has error condition\n");
              
              kill_bus_and_exit (0);
            }
        }
    }
--------------

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to dbus in Ubuntu.
https://bugs.launchpad.net/bugs/812913

Title:
  poor console performance if dbus-launch run with "--exit-with-session"

Status in “dbus” package in Ubuntu:
  New

Bug description:
  Running dbus-launch from the console results in very poor performance
  (keyboard keys need to be held down for multiple seconds for an echo
  of that character to appear on the console).

  To recreate:

    killall dbus-launch &>/dev/null
    eval `dbus-launch --auto-syntax --exit-with-session`
    start typing :-)

  Note that the problem only occurs with "--exit-with-session": This
  invocation is fine:

    killall dbus-launch &>/dev/null
    eval `dbus-launch --auto-syntax`

  Problem appears to be related to function tools/dbus-
  launch.c:kill_bus_when_session_ends() which is calling select(2)
  followed by read(2) in an infinite loop (until the shell exits) for
  all input the user types.

  Poor performance observed in oneiric VM (kvm).

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dbus/+bug/812913/+subscriptions




More information about the foundations-bugs mailing list