GNOME Bugzilla – Bug 755170
NM never receives external DHCP client helper information with DHCPv4+IPv6 manual
Last modified: 2015-10-03 07:54:39 UTC
With git master as of 2015-09-17, if you have DHCPv4 configured with dhclient and IPv6 manual, NM never receives the response from the DHCP client helper. NM does see the private socket being opened and then closed and new_connection_cb() is run, but nm-dhcp-listener.c::handle_event() is never run. Possibly something due to the GDBus conversion and the recent bus-manager changes? Since this is a private socket and everything is run synchronously we should be able to subscribe to the signal before its sent and thus receive it, but I'm not sure why things aren't happening. NetworkManager[24494]: <debug> [1442505884.783379] [nm-bus-manager.c:213] private_server_new_connection(): (dhcp) accepted connection 0xf8c4a0 on private socket. <printf debugging indicates new_connection_cb() gets run here> <but no handle_event() gets run> NetworkManager[24494]: <debug> [1442505884.790540] [nm-bus-manager.c:179] private_server_closed(): (dhcp) closed connection 0xf8c4a0 on private socket.
Created attachment 312269 [details] [review] [PATCH] bus-manager: fix race condition in handling of incoming signals The attached patch apparently fixes the problem; even after some time spent debugging GDBusConnection and GDBusServer I'm still not sure if this is the right approach, though.
(In reply to Beniamino Galvani from comment #1) > Created attachment 312269 [details] [review] [review] > [PATCH] bus-manager: fix race condition in handling of incoming signals > > The attached patch apparently fixes the problem; even after some time spent > debugging GDBusConnection and GDBusServer I'm still not sure if this is the > right approach, though. doesn't this run private_server_new_connection() on a separate thread? I think that cause a multi-threadding issue... few code is actually thread-safe, and you cannot do this arbitrarily.
Created attachment 312434 [details] [review] [PATCH v2] bus-manager: fix handling of incoming signals (In reply to Thomas Haller from comment #2) > doesn't this run private_server_new_connection() on a separate thread? > > I think that cause a multi-threadding issue... few code is actually > thread-safe, and you cannot do this arbitrarily. Yeah, that's right. In any case, I suspect this is a bug in GDBusServer which schedules the closed callback before deliverying signals. New patch attached.
(In reply to Beniamino Galvani from comment #3) > Created attachment 312434 [details] [review] [review] > [PATCH v2] bus-manager: fix handling of incoming signals > > (In reply to Thomas Haller from comment #2) > > doesn't this run private_server_new_connection() on a separate thread? > > > > I think that cause a multi-threadding issue... few code is actually > > thread-safe, and you cannot do this arbitrarily. > > Yeah, that's right. In any case, I suspect this is a bug in GDBusServer > which schedules the closed callback before deliverying signals. New patch > attached. I'd use g_slice_new(). Otherwise LGTM
LGTM
(In reply to Thomas Haller from comment #4) > I'd use g_slice_new(). Fixed and applied to master: 7c5518ac8d8c bus-manager: fix handling of incoming signals