[Bug 1303649] Re: systemd-logind spins in cgmanager_ping_sync()

2014-04-11 Thread Serge Hallyn
** Also affects: lxc (Ubuntu)
   Importance: Undecided
   Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to lxc in Ubuntu.
https://bugs.launchpad.net/bugs/1303649

Title:
  systemd-logind spins in cgmanager_ping_sync()

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

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 1303649] Re: systemd-logind spins in cgmanager_ping_sync()

2014-04-11 Thread Serge Hallyn
** Changed in: lxc (Ubuntu)
   Status: New = Confirmed

** Changed in: lxc (Ubuntu)
   Importance: Undecided = High

** Changed in: systemd (Ubuntu)
   Status: New = Confirmed

** Changed in: systemd (Ubuntu)
   Importance: Undecided = High

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to lxc in Ubuntu.
https://bugs.launchpad.net/bugs/1303649

Title:
  systemd-logind spins in cgmanager_ping_sync()

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

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 1303649] Re: systemd-logind spins in cgmanager_ping_sync()

2014-04-11 Thread Serge Hallyn
Actually the source of the problem is that I was calling
nih_dbus_setup(), which actually sets up the mainloop.  It is not needed
- as I thought it was - for making *_sync calls from cgmanager-
client.so.  So the right fix is to not call that.

Two comments on this.  First, nih_dbus_setup() seems misleadingly named,
though that may just be how I read it.  The comments above that function
are plenty clear and I should have seen those.

Second, the default nih dbus connection is a shared one, which always
does nih_dbus_setup().  So for anyone to use libcgmanager without a nih
mainloop, they  *must* use the dbus_connection_open_private().  We
should probably mention that somewhere  in the libcgmanager
documentation.

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to lxc in Ubuntu.
https://bugs.launchpad.net/bugs/1303649

Title:
  systemd-logind spins in cgmanager_ping_sync()

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

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 1303649] Re: systemd-logind spins in cgmanager_ping_sync()

2014-04-11 Thread James Hunt
Right. So to be completely clear, by calling nih_dbus_setup(), nih was
registering a libdbus handler that runs on the client side such that
whenever libdbus deemed necessary, it would attempt to wake up the
clients main loop by calling nih_main_loop_interrupt(). However, since
the client didn't have an nih main loop, the interrupt pipe was never
drained and eventually filled leading to the EAGAIN tight loop.

Yes, I agree - maybe it should have been called
nih_dbus_main_loop_setup() to make its usage clearer.

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to lxc in Ubuntu.
https://bugs.launchpad.net/bugs/1303649

Title:
  systemd-logind spins in cgmanager_ping_sync()

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

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 1303649] Re: systemd-logind spins in cgmanager_ping_sync()

2014-04-11 Thread Launchpad Bug Tracker
** Branch linked: lp:ubuntu/trusty-proposed/systemd

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to lxc in Ubuntu.
https://bugs.launchpad.net/bugs/1303649

Title:
  systemd-logind spins in cgmanager_ping_sync()

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

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 1303649] Re: systemd-logind spins in cgmanager_ping_sync()

2014-04-11 Thread Launchpad Bug Tracker
This bug was fixed in the package lxc - 1.0.3-0ubuntu2

---
lxc (1.0.3-0ubuntu2) trusty; urgency=medium

  * Cherry-pick upstream fix for cgmanager integration. (LP: #1303649)
 -- Stephane Graber stgra...@ubuntu.com   Fri, 11 Apr 2014 12:17:41 -0400

** Changed in: lxc (Ubuntu)
   Status: Confirmed = Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to lxc in Ubuntu.
https://bugs.launchpad.net/bugs/1303649

Title:
  systemd-logind spins in cgmanager_ping_sync()

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

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 1303649] Re: systemd-logind spins in cgmanager_ping_sync()

2014-04-11 Thread Serge Hallyn
** Changed in: libnih (Ubuntu)
   Status: Confirmed = Invalid

** Changed in: cgmanager (Ubuntu)
   Status: Confirmed = Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to lxc in Ubuntu.
https://bugs.launchpad.net/bugs/1303649

Title:
  systemd-logind spins in cgmanager_ping_sync()

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

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 1303649] Re: systemd-logind spins in cgmanager_ping_sync()

2014-04-11 Thread Launchpad Bug Tracker
This bug was fixed in the package systemd - 204-5ubuntu19

---
systemd (204-5ubuntu19) trusty; urgency=medium

  * cgmanager: don't call nih_dbus_setup() since we won't use the
nih_mainloop().  (LP: #1303649)
 -- Serge Hallyn serge.hal...@ubuntu.com   Fri, 11 Apr 2014 10:17:04 -0500

** Changed in: systemd (Ubuntu)
   Status: Confirmed = Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to lxc in Ubuntu.
https://bugs.launchpad.net/bugs/1303649

Title:
  systemd-logind spins in cgmanager_ping_sync()

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

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 1303649] Re: systemd-logind spins in cgmanager_ping_sync()

2014-04-10 Thread Stéphane Graber
The stacktrace suggests we are in libcgmanager, so adding a cgmanager
task.

** Also affects: cgmanager (Ubuntu)
   Importance: Undecided
   Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to cgmanager in Ubuntu.
https://bugs.launchpad.net/bugs/1303649

Title:
  systemd-logind spins in cgmanager_ping_sync()

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

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 1303649] Re: systemd-logind spins in cgmanager_ping_sync()

2014-04-10 Thread Serge Hallyn
It turns out the write() is not a part of the dbus transaction with
cgmanager, but actually a part of libnih's mainloop exiting code:

(gdb) where 
#0  0x7f70ea509700 in __write_nocancel () at 
../sysdeps/unix/syscall-template.S:81
#1  0x7f70eae47377 in nih_main_loop_interrupt () at main.c:630
#2  0x7f70eaa0d64b in _dbus_transport_queue_messages 
(transport=transport@entry=0x2329290) at ../../dbus/dbus-transport.c:1157
#3  0x7f70eaa0df8e in do_reading (transport=0x2329290) at 
../../dbus/dbus-transport-socket.c:851
#4  0x7f70eaa0e626 in socket_do_iteration (transport=0x2329290, flags=6, 
timeout_milliseconds=optimized out) at ../../dbus/dbus-transport-socket.c:1162
#5  0x7f70eaa0d3ff in _dbus_transport_do_iteration (transport=0x2329290, 
flags=3940863025, flags@entry=6, timeout_milliseconds=1, 
timeout_milliseconds@entry=25000) at ../../dbus/dbus-transport.c:976
#6  0x7f70ea9f79dc in _dbus_connection_do_iteration_unlocked 
(connection=connection@entry=0x232d580, pending=pending@entry=0x232bf90, 
flags=flags@entry=6, 
timeout_milliseconds=timeout_milliseconds@entry=25000) at 
../../dbus/dbus-connection.c:1234
#7  0x7f70ea9f8389 in _dbus_connection_block_pending_call 
(pending=0x232bf90) at ../../dbus/dbus-connection.c:2415
#8  0x7f70eaa0772a in dbus_pending_call_block (pending=optimized out) at 
../../dbus/dbus-pending-call.c:748
#9  0x7f70ea9f894d in dbus_connection_send_with_reply_and_block 
(connection=0x232d580, message=0x23056e0, timeout_milliseconds=-1, 
error=0x7fff22097b70)
at ../../dbus/dbus-connection.c:3530
#10 0x7f70eb05b4f5 in cgmanager_create_sync () from 
/lib/x86_64-linux-gnu/libcgmanager.so.0
#11 0x00422520 in ?? ()
#12 0x004164a4 in ?? ()
#13 0x0041655d in ?? ()
#14 0x0040f3ed in ?? ()
#15 0x004107dc in ?? ()
#16 0x0040c4d3 in ?? ()
#17 0x7f70eaa06e26 in _dbus_object_tree_dispatch_and_unlock 
(tree=0x22f92a0, message=message@entry=0x22fb9d0, 
found_object=found_object@entry=0x7fff22098114)
at ../../dbus/dbus-object-tree.c:862
#18 0x7f70ea9f9a01 in dbus_connection_dispatch (connection=0x22f8870) at 
../../dbus/dbus-connection.c:4672
#19 0x00409467 in ?? ()
#20 0x0040622c in ?? ()
#21 0x7f70ea43eec5 in __libc_start_main (main=0x4060d0, argc=1, 
argv=0x7fff220982d8, init=optimized out, fini=optimized out, 
rtld_fini=optimized out, 
stack_end=0x7fff220982c8) at libc-start.c:287
#22 0x0040637c in ?? ()

This is happening in this part of nih/main.c:

/**
 * nih_main_loop_interrupt:
 *
 * Interrupts the current (or next) main loop iteration because of an
 * event that potentially needs immediate processing, or because some
 * condition of the main loop has been changed.
 **/
void
nih_main_loop_interrupt (void)
{
nih_main_loop_init ();

if (interrupt_pipe[1] != -1)
while (write (interrupt_pipe[1], , 1)  0)
;
}

Why the interrupt_pipe[0] woudl be closed is beyond me.

A simple fix would be to add a check for errno == EAGAIN in the while
loop to avoid this condition.  However, we should figure out why this is
happening and hopefully we can prevent it happening at all.

** Also affects: libnih (Ubuntu)
   Importance: Undecided
   Status: New

** Changed in: libnih (Ubuntu)
   Importance: Undecided = High

** Changed in: libnih (Ubuntu)
   Status: New = Confirmed

** Changed in: cgmanager (Ubuntu)
   Importance: Undecided = High

** Changed in: cgmanager (Ubuntu)
   Status: New = Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to cgmanager in Ubuntu.
https://bugs.launchpad.net/bugs/1303649

Title:
  systemd-logind spins in cgmanager_ping_sync()

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

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs