Bug 1912441

Summary: libnm functions nm_{device,access_pointer}_filter_connections() causing crashes in pygobject bindings
Product: Red Hat Enterprise Linux 8 Reporter: Radek Vykydal <rvykydal>
Component: NetworkManagerAssignee: NetworkManager Development Team <nm-team>
Status: CLOSED WONTFIX QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.3CC: acardace, atragler, bgalvani, desktop-qa-list, jstodola, lrintel, nm-team, rkhan, rvykydal, sukulkar, thaller, till
Target Milestone: rcKeywords: Triaged
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1873561 Environment:
Last Closed: 2021-01-14 17:51:17 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:
Bug Depends On:    
Bug Blocks: 1812825    

Comment 1 Radek Vykydal 2021-01-04 14:01:12 UTC
Cloned to a separate BZ from bug 1873561 per comment https://bugzilla.redhat.com/show_bug.cgi?id=1873561#c22

Comment 2 Thomas Haller 2021-01-14 17:51:17 UTC
there really isn't much to do here.

The functions are now documented to use with care (ie: don't use them via bindings!):
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/b012877445bddd772eec79e3ce38f93cc40de720


An alternative fix would be to add new, alternative API that doesn't have this problem. However, these 2 functions are rather trivial. I think we don't need to add them, just implement them yourself. You can do so using nm_access_point_connection_valid() and nm_device_connection_valid() -- these latter two are not trivial, but luckily they are part of public API already.


Yet another alternative fix would be to adjust the annotation so that binds work. However, since gobject-bindings doesn't seem to have a clear way how to do that [1], and because different bindings (vala, pygobject) disagree how this is handled, there is no real fix. So, unless [1] is fixed this is not doable. And even then, we would have to take care that it does not break what currently is working: e.g. using these functions from vala currently works and it should keep working. Using them from pygobject was broken for the last two years due to [2].


[1] https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/305
[2] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/201c153e25990f61421be9984ecca5bc71be5845



I'll close this as WONTFIX. Please reopen if you disagree or have a suggestion.