Bug 1579858

Summary: [NMCI] Failed assertion on NM shutdown
Product: Red Hat Enterprise Linux 7 Reporter: Beniamino Galvani <bgalvani>
Component: NetworkManagerAssignee: Beniamino Galvani <bgalvani>
Status: CLOSED UPSTREAM QA Contact: Desktop QE <desktop-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: atragler, bgalvani, fgiudici, lrintel, rkhan, sukulkar, thaller
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-03 14:51:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
[PATCH] settings: remove connections from list on finalize()
none
[PATCH v2] settings: let connections keep NMSettings alive none

Description Beniamino Galvani 2018-05-18 13:53:36 UTC
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

Comment 3 Beniamino Galvani 2018-05-18 17:01:03 UTC
Created attachment 1438738 [details]
[PATCH] settings: remove connections from list on finalize()

Comment 4 Thomas Haller 2018-05-23 13:48:46 UTC
(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.

Comment 5 Beniamino Galvani 2018-06-01 17:00:53 UTC
Created attachment 1446757 [details]
[PATCH v2] settings: let connections keep NMSettings alive

Comment 6 Beniamino Galvani 2018-06-02 08:54:37 UTC
How about now?

Comment 7 Beniamino Galvani 2018-06-03 14:51:23 UTC
Applied to master with Thomas' ack:

https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=3fb4eed3ef19806f497076e1a94b5a7418ab8d7d

Comment 8 Beniamino Galvani 2018-06-08 12:13:17 UTC
*** Bug 1568387 has been marked as a duplicate of this bug. ***