I was getting the following trace when connecting my system to a switch.
The system was not connected to a wifi AP and also the switch was not
connected to any other network, so no dhcp services were available.

I added a patch to check the service before using it as this fixes the
crash, however, let me know if there's a better way to fix this, like
removing the source before the time-out expires, for instance when freeing
the network or the service. I'm not sure where this should be done exactly
but let me know if necessary and I will submit another patch.

network 0x8d51518 name (null)
Jun 27 16:21:44 localhost.localdomain connmand[1186]:
src/dhcp.c:ipv4ll_available_cb() IPV4LL available
Jun 27 16:21:44 localhost.localdomain connmand[1186]: Aborting (signal 11)
[/usr/sbin/connmand]
Jun 27 16:21:44 localhost.localdomain connmand[1186]: ++++++++ backtrace
++++++++
Jun 27 16:21:44 localhost.localdomain connmand[1186]: #0  0xb772e400 in
Jun 27 16:21:44 localhost.localdomain connmand[1186]: #1  0x80812aa in
__connman_network_get_ident() at polkit.c:0
Jun 27 16:21:44 localhost.localdomain connmand[1186]: #2  0x808ef20 in
connman_service_lookup_from_network() at ??:0
Jun 27 16:21:44 localhost.localdomain connmand[1186]: #3  0x80a2bcd in
ipv4ll_available_cb() at dhcp.c:0
Jun 27 16:21:44 localhost.localdomain connmand[1186]: #4  0x8055ef5 in
ipv4ll_announce_timeout() at client.c:0
Jun 27 16:21:44 localhost.localdomain connmand[1186]: #5  0xb763b8bd in
/usr/lib/libglib-2.0.so.0
Jun 27 16:21:44 localhost.localdomain connmand[1186]: #6  0xb763ab2b in
/usr/lib/libglib-2.0.so.0
Jun 27 16:21:44 localhost.localdomain connmand[1186]: #7  0xb763aeb8 in
/usr/lib/libglib-2.0.so.0
Jun 27 16:21:44 localhost.localdomain connmand[1186]: #8  0xb763b3ab in
/usr/lib/libglib-2.0.so.0
Jun 27 16:21:44 localhost.localdomain connmand[1186]: #9  0x807c47d in
main() at polkit.c:0
Jun 27 16:21:44 localhost.localdomain connmand[1186]: #10 0xb733ada6 in
/lib/libc.so.6
Jun 27 16:21:44 localhost.localdomain connmand[1186]:
+++++++++++++++++++++++++++


>From 4f72f1262a12b366b7d7ab96d91f41b4a29f7953 Mon Sep 17 00:00:00 2001
From: Alexandru Costache <[email protected]>
Date: Sat, 28 Jun 2014 05:05:40 -0400
Subject: [PATCH] dhcp: Remove leftover source if service has been freed

    dhcp_retry_cb() will try to use an inexistent service
    causing a crash  when the system is connected to a
    network with no dhcp service providers
    check if service exists and remove source if it doesn't
---
 src/dhcp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/dhcp.c b/src/dhcp.c
index 631d15c..9fb75b2 100644
--- a/src/dhcp.c
+++ b/src/dhcp.c
@@ -222,6 +222,10 @@ static gboolean dhcp_retry_cb(gpointer user_data)
     dhcp->timeout = 0;

     service = connman_service_lookup_from_network(dhcp->network);
+
+    if (!service)
+        return FALSE;
+
     ipconfig = __connman_service_get_ip4config(service);

     g_dhcp_client_start(dhcp->dhcp_client,
-- 
1.8.1.4
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to