Description of problem:
<trace> [1526650954.1491] dbus-object[0x2387170]: unexport: "/org/freedesktop/NetworkManager/Settings"
NetworkManager:ERROR:src/settings/nm-settings.c:1939:finalize: assertion failed: (c_list_is_empty (&priv->connections_lst_head))
NetworkManager.service: Main process exited, code=dumped, status=6/ABRT
Version-Release number of selected component (if applicable):
git master (5e8c12eecefb18cd335e24d46a38f66210e6b8e9)
Steps to Reproduce:
1. Disconnect all devices
2. Stop NM
Created attachment 1438738 [details]
[PATCH] settings: remove connections from list on finalize()
(In reply to Beniamino Galvani from comment #3)
> Created attachment 1438738 [details]
> [PATCH] settings: remove connections from list on finalize()
the fact that we still have connections at the end is a bug on it's own.
It's not enough to just unlink them, you should at least try to unregister as well as possibly (by doing in parts what connection_removed() does).
But until we fix shutdown properly, maybe a simpler solution is that whenever a connection is added/remove in NMSettings, it references also NMSettings. Of course, this means, at exit we will now also leak NMSettings. But that is a good enough workaround for the moment. Obviously, we don't properly tear down our stuff at the end anyway.
Created attachment 1446757 [details]
[PATCH v2] settings: let connections keep NMSettings alive
How about now?
Applied to master with Thomas' ack:
*** Bug 1568387 has been marked as a duplicate of this bug. ***