From 8810036895e4a3053d447c7a50af08fbc2560375 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Thu, 13 Aug 2015 10:28:52 +0200 Subject: [PATCH] device: don't assert the platform device's not there upon creation attempt It might just be that we didn't see it yet; either on daemon startup on in a race. The nm_platform_*_add() deals with the device already being there in _link_add_check_existing(). NetworkManager:ERROR:devices/nm-device-bridge.c:402:create_and_realize: assertion failed: (nm_device_get_ifindex (device) <= 0) Program received signal SIGABRT, Aborted. 0x00007ffff46965d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 56 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig); Missing separate debuginfos, use: debuginfo-install bluez-libs-5.23-4.el7.x86_64 (gdb) bt #0 0x00007ffff46965d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #1 0x00007ffff4697cc8 in __GI_abort () at abort.c:90 #2 0x00007ffff4a916d5 in g_assertion_message (domain=domain@entry=0x5a5088 "NetworkManager", file=file@entry=0x59b0f2 "devices/nm-device-bridge.c", line=line@entry=402, func=func@entry=0x59b3f0 <__FUNCTION__.29169> "create_and_realize", message=message@entry=0xa76a30 "assertion failed: (nm_device_get_ifindex (device) <= 0)") at gtestutils.c:2292 #3 0x00007ffff4a9176a in g_assertion_message_expr (domain=domain@entry=0x5a5088 "NetworkManager", file=file@entry=0x59b0f2 "devices/nm-device-bridge.c", line=line@entry=402, func=func@entry=0x59b3f0 <__FUNCTION__.29169> "create_and_realize", expr=expr@entry=0x59aef8 "nm_device_get_ifindex (device) <= 0") at gtestutils.c:2307 #4 0x0000000000447cb6 in create_and_realize (device=0xa77f40 [NMDeviceBridge], connection=0x8d0200, parent=, out_plink=0x7fffffffd700, error=0x0) at devices/nm-device-bridge.c:402 #5 0x000000000045d560 in nm_device_create_and_realize (self=self@entry=0xa77f40 [NMDeviceBridge], connection=connection@entry=0x8d0200, parent=, error=error@entry=0x0) at devices/nm-device.c:1594 #6 0x00000000004d4b64 in system_create_virtual_device (self=self@entry=0x8802b0 [NMManager], connection=connection@entry=0x8d0200, error=error@entry=0x0) at nm-manager.c:983 #7 0x00000000004d4d71 in system_create_virtual_devices (self=0x8802b0 [NMManager]) at nm-manager.c:1022 #8 0x00000000004d47a5 in add_device (self=, device=, try_assume=) at nm-manager.c:1785 #9 0x00000000004d501f in platform_link_added (self=self@entry=0x8802b0 [NMManager], ifindex=, plink=plink@entry=0xa7f810) at nm-manager.c:1887 #10 0x00000000004d7c24 in nm_manager_start (self=0x8802b0 [NMManager]) at nm-manager.c:1959 #11 0x00000000004d7c24 in nm_manager_start (self=self@entry=0x8802b0 [NMManager], error=error@entry=0x7fffffffd930) at nm-manager.c:4178 #12 0x00000000004459ec in main (argc=1, argv=0x7fffffffda88) at main.c:442 (gdb) --- src/devices/nm-device-bond.c | 1 - src/devices/nm-device-bridge.c | 1 - src/devices/nm-device-infiniband.c | 1 - src/devices/nm-device-vlan.c | 1 - 4 files changed, 4 deletions(-) diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c index d7a0e9a408..b47b199992 100644 --- a/src/devices/nm-device-bond.c +++ b/src/devices/nm-device-bond.c @@ -470,7 +470,6 @@ create_and_realize (NMDevice *device, NMPlatformError plerr; g_assert (iface); - g_assert (nm_device_get_ifindex (device) <= 0); g_assert (out_plink); plerr = nm_platform_bond_add (NM_PLATFORM_GET, iface, out_plink); diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c index 8d6caa94f4..4dc180083f 100644 --- a/src/devices/nm-device-bridge.c +++ b/src/devices/nm-device-bridge.c @@ -399,7 +399,6 @@ create_and_realize (NMDevice *device, NMPlatformError plerr; g_assert (iface); - g_assert (nm_device_get_ifindex (device) <= 0); g_assert (out_plink); s_bridge = nm_connection_get_setting_bridge (connection); diff --git a/src/devices/nm-device-infiniband.c b/src/devices/nm-device-infiniband.c index c4c21f9d1c..13ee252bb4 100644 --- a/src/devices/nm-device-infiniband.c +++ b/src/devices/nm-device-infiniband.c @@ -243,7 +243,6 @@ create_and_realize (NMDevice *device, int parent_ifindex, p_key; NMPlatformError plerr; - g_assert (nm_device_get_ifindex (device) <= 0); g_assert (out_plink); if (!NM_IS_DEVICE_INFINIBAND (parent)) { diff --git a/src/devices/nm-device-vlan.c b/src/devices/nm-device-vlan.c index eb3b146e25..4306d16887 100644 --- a/src/devices/nm-device-vlan.c +++ b/src/devices/nm-device-vlan.c @@ -177,7 +177,6 @@ create_and_realize (NMDevice *device, int parent_ifindex, vlan_id; NMPlatformError plerr; - g_assert (nm_device_get_ifindex (device) <= 0); g_assert (out_plink); s_vlan = nm_connection_get_setting_vlan (connection);