Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

th/platform_route_pt2 #24

Closed
wants to merge 12 commits into from
Closed

th/platform_route_pt2 #24

wants to merge 12 commits into from

Conversation

thom311
Copy link
Member

@thom311 thom311 commented Aug 11, 2017

Adjust caching of routes in platform.

(the last commit is still WIP. Please review the rest :) tks)

nm_dedup_multi_entry_get_obj (const NMDedupMultiEntry *entry)
{
/* convenience method that allows to skip the %NULL check on
* @entry. Think of the NULL-conditinal operator ?. of C# */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conditiOnal

* @entry_order (otherwise before). If @entry_order is %NULL, %TRUE means to
* move @entry to the end of the list (otherwise the beginning).
* Note that @order_after %TRUE, means to link @entry after @entry_order,
* but it means to link @entry before the list's head (to become the tail).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, not very clear to me what this last sentence mean... if @order_after is TRUE, then @entry will never be linked before the list's HEAD, isn't it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CList is a circular list. So, linking "before" the head, means to link at the tail of the list. order_after=TRUE means to link at the tail -- hence: before the head.

Anyway, I reword the comment...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, now I got it

Copy link
Contributor

@fgiudici fgiudici left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Branch looks good to me (skipped the WiP commit msg).

Typo in second commit message:
"improve logging of netlink messa_a_ge"

@thom311
Copy link
Member Author

thom311 commented Aug 11, 2017

Thanks. Addressed comments and repushed branch

We already had a nmp_object_id_equal() function. Generally, an equal() function
is more useful then a cmp() function.

However, implementing a cmp() function is about the same effort then implementing
an equal() function. Also, an equal function can be trivially implemented based on
a compare function, but not the other way around.

That means, it is little extra effort to have both an equal() function
and a cmp() function. Add nmp_object_id_cmp(). If only to be
consistent with other code, which also provides both.
Default g_log() logs to stdout for INFO level and higher, but logs to stderr
for DEBUG/TRACE. That is annoying, because especially when redirecting the streams,
the messages get mixed up. Install a log handler and just print to stdout for
the tests.
…::/0"

IPv6 routes without source are common. Simplify the output in this case.
Also log the nlmsg_flags, they will be useful for RTM_NEWROUTE messages.
This allows to reorder elements in NMDedupMultiIndex.
NMPCache can preserve the order of the objects. Until now, the order
was however arbitrary. Soon we will require to preserve the order of
routes.

During a dump, force appending new objects at the end. That ensures,
correct ordering during the dump.

Note that we track objects in several distrinct indexes. Those partition the
set of all objects. Outside a dump when receiving events about new objects (e.g.
RTM_NEWROUTE), it is very unclear at which place the new object should be sorted.
It is especially unclear, as an object might move from one partition (of
an index) to another.
In general, a deterministic order will only be useful in one particular
instance: the NMP_CACHE_ID_TYPE_ROUTES_BY_DESTINATION index for routes.
In this case, we will ensure a particular order of the routes.
Until now, NetworkManager's platform cache for routes used the quadruple
network/plen,metric,ifindex for equaliy. That is not kernel's
understanding of how routes behave. For example, with `ip route append`
you can add two IPv4 routes that only differ by their gateway. To
the previous form of platform cache, these two routes would wrongly
look identical, as the cache could not contain both routes. This also
easily leads to cache-inconsistencies.

Now that we have NM_PLATFORM_IP_ROUTE_CMP_TYPE_ID, fix the route's
compare operator to match kernel's.

Well, not entirely. Kernel understands more properties for routes then
NetworkManager. Some of these properties may also be part of the ID according
to kernel. To NetworkManager such routes would still look identical as
they only differ in a property that is not understood. This can still
cause cache-inconsistencies. The only fix here is to add support for
all these properties in NetworkManager as well. However, it's less serious,
because with this commit we support several of the more important properties.
See also the related bug rh#1337855 for kernel.

Another difficulty is that `ip route replace` and `ip route change`
changes an existing route. The replaced route has the same
NM_PLATFORM_IP_ROUTE_CMP_TYPE_WEAK_ID, but differ in the actual
NM_PLATFORM_IP_ROUTE_CMP_TYPE_ID:

    # ip -d -4 route show dev v
    # ip monitor route &
    # ip route add 192.168.5.0/24 dev v
    192.168.5.0/24 dev v scope link
    # ip route change 192.168.5.0/24 dev v scope 10
    192.168.5.0/24 dev v scope 10
    # ip -d -4 route show dev v
    unicast 192.168.5.0/24 proto boot scope 10

Note that we only got one RTM_NEWROUTE message, although from NMPCache's
point of view, a new route (with a particular ID) was added and another
route (with a different ID) was deleted. The cumbersome workaround is,
to keep an ordered list of the routes, and figure out which route was
replaced in response to an RTM_NEWROUTE. In absence of bugs, this should
work fine. However, as we only rely on events, we might wrongly
introduce a cache-inconsistancy as well. See the related bug rh#1337860.

Also drop nm_platform_ip4_route_get() and the like. The ID of routes
is complex, so it makes little sense to look up a route directly.
Deleting an IPv4 route with metric zero will either delete the intended route,
or if no such route exists, it will delete another existing route with different
metric (but otherwise matching parameters).

I think this is a shortcoming of the kernel API. It allows omitting
the metric during delete. However, it gives not way to express to
explicitly delete an IPv4 route with metric zero, but no other.

Since we only delete routes that we obtain from the platform cache
in the first place, we don't need the workaround. Of course, there
is still a race that platform cache might be out of date at the
moment we attempt to delete the route. Or the cache might be
inconsistent, both cases leading to deletion of the wrong route.
But such cases should be very rare, and only present when the user
changes the routing table outside of NM.
nmp_lookup_init_route_visible() was originally named this way, to only return routes
that are nmp_object_is_visible(). However, all routes are visible (as long as they are
nmp_object_is_alive()). Hence, this is a historic misnomer.

Also, passing @only_default FALSE is identical to the
nmp_lookup_init_addrroute() lookup.

So, rename the function to indicate it is a lookup for default routes
only. Also, get rid of the unsupported ifindex argument for which there
is no index.
Previously, we would always add routes with netlink message flags
NLM_F_CREATE | NLM_F_REPLACE, akin `ip route replace`.

Using this form of RTM_NEWROUTE message, we could only add a certain
route with a certain network/plen,metric triple once. That was already
hugely inconvenient, because

 - when configuring routes, multiple (managed) interfaces may get
   conflicting routes. Only one of the routes can be actually configured
   using `ip route replace`, so we need to track routes that are
   currently shaddowed.

 - when configuring routes, we might replace externally configured
   routes on unmanaged interfaces.

That was worked around by introducing NMRouteManager (and
NMDefaultRouteManager). NMRouteManager would keep a list of the routes
that NetworkManager would like to configure, even if momentarily being
unable to do so due to conflicting routes. This worked mostly well but
was rather complicated, involving bumping metrics (to avoid conflicts
for device routes that were required to configure gateway routes).

Drop that now. Use the corresponding of `ip route append` to configure
routes. This allows NM to confiure (almost) all routes that it cares.
Especially, it can configure all routes on a managed interface, without
replacing/interfering with routes on other interfaces. Hence,
NMRouteManager becomes mostly obsolete.

This is a bit more complicated because:

 - when adding an IPv4 address, kernel will automatically create a device route
   for the subnet. We should avoid that using IFA_F_NOPREFIXROUTE flag for addresses
   (still to-do). But as kernel may not support that flag for IPv4 addresses yet, we still
   need functionality like  nm_route_manager_ip4_route_register_device_route_purge_list().
   This functionality now moves to NMDevice, which tracks a blacklist of device routes
   that shall be removed.

 - trying to configure an IPv6 route with a source address will be rejected
   by kernel, as long as the address is tentative (see related bug rh#1457196).
   Preferably, NMDevice keeps the list of routes that should be configured
   while kernel would have the list of what actually is configured. There is a
   feed-back loop where both affect each other (for example, when externally deleting
   a route, NMDevice must forget about it too). Previously, NMRouteManager would also
   keep track of routes that the device would like to configure, but currently cannot (due
   to conflicting routes on other devices).
   We want to get rid of that. However, with IPv6 routes with source addresses, we cannot.
   The tracking of such routes, that the device wants to configure, but currently cannot,
   also goes to NMDevice.
@thom311
Copy link
Member Author

thom311 commented Aug 12, 2017

merged as c0ac4a2

@thom311 thom311 closed this Aug 12, 2017
@lkundrak lkundrak deleted the th/platform-route-pt2 branch August 12, 2017 14:40
lkundrak pushed a commit that referenced this pull request Sep 4, 2017
When NM is restarted and a new object-manager is created, ensure that
signal handlers are disconnected from the old one.

Fixes the following:
  assertion failed: (object_manager == priv->object_manager)

 #0  __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
 #1  __GI_abort () at abort.c:90
 #2  g_assertion_message (domain=domain@entry=0x7fcac0b845ff "libnm", file=file@entry=0x7fcac0b84c95 "libnm/nm-client.c", line=line@entry=2506, func=func@entry=0x7fcac0b863a0 <__func__.34881> "name_owner_changed", message=message@entry=0x7fcac20b05f0 "assertion failed: (object_manager == priv->object_manager)") at gtestutils.c:2429
 #3  g_assertion_message_expr (domain=domain@entry=0x7fcac0b845ff "libnm", file=file@entry=0x7fcac0b84c95 "libnm/nm-client.c", line=line@entry=2506, func=func@entry=0x7fcac0b863a0 <__func__.34881> "name_owner_changed", expr=expr@entry=0x7fcac0b856a0 "object_manager == priv->object_manager") at gtestutils.c:2444
 #4  name_owner_changed (object=<optimized out>, pspec=<optimized out>, user_data=0x7fcac204e480) at libnm/nm-client.c:2506
 #8  <emit signal notify:name-owner on instance 0x7fcac2053c60 [GDBusObjectManagerClient]> (instance=instance@entry=0x7fcac2053c60, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3439
     #5  g_closure_invoke (closure=0x7fcac20af390, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7ffde58d9ec0, invocation_hint=invocation_hint@entry=0x7ffde58d9e60) at gclosure.c:801
     #6  signal_emit_unlocked_R (node=node@entry=0x7fcac2052090, detail=detail@entry=185, instance=instance@entry=0x7fcac2053c60, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffde58d9ec0) at gsignal.c:3627
     #7  g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffde58da050) at gsignal.c:3383
 #9  g_object_dispatch_properties_changed (object=0x7fcac2053c60 [GDBusObjectManagerClient], n_pspecs=<optimized out>, pspecs=<optimized out>) at gobject.c:1061
 #10 g_object_notify (pspec=<optimized out>, object=0x7fcac2053c60 [GDBusObjectManagerClient]) at gobject.c:1155
 #11 g_object_notify (object=object@entry=0x7fcac2053c60 [GDBusObjectManagerClient], property_name=property_name@entry=0x7fcabe9d2b29 "name-owner") at gobject.c:1202
 #12 on_notify_g_name_owner (object=<optimized out>, pspec=<optimized out>, user_data=0x7fcac2053c60) at gdbusobjectmanagerclient.c:1262
 #16 <emit signal notify:g-name-owner on instance 0x7fcaa8004440 [GDBusProxy]> (instance=instance@entry=0x7fcaa8004440, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3439
     #13 g_closure_invoke (closure=0x7fcaa80194f0, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7ffde58da370, invocation_hint=invocation_hint@entry=0x7ffde58da310) at gclosure.c:801
     #14 signal_emit_unlocked_R (node=node@entry=0x7fcac2052090, detail=detail@entry=299, instance=instance@entry=0x7fcaa8004440, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffde58da370) at gsignal.c:3627
     #15 g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffde58da500) at gsignal.c:3383
 #17 g_object_dispatch_properties_changed (object=0x7fcaa8004440 [GDBusProxy], n_pspecs=<optimized out>, pspecs=<optimized out>) at gobject.c:1061
 #18 g_object_notify (pspec=<optimized out>, object=0x7fcaa8004440 [GDBusProxy]) at gobject.c:1155
 #19 g_object_notify (object=object@entry=0x7fcaa8004440 [GDBusProxy], property_name=property_name@entry=0x7fcabe9d2b27 "g-name-owner") at gobject.c:1202
 #20 on_name_owner_changed (connection=<optimized out>, sender_name=<optimized out>, object_path=<optimized out>, interface_name=<optimized out>, signal_name=<optimized out>, parameters=<optimized out>, user_data=0x7fcaa8015b50) at gdbusproxy.c:1353
 #21 emit_signal_instance_in_idle_cb (data=0x7fcaa40ff400) at gdbusconnection.c:3701
 #22 g_main_context_dispatch (context=0x7fcac204eea0) at gmain.c:3152
 #23 g_main_context_dispatch (context=context@entry=0x7fcac204eea0) at gmain.c:3767
 #24 g_main_context_iterate (context=context@entry=0x7fcac204eea0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3838
 #25 g_main_context_iteration (context=0x7fcac204eea0, context@entry=0x0, may_block=may_block@entry=1) at gmain.c:3899
 #26 nmc_readline_helper (prompt=prompt@entry=0x7fcac2087f60 "The connection is not saved. Do you really want to quit? (yes/no) [no] ") at clients/cli/common.c:986
 #27 nmc_readline (prompt_fmt=<optimized out>) at clients/cli/common.c:1055
 #28 confirm_quit () at clients/cli/connections.c:6459
 #29 do_connection_edit (connection_type=<optimized out>, connection=0x7fcac208eca0, nmc=0x7fcac12a3a60 <nm_cli>) at clients/cli/connections.c:7611
 #30 do_connection_edit (nmc=0x7fcac12a3a60 <nm_cli>, argc=1, argv=0x7ffde58db0b0) at clients/cli/connections.c:7948
 #31 call_cmd (nmc=0x7fcac12a3a60 <nm_cli>, simple=0x7fcac2052490 [GSimpleAsyncResult], cmd=0x7fcac1291ae0 <connection_cmds+128>, argc=2, argv=0x7ffde58db0a8) at clients/cli/common.c:1315
 #32 got_client (source_object=<optimized out>, res=<optimized out>, user_data=0x7fcac2051830) at clients/cli/common.c:1297
 #33 g_simple_async_result_complete (simple=0x7fcac2052500 [GSimpleAsyncResult]) at gsimpleasyncresult.c:801
 #34 client_inited (source=0x7fcac204e480 [NMClient], result=0x7fcac20565f0, user_data=0x7fcac2052500) at libnm/nm-client.c:1839
 #35 g_simple_async_result_complete (simple=0x7fcac20565f0 [GSimpleAsyncResult]) at gsimpleasyncresult.c:801
 #36 init_async_complete (init_data=init_data@entry=0x7fcac2046820) at libnm/nm-client.c:2339
 #37 async_inited_obj_nm (init_data=0x7fcac2046820) at libnm/nm-client.c:2337
 #38 async_inited_obj_nm (object=0x7fcac2073080 [NMRemoteConnection], result=0x7fcac2089ed0, user_data=0x7fcac2046820) at libnm/nm-client.c:2357
 #39 g_simple_async_result_complete (simple=0x7fcac2089ed0 [GSimpleAsyncResult]) at gsimpleasyncresult.c:801
 #40 init_async_parent_inited (error=0x0, init_data=0x7fcaa408a0f0) at libnm/nm-remote-connection.c:677
 #41 init_async_parent_inited (source=<optimized out>, result=<optimized out>, user_data=0x7fcaa408a0f0) at libnm/nm-remote-connection.c:689
 #42 g_simple_async_result_complete (simple=0x7fcac2089c30 [GSimpleAsyncResult]) at gsimpleasyncresult.c:801
 #43 complete_in_idle_cb (data=<optimized out>) at gsimpleasyncresult.c:813
 #44 g_main_context_dispatch (context=0x7fcac204eea0) at gmain.c:3152
 #45 g_main_context_dispatch (context=context@entry=0x7fcac204eea0) at gmain.c:3767
 #46 g_main_context_iterate (context=0x7fcac204eea0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3838
 #47 g_main_loop_run (loop=0x7fcac2045ab0) at gmain.c:4032
 #48 main (argc=<optimized out>, argv=<optimized out>) at clients/cli/nmcli.c:642

https://bugzilla.redhat.com/show_bug.cgi?id=1471245
lkundrak pushed a commit that referenced this pull request Sep 5, 2017
When NM is restarted and a new object-manager is created, ensure that
signal handlers are disconnected from the old one.

Fixes the following:
  assertion failed: (object_manager == priv->object_manager)

 #0  __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
 #1  __GI_abort () at abort.c:90
 #2  g_assertion_message (domain=domain@entry=0x7fcac0b845ff "libnm", file=file@entry=0x7fcac0b84c95 "libnm/nm-client.c", line=line@entry=2506, func=func@entry=0x7fcac0b863a0 <__func__.34881> "name_owner_changed", message=message@entry=0x7fcac20b05f0 "assertion failed: (object_manager == priv->object_manager)") at gtestutils.c:2429
 #3  g_assertion_message_expr (domain=domain@entry=0x7fcac0b845ff "libnm", file=file@entry=0x7fcac0b84c95 "libnm/nm-client.c", line=line@entry=2506, func=func@entry=0x7fcac0b863a0 <__func__.34881> "name_owner_changed", expr=expr@entry=0x7fcac0b856a0 "object_manager == priv->object_manager") at gtestutils.c:2444
 #4  name_owner_changed (object=<optimized out>, pspec=<optimized out>, user_data=0x7fcac204e480) at libnm/nm-client.c:2506
 #8  <emit signal notify:name-owner on instance 0x7fcac2053c60 [GDBusObjectManagerClient]> (instance=instance@entry=0x7fcac2053c60, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3439
     #5  g_closure_invoke (closure=0x7fcac20af390, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7ffde58d9ec0, invocation_hint=invocation_hint@entry=0x7ffde58d9e60) at gclosure.c:801
     #6  signal_emit_unlocked_R (node=node@entry=0x7fcac2052090, detail=detail@entry=185, instance=instance@entry=0x7fcac2053c60, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffde58d9ec0) at gsignal.c:3627
     #7  g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffde58da050) at gsignal.c:3383
 #9  g_object_dispatch_properties_changed (object=0x7fcac2053c60 [GDBusObjectManagerClient], n_pspecs=<optimized out>, pspecs=<optimized out>) at gobject.c:1061
 #10 g_object_notify (pspec=<optimized out>, object=0x7fcac2053c60 [GDBusObjectManagerClient]) at gobject.c:1155
 #11 g_object_notify (object=object@entry=0x7fcac2053c60 [GDBusObjectManagerClient], property_name=property_name@entry=0x7fcabe9d2b29 "name-owner") at gobject.c:1202
 #12 on_notify_g_name_owner (object=<optimized out>, pspec=<optimized out>, user_data=0x7fcac2053c60) at gdbusobjectmanagerclient.c:1262
 #16 <emit signal notify:g-name-owner on instance 0x7fcaa8004440 [GDBusProxy]> (instance=instance@entry=0x7fcaa8004440, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3439
     #13 g_closure_invoke (closure=0x7fcaa80194f0, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7ffde58da370, invocation_hint=invocation_hint@entry=0x7ffde58da310) at gclosure.c:801
     #14 signal_emit_unlocked_R (node=node@entry=0x7fcac2052090, detail=detail@entry=299, instance=instance@entry=0x7fcaa8004440, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffde58da370) at gsignal.c:3627
     #15 g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffde58da500) at gsignal.c:3383
 #17 g_object_dispatch_properties_changed (object=0x7fcaa8004440 [GDBusProxy], n_pspecs=<optimized out>, pspecs=<optimized out>) at gobject.c:1061
 #18 g_object_notify (pspec=<optimized out>, object=0x7fcaa8004440 [GDBusProxy]) at gobject.c:1155
 #19 g_object_notify (object=object@entry=0x7fcaa8004440 [GDBusProxy], property_name=property_name@entry=0x7fcabe9d2b27 "g-name-owner") at gobject.c:1202
 #20 on_name_owner_changed (connection=<optimized out>, sender_name=<optimized out>, object_path=<optimized out>, interface_name=<optimized out>, signal_name=<optimized out>, parameters=<optimized out>, user_data=0x7fcaa8015b50) at gdbusproxy.c:1353
 #21 emit_signal_instance_in_idle_cb (data=0x7fcaa40ff400) at gdbusconnection.c:3701
 #22 g_main_context_dispatch (context=0x7fcac204eea0) at gmain.c:3152
 #23 g_main_context_dispatch (context=context@entry=0x7fcac204eea0) at gmain.c:3767
 #24 g_main_context_iterate (context=context@entry=0x7fcac204eea0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3838
 #25 g_main_context_iteration (context=0x7fcac204eea0, context@entry=0x0, may_block=may_block@entry=1) at gmain.c:3899
 #26 nmc_readline_helper (prompt=prompt@entry=0x7fcac2087f60 "The connection is not saved. Do you really want to quit? (yes/no) [no] ") at clients/cli/common.c:986
 #27 nmc_readline (prompt_fmt=<optimized out>) at clients/cli/common.c:1055
 #28 confirm_quit () at clients/cli/connections.c:6459
 #29 do_connection_edit (connection_type=<optimized out>, connection=0x7fcac208eca0, nmc=0x7fcac12a3a60 <nm_cli>) at clients/cli/connections.c:7611
 #30 do_connection_edit (nmc=0x7fcac12a3a60 <nm_cli>, argc=1, argv=0x7ffde58db0b0) at clients/cli/connections.c:7948
 #31 call_cmd (nmc=0x7fcac12a3a60 <nm_cli>, simple=0x7fcac2052490 [GSimpleAsyncResult], cmd=0x7fcac1291ae0 <connection_cmds+128>, argc=2, argv=0x7ffde58db0a8) at clients/cli/common.c:1315
 #32 got_client (source_object=<optimized out>, res=<optimized out>, user_data=0x7fcac2051830) at clients/cli/common.c:1297
 #33 g_simple_async_result_complete (simple=0x7fcac2052500 [GSimpleAsyncResult]) at gsimpleasyncresult.c:801
 #34 client_inited (source=0x7fcac204e480 [NMClient], result=0x7fcac20565f0, user_data=0x7fcac2052500) at libnm/nm-client.c:1839
 #35 g_simple_async_result_complete (simple=0x7fcac20565f0 [GSimpleAsyncResult]) at gsimpleasyncresult.c:801
 #36 init_async_complete (init_data=init_data@entry=0x7fcac2046820) at libnm/nm-client.c:2339
 #37 async_inited_obj_nm (init_data=0x7fcac2046820) at libnm/nm-client.c:2337
 #38 async_inited_obj_nm (object=0x7fcac2073080 [NMRemoteConnection], result=0x7fcac2089ed0, user_data=0x7fcac2046820) at libnm/nm-client.c:2357
 #39 g_simple_async_result_complete (simple=0x7fcac2089ed0 [GSimpleAsyncResult]) at gsimpleasyncresult.c:801
 #40 init_async_parent_inited (error=0x0, init_data=0x7fcaa408a0f0) at libnm/nm-remote-connection.c:677
 #41 init_async_parent_inited (source=<optimized out>, result=<optimized out>, user_data=0x7fcaa408a0f0) at libnm/nm-remote-connection.c:689
 #42 g_simple_async_result_complete (simple=0x7fcac2089c30 [GSimpleAsyncResult]) at gsimpleasyncresult.c:801
 #43 complete_in_idle_cb (data=<optimized out>) at gsimpleasyncresult.c:813
 #44 g_main_context_dispatch (context=0x7fcac204eea0) at gmain.c:3152
 #45 g_main_context_dispatch (context=context@entry=0x7fcac204eea0) at gmain.c:3767
 #46 g_main_context_iterate (context=0x7fcac204eea0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3838
 #47 g_main_loop_run (loop=0x7fcac2045ab0) at gmain.c:4032
 #48 main (argc=<optimized out>, argv=<optimized out>) at clients/cli/nmcli.c:642

https://bugzilla.redhat.com/show_bug.cgi?id=1471245
lkundrak pushed a commit that referenced this pull request Sep 5, 2017
When NM is restarted and a new object-manager is created, ensure that
signal handlers are disconnected from the old one.

Fixes the following:
  assertion failed: (object_manager == priv->object_manager)

 #0  __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
 #1  __GI_abort () at abort.c:90
 #2  g_assertion_message (domain=domain@entry=0x7fcac0b845ff "libnm", file=file@entry=0x7fcac0b84c95 "libnm/nm-client.c", line=line@entry=2506, func=func@entry=0x7fcac0b863a0 <__func__.34881> "name_owner_changed", message=message@entry=0x7fcac20b05f0 "assertion failed: (object_manager == priv->object_manager)") at gtestutils.c:2429
 #3  g_assertion_message_expr (domain=domain@entry=0x7fcac0b845ff "libnm", file=file@entry=0x7fcac0b84c95 "libnm/nm-client.c", line=line@entry=2506, func=func@entry=0x7fcac0b863a0 <__func__.34881> "name_owner_changed", expr=expr@entry=0x7fcac0b856a0 "object_manager == priv->object_manager") at gtestutils.c:2444
 #4  name_owner_changed (object=<optimized out>, pspec=<optimized out>, user_data=0x7fcac204e480) at libnm/nm-client.c:2506
 #8  <emit signal notify:name-owner on instance 0x7fcac2053c60 [GDBusObjectManagerClient]> (instance=instance@entry=0x7fcac2053c60, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3439
     #5  g_closure_invoke (closure=0x7fcac20af390, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7ffde58d9ec0, invocation_hint=invocation_hint@entry=0x7ffde58d9e60) at gclosure.c:801
     #6  signal_emit_unlocked_R (node=node@entry=0x7fcac2052090, detail=detail@entry=185, instance=instance@entry=0x7fcac2053c60, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffde58d9ec0) at gsignal.c:3627
     #7  g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffde58da050) at gsignal.c:3383
 #9  g_object_dispatch_properties_changed (object=0x7fcac2053c60 [GDBusObjectManagerClient], n_pspecs=<optimized out>, pspecs=<optimized out>) at gobject.c:1061
 #10 g_object_notify (pspec=<optimized out>, object=0x7fcac2053c60 [GDBusObjectManagerClient]) at gobject.c:1155
 #11 g_object_notify (object=object@entry=0x7fcac2053c60 [GDBusObjectManagerClient], property_name=property_name@entry=0x7fcabe9d2b29 "name-owner") at gobject.c:1202
 #12 on_notify_g_name_owner (object=<optimized out>, pspec=<optimized out>, user_data=0x7fcac2053c60) at gdbusobjectmanagerclient.c:1262
 #16 <emit signal notify:g-name-owner on instance 0x7fcaa8004440 [GDBusProxy]> (instance=instance@entry=0x7fcaa8004440, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3439
     #13 g_closure_invoke (closure=0x7fcaa80194f0, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7ffde58da370, invocation_hint=invocation_hint@entry=0x7ffde58da310) at gclosure.c:801
     #14 signal_emit_unlocked_R (node=node@entry=0x7fcac2052090, detail=detail@entry=299, instance=instance@entry=0x7fcaa8004440, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffde58da370) at gsignal.c:3627
     #15 g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffde58da500) at gsignal.c:3383
 #17 g_object_dispatch_properties_changed (object=0x7fcaa8004440 [GDBusProxy], n_pspecs=<optimized out>, pspecs=<optimized out>) at gobject.c:1061
 #18 g_object_notify (pspec=<optimized out>, object=0x7fcaa8004440 [GDBusProxy]) at gobject.c:1155
 #19 g_object_notify (object=object@entry=0x7fcaa8004440 [GDBusProxy], property_name=property_name@entry=0x7fcabe9d2b27 "g-name-owner") at gobject.c:1202
 #20 on_name_owner_changed (connection=<optimized out>, sender_name=<optimized out>, object_path=<optimized out>, interface_name=<optimized out>, signal_name=<optimized out>, parameters=<optimized out>, user_data=0x7fcaa8015b50) at gdbusproxy.c:1353
 #21 emit_signal_instance_in_idle_cb (data=0x7fcaa40ff400) at gdbusconnection.c:3701
 #22 g_main_context_dispatch (context=0x7fcac204eea0) at gmain.c:3152
 #23 g_main_context_dispatch (context=context@entry=0x7fcac204eea0) at gmain.c:3767
 #24 g_main_context_iterate (context=context@entry=0x7fcac204eea0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3838
 #25 g_main_context_iteration (context=0x7fcac204eea0, context@entry=0x0, may_block=may_block@entry=1) at gmain.c:3899
 #26 nmc_readline_helper (prompt=prompt@entry=0x7fcac2087f60 "The connection is not saved. Do you really want to quit? (yes/no) [no] ") at clients/cli/common.c:986
 #27 nmc_readline (prompt_fmt=<optimized out>) at clients/cli/common.c:1055
 #28 confirm_quit () at clients/cli/connections.c:6459
 #29 do_connection_edit (connection_type=<optimized out>, connection=0x7fcac208eca0, nmc=0x7fcac12a3a60 <nm_cli>) at clients/cli/connections.c:7611
 #30 do_connection_edit (nmc=0x7fcac12a3a60 <nm_cli>, argc=1, argv=0x7ffde58db0b0) at clients/cli/connections.c:7948
 #31 call_cmd (nmc=0x7fcac12a3a60 <nm_cli>, simple=0x7fcac2052490 [GSimpleAsyncResult], cmd=0x7fcac1291ae0 <connection_cmds+128>, argc=2, argv=0x7ffde58db0a8) at clients/cli/common.c:1315
 #32 got_client (source_object=<optimized out>, res=<optimized out>, user_data=0x7fcac2051830) at clients/cli/common.c:1297
 #33 g_simple_async_result_complete (simple=0x7fcac2052500 [GSimpleAsyncResult]) at gsimpleasyncresult.c:801
 #34 client_inited (source=0x7fcac204e480 [NMClient], result=0x7fcac20565f0, user_data=0x7fcac2052500) at libnm/nm-client.c:1839
 #35 g_simple_async_result_complete (simple=0x7fcac20565f0 [GSimpleAsyncResult]) at gsimpleasyncresult.c:801
 #36 init_async_complete (init_data=init_data@entry=0x7fcac2046820) at libnm/nm-client.c:2339
 #37 async_inited_obj_nm (init_data=0x7fcac2046820) at libnm/nm-client.c:2337
 #38 async_inited_obj_nm (object=0x7fcac2073080 [NMRemoteConnection], result=0x7fcac2089ed0, user_data=0x7fcac2046820) at libnm/nm-client.c:2357
 #39 g_simple_async_result_complete (simple=0x7fcac2089ed0 [GSimpleAsyncResult]) at gsimpleasyncresult.c:801
 #40 init_async_parent_inited (error=0x0, init_data=0x7fcaa408a0f0) at libnm/nm-remote-connection.c:677
 #41 init_async_parent_inited (source=<optimized out>, result=<optimized out>, user_data=0x7fcaa408a0f0) at libnm/nm-remote-connection.c:689
 #42 g_simple_async_result_complete (simple=0x7fcac2089c30 [GSimpleAsyncResult]) at gsimpleasyncresult.c:801
 #43 complete_in_idle_cb (data=<optimized out>) at gsimpleasyncresult.c:813
 #44 g_main_context_dispatch (context=0x7fcac204eea0) at gmain.c:3152
 #45 g_main_context_dispatch (context=context@entry=0x7fcac204eea0) at gmain.c:3767
 #46 g_main_context_iterate (context=0x7fcac204eea0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3838
 #47 g_main_loop_run (loop=0x7fcac2045ab0) at gmain.c:4032
 #48 main (argc=<optimized out>, argv=<optimized out>) at clients/cli/nmcli.c:642

https://bugzilla.redhat.com/show_bug.cgi?id=1471245
(cherry picked from commit 7758071)
juga0 pushed a commit to juga0/NetworkManager that referenced this pull request Sep 29, 2017
When a VPN connection can't be activated we have to unexport and
dispose it. Commit f2182fb ("core: don't emit double
PropertiesChanged signal for new active connections") removed the call
to nm_exported_object_unexport() in case of failure because the active
connection already gets unreferenced on failure.

However, an exported object can't be disposed until it's explicitly
unexported because GDBus code keeps a reference to it. The result was
that the active connection was kept alive and exported, but without
explicit references to it. As soon as the connection was unexported,
it was also automatically disposed, causing issues like:

 (src/nm-exported-object.c:1025):dispose: code should not be reached

 #0   _g_log_abort () at /lib64/libglib-2.0.so.0
 NetworkManager#1   g_logv () at /lib64/libglib-2.0.so.0
 NetworkManager#2   g_log () at /lib64/libglib-2.0.so.0
 NetworkManager#3   g_warn_message () at /lib64/libglib-2.0.so.0
 NetworkManager#4   dispose (object=0xaaf110) at src/nm-exported-object.c:1025
 NetworkManager#5   dispose (object=0xaaf110) at src/nm-active-connection.c:1246
 NetworkManager#6   dispose (object=0xaaf110) at src/vpn/nm-vpn-connection.c:2642
 NetworkManager#7   g_object_unref () at /lib64/libgobject-2.0.so.0
 NetworkManager#8   registration_data_free () at /lib64/libgio-2.0.so.0
 NetworkManager#9   g_hash_table_remove_internal () at /lib64/libglib-2.0.so.0
 NetworkManager#10  g_dbus_object_manager_server_unexport_unlocked () at /lib64/libgio-2.0.so.0
 NetworkManager#11  g_dbus_object_manager_server_unexport () at /lib64/libgio-2.0.so.0
 NetworkManager#12  nm_bus_manager_unregister_object (self=0x9069e0, object=object@entry=0xaaf110) at src/nm-bus-manager.c:858
 NetworkManager#13  nm_exported_object_unexport (self=0xaaf110) at src/nm-exported-object.c:714
 NetworkManager#14  _settings_connection_removed (connection=<optimized out>, user_data=0xaaf110) at src/nm-active-connection.c:184
 NetworkManager#15  g_closure_invoke () at /lib64/libgobject-2.0.so.0
 NetworkManager#16  signal_emit_unlocked_R () at /lib64/libgobject-2.0.so.0
 NetworkManager#17  g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
 NetworkManager#18  g_signal_emit_by_name () at /lib64/libgobject-2.0.so.0
 NetworkManager#19  nm_settings_connection_signal_remove (self=self@entry=0x9e4a80, allow_reuse=allow_reuse@entry=0) at src/settings/nm-settings-connection.c:2085
 NetworkManager#20  do_delete (self=0x9e4a80, callback=0x58106a <con_delete_cb>, user_data=0xa84fa0) at src/settings/nm-settings-connection.c:768
 NetworkManager#21  do_delete (connection=0x9e4a80, callback=0x58106a <con_delete_cb>, user_data=0xa84fa0) at src/settings/plugins/keyfile/nms-keyfile-connection.c:127
 NetworkManager#22  nm_settings_connection_delete (self=self@entry=0x9e4a80, callback=callback@entry=0x58106a <con_delete_cb>, user_data=0xa84fa0) at src/settings/nm-settings-connection.c:694
 NetworkManager#23  delete_auth_cb (self=self@entry=0x9e4a80, context=context@entry=0x7fffd80131e0, subject=0x91fb40, error=<optimized out>, data=data@entry=0x0) at src/settings/nm-settings-connection.c:1879
 NetworkManager#24  pk_auth_cb (chain=0x7fffd00024a0, chain_error=<optimized out>, context=0x7fffd80131e0, user_data=<optimized out>) at src/settings/nm-settings-connection.c:1351
 NetworkManager#25  auth_chain_finish (user_data=0x7fffd00024a0) at src/nm-auth-utils.c:92
 NetworkManager#26  g_idle_dispatch () at /lib64/libglib-2.0.so.0

Restore the unexport upon failure to fix this.

Fixes: f2182fb

https://bugzilla.redhat.com/show_bug.cgi?id=1440077
juga0 pushed a commit to juga0/NetworkManager that referenced this pull request Sep 29, 2017
When a VPN connection can't be activated we have to unexport and
dispose it. Commit f2182fb ("core: don't emit double
PropertiesChanged signal for new active connections") removed the call
to nm_exported_object_unexport() in case of failure because the active
connection already gets unreferenced on failure.

However, an exported object can't be disposed until it's explicitly
unexported because GDBus code keeps a reference to it. The result was
that the active connection was kept alive and exported, but without
explicit references to it. As soon as the connection was unexported,
it was also automatically disposed, causing issues like:

 (src/nm-exported-object.c:1025):dispose: code should not be reached

 #0   _g_log_abort () at /lib64/libglib-2.0.so.0
 NetworkManager#1   g_logv () at /lib64/libglib-2.0.so.0
 NetworkManager#2   g_log () at /lib64/libglib-2.0.so.0
 NetworkManager#3   g_warn_message () at /lib64/libglib-2.0.so.0
 NetworkManager#4   dispose (object=0xaaf110) at src/nm-exported-object.c:1025
 NetworkManager#5   dispose (object=0xaaf110) at src/nm-active-connection.c:1246
 NetworkManager#6   dispose (object=0xaaf110) at src/vpn/nm-vpn-connection.c:2642
 NetworkManager#7   g_object_unref () at /lib64/libgobject-2.0.so.0
 NetworkManager#8   registration_data_free () at /lib64/libgio-2.0.so.0
 NetworkManager#9   g_hash_table_remove_internal () at /lib64/libglib-2.0.so.0
 NetworkManager#10  g_dbus_object_manager_server_unexport_unlocked () at /lib64/libgio-2.0.so.0
 NetworkManager#11  g_dbus_object_manager_server_unexport () at /lib64/libgio-2.0.so.0
 NetworkManager#12  nm_bus_manager_unregister_object (self=0x9069e0, object=object@entry=0xaaf110) at src/nm-bus-manager.c:858
 NetworkManager#13  nm_exported_object_unexport (self=0xaaf110) at src/nm-exported-object.c:714
 NetworkManager#14  _settings_connection_removed (connection=<optimized out>, user_data=0xaaf110) at src/nm-active-connection.c:184
 NetworkManager#15  g_closure_invoke () at /lib64/libgobject-2.0.so.0
 NetworkManager#16  signal_emit_unlocked_R () at /lib64/libgobject-2.0.so.0
 NetworkManager#17  g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
 NetworkManager#18  g_signal_emit_by_name () at /lib64/libgobject-2.0.so.0
 NetworkManager#19  nm_settings_connection_signal_remove (self=self@entry=0x9e4a80, allow_reuse=allow_reuse@entry=0) at src/settings/nm-settings-connection.c:2085
 NetworkManager#20  do_delete (self=0x9e4a80, callback=0x58106a <con_delete_cb>, user_data=0xa84fa0) at src/settings/nm-settings-connection.c:768
 NetworkManager#21  do_delete (connection=0x9e4a80, callback=0x58106a <con_delete_cb>, user_data=0xa84fa0) at src/settings/plugins/keyfile/nms-keyfile-connection.c:127
 NetworkManager#22  nm_settings_connection_delete (self=self@entry=0x9e4a80, callback=callback@entry=0x58106a <con_delete_cb>, user_data=0xa84fa0) at src/settings/nm-settings-connection.c:694
 NetworkManager#23  delete_auth_cb (self=self@entry=0x9e4a80, context=context@entry=0x7fffd80131e0, subject=0x91fb40, error=<optimized out>, data=data@entry=0x0) at src/settings/nm-settings-connection.c:1879
 NetworkManager#24  pk_auth_cb (chain=0x7fffd00024a0, chain_error=<optimized out>, context=0x7fffd80131e0, user_data=<optimized out>) at src/settings/nm-settings-connection.c:1351
 NetworkManager#25  auth_chain_finish (user_data=0x7fffd00024a0) at src/nm-auth-utils.c:92
 NetworkManager#26  g_idle_dispatch () at /lib64/libglib-2.0.so.0

Restore the unexport upon failure to fix this.

Fixes: f2182fb

https://bugzilla.redhat.com/show_bug.cgi?id=1440077
(cherry picked from commit 69fd961)
lkundrak pushed a commit that referenced this pull request Oct 11, 2017
When adding a new Wi-Fi connection, nmtui crashes.
Usually, a verified Wi-Fi connection always has key_mgnt set.
However, the client doesn't have the luxury to assume that all
connections verify. Especially, while creating a new connection.

    #0  0x00007ffff4fe5baa in __strcmp_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S:31
    #1  0x000055555556654c in get_security_type (binding=0x5555557d1cf0) at clients/tui/nm-editor-bindings.c:591
    #2  0x000055555556593b in wireless_security_changed (object=0x0, pspec=0x0, user_data=0x5555557d1cf0) at clients/tui/nm-editor-bindings.c:628
    #3  0x000055555556536d in nm_editor_bind_wireless_security_method (connection=0x5555558028e0, s_wsec=0x555555892eb0 [NMSettingWirelessSecurity], target=0x555555935e10, target_property=0x55555559311b "active-id", flags=(G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE)) at clients/tui/nm-editor-bindings.c:796
    #4  0x000055555557a3aa in nmt_page_wifi_constructed (object=0x5555559349e0 [NmtPageWifi]) at clients/tui/nmt-page-wifi.c:338
    #5  0x00007ffff5e6b670 in g_object_new_internal (class=class@entry=0x5555557c14c0, params=params@entry=0x7fffffffc440, n_params=n_params@entry=2) at gobject.c:1823
    #6  0x00007ffff5e6d24d in g_object_new_valist (object_type=object_type@entry=93824994775616, first_property_name=first_property_name@entry=0x5555555920c6 "connection", var_args=var_args@entry=0x7fffffffc590) at gobject.c:2042
    #7  0x00007ffff5e6d691 in g_object_new (object_type=93824994775616, first_property_name=0x5555555920c6 "connection") at gobject.c:1626
    #8  0x000055555557985a in nmt_page_wifi_new (conn=0x5555558028e0, deventry=0x5555557d15e0 [NmtDeviceEntry]) at clients/tui/nmt-page-wifi.c:45
    #9  0x000055555556f7e2 in nmt_editor_constructed (object=0x555555922af0 [NmtEditor]) at clients/tui/nmt-editor.c:374
    #10 0x00007ffff5e6b670 in g_object_new_internal (class=class@entry=0x555555932750, params=params@entry=0x7fffffffcac0, n_params=n_params@entry=4) at gobject.c:1823
    #11 0x00007ffff5e6d24d in g_object_new_valist (object_type=object_type@entry=93824996288016, first_property_name=first_property_name@entry=0x5555555920c6 "connection", var_args=var_args@entry=0x7fffffffcc10) at gobject.c:2042
    #12 0x00007ffff5e6d691 in g_object_new (object_type=93824996288016, first_property_name=0x5555555920c6 "connection") at gobject.c:1626
    #13 0x000055555556f261 in nmt_editor_new (connection=0x555555802880) at clients/tui/nmt-editor.c:109
    #14 0x0000555555562b35 in nmt_edit_connection (connection=0x555555802880) at clients/tui/nmtui-edit.c:448
    #15 0x0000555555563a29 in create_connection (widget=0x55555588b150 [NmtNewtListbox], list=0x555555922a00) at clients/tui/nmtui-edit.c:185
    #16 0x0000555555563a5d in create_connection_and_quit (widget=0x55555588b150 [NmtNewtListbox], list=0x555555922a00) at clients/tui/nmtui-edit.c:192
    #20 0x00007ffff5e81b0f in <emit signal ??? on instance 0x55555588b150 [NmtNewtListbox]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3447
        #17 0x00007ffff5e6630d in g_closure_invoke (closure=0x555555929260, return_value=0x0, n_param_values=1, param_values=0x7fffffffcfe0, invocation_hint=0x7fffffffcf60) at gclosure.c:804
        #18 0x00007ffff5e7898e in signal_emit_unlocked_R (node=node@entry=0x55555582ac70, detail=detail@entry=0, instance=instance@entry=0x55555588b150, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffcfe0) at gsignal.c:3635
        #19 0x00007ffff5e811a5 in g_signal_emit_valist (instance=0x55555588b150, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7fffffffd1b0) at gsignal.c:3391
    #21 0x000055555558e43f in nmt_newt_widget_activated (widget=0x55555588b150 [NmtNewtListbox]) at clients/tui/newt/nmt-newt-widget.c:329
    #22 0x0000555555584fc8 in nmt_newt_form_iterate (form=0x555555922a00 [NmtAddConnection]) at clients/tui/newt/nmt-newt-form.c:309
    #23 0x0000555555585d62 in nmt_newt_form_keypress_callback (fd=1435623072, condition=G_IO_IN, user_data=0x0) at clients/tui/newt/nmt-newt-form.c:335
    #24 0x00007ffff598a247 in g_main_dispatch (context=0x5555557c3af0) at gmain.c:3234
    #25 0x00007ffff598a247 in g_main_context_dispatch (context=context@entry=0x5555557c3af0) at gmain.c:3899
    #26 0x00007ffff598a5e8 in g_main_context_iterate (context=0x5555557c3af0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3972
    #27 0x00007ffff598a902 in g_main_loop_run (loop=0x55555591b190) at gmain.c:4168
    #28 0x00005555555609b5 in main (argc=1, argv=0x7fffffffd5e8) at clients/tui/nmtui.c:298

Fixes: 6a4af48
lkundrak pushed a commit that referenced this pull request Dec 6, 2017
Initializes inotify watches handles to -1 to avoid that we try to
clear them when a connection gets created.

 NetworkManager:ERROR:src/settings/plugins/ifcfg-rh/nm-inotify-helper.c:97:nm_inotify_helper_remove_watch: assertion failed: ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ((_obj)); GType __t = ((nm_inotify_helper_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))))

  Thread 1 "NetworkManager" received signal SIGABRT, Aborted.
  0x00007ffff41d569b in raise () from /lib64/libc.so.6
  (gdb) backtrace
  #0  0x00007ffff41d569b in raise () at /lib64/libc.so.6
  #1  0x00007ffff41d73b1 in abort () at /lib64/libc.so.6
  #2  0x00007ffff5f1c69d in g_assertion_message () at /lib64/libglib-2.0.so.0
  #3  0x00007ffff5f1c72a in g_assertion_message_expr () at /lib64/libglib-2.0.so.0
  #4  0x00007fffe833eba3 in nm_inotify_helper_remove_watch (self=0x0, wd=0) at src/settings/plugins/ifcfg-rh/nm-inotify-helper.c:97
  #5  0x00007fffe83372a1 in nm_inotify_helper_clear_watch (wd=0xa04138, helper=<optimized out>) at src/settings/plugins/ifcfg-rh/nm-inotify-helper.h:53
  #6  0x00007fffe83372a1 in path_watch_stop (self=self@entry=0xa04100) at src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-connection.c:223
  #7  0x00007fffe8337342 in filename_changed (object=<optimized out>, pspec=<optimized out>, user_data=<optimized out>)
      at src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-connection.c:242
  #8  0x00007ffff63d273d in g_closure_invoke () at /lib64/libgobject-2.0.so.0
  #9  0x00007ffff63e54de in signal_emit_unlocked_R () at /lib64/libgobject-2.0.so.0
  #10 0x00007ffff63edd05 in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
  #11 0x00007ffff63ee66f in g_signal_emit () at /lib64/libgobject-2.0.so.0
  #12 0x00007ffff63d6c04 in g_object_dispatch_properties_changed () at /lib64/libgobject-2.0.so.0
  #13 0x00007ffff63d65ae in g_object_notify_queue_thaw () at /lib64/libgobject-2.0.so.0
  #14 0x00007ffff63d8076 in g_object_new_internal () at /lib64/libgobject-2.0.so.0
  #15 0x00007ffff63d9c30 in g_object_new_valist () at /lib64/libgobject-2.0.so.0
  #16 0x00007ffff63d9fa9 in g_object_new () at /lib64/libgobject-2.0.so.0
  #17 0x00007fffe8338088 in nm_ifcfg_connection_new (source=source@entry=0x0, full_path=full_path@entry=0x9d5a60 "/etc/sysconfig/network-scripts/ifcfg-t2+", error=error@entry=0x7fffffffdfa8, out_ignore_error=out_ignore_error@entry=0x7fffffffdfa4) at src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-connection.c:429
  #18 0x00007fffe8338b76 in update_connection (self=self@entry=0x9a7b00, source=source@entry=0x0, full_path=0x9d5a60 "/etc/sysconfig/network-scripts/ifcfg-t2+", connection=connection@entry=0x0, protect_existing_connection=protect_existing_connection@entry=0, protected_connections=protected_connections@entry=Python Exception <class 'gdb.error'> There is no member named keys.:
  0x9f68c0, error=0x0)
      at src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c:218
  #19 0x00007fffe8339d9d in read_connections (plugin=plugin@entry=0x9a7b00) at src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c:545
  #20 0x00007fffe833a7e8 in get_connections (config=<optimized out>) at src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c:581
  #21 0x0000000000656ca2 in nm_settings_plugin_get_connections (config=config@entry=0x9a7b00) at src/settings/nm-settings-plugin.c:106
  #22 0x00000000005c8a6a in load_connections (self=self@entry=0x7fffd4004670) at src/settings/nm-settings.c:239
  #23 0x00000000005ca360 in nm_settings_start (self=0x7fffd4004670, error=error@entry=0x7fffffffe1f8) at src/settings/nm-settings.c:1800
  #24 0x0000000000455507 in nm_manager_start (self=0x99d090, error=error@entry=0x7fffffffe1f8) at src/nm-manager.c:5262
  #25 0x0000000000420b5c in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:417

Fixes: 31f2a46
lkundrak pushed a commit that referenced this pull request Dec 6, 2017
Initializes inotify watches handles to -1 to avoid that we try to
clear them when a connection gets created.

 NetworkManager:ERROR:src/settings/plugins/ifcfg-rh/nm-inotify-helper.c:97:nm_inotify_helper_remove_watch: assertion failed: ((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ((_obj)); GType __t = ((nm_inotify_helper_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))))

  Thread 1 "NetworkManager" received signal SIGABRT, Aborted.
  0x00007ffff41d569b in raise () from /lib64/libc.so.6
  (gdb) backtrace
  #0  0x00007ffff41d569b in raise () at /lib64/libc.so.6
  #1  0x00007ffff41d73b1 in abort () at /lib64/libc.so.6
  #2  0x00007ffff5f1c69d in g_assertion_message () at /lib64/libglib-2.0.so.0
  #3  0x00007ffff5f1c72a in g_assertion_message_expr () at /lib64/libglib-2.0.so.0
  #4  0x00007fffe833eba3 in nm_inotify_helper_remove_watch (self=0x0, wd=0) at src/settings/plugins/ifcfg-rh/nm-inotify-helper.c:97
  #5  0x00007fffe83372a1 in nm_inotify_helper_clear_watch (wd=0xa04138, helper=<optimized out>) at src/settings/plugins/ifcfg-rh/nm-inotify-helper.h:53
  #6  0x00007fffe83372a1 in path_watch_stop (self=self@entry=0xa04100) at src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-connection.c:223
  #7  0x00007fffe8337342 in filename_changed (object=<optimized out>, pspec=<optimized out>, user_data=<optimized out>)
      at src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-connection.c:242
  #8  0x00007ffff63d273d in g_closure_invoke () at /lib64/libgobject-2.0.so.0
  #9  0x00007ffff63e54de in signal_emit_unlocked_R () at /lib64/libgobject-2.0.so.0
  #10 0x00007ffff63edd05 in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
  #11 0x00007ffff63ee66f in g_signal_emit () at /lib64/libgobject-2.0.so.0
  #12 0x00007ffff63d6c04 in g_object_dispatch_properties_changed () at /lib64/libgobject-2.0.so.0
  #13 0x00007ffff63d65ae in g_object_notify_queue_thaw () at /lib64/libgobject-2.0.so.0
  #14 0x00007ffff63d8076 in g_object_new_internal () at /lib64/libgobject-2.0.so.0
  #15 0x00007ffff63d9c30 in g_object_new_valist () at /lib64/libgobject-2.0.so.0
  #16 0x00007ffff63d9fa9 in g_object_new () at /lib64/libgobject-2.0.so.0
  #17 0x00007fffe8338088 in nm_ifcfg_connection_new (source=source@entry=0x0, full_path=full_path@entry=0x9d5a60 "/etc/sysconfig/network-scripts/ifcfg-t2+", error=error@entry=0x7fffffffdfa8, out_ignore_error=out_ignore_error@entry=0x7fffffffdfa4) at src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-connection.c:429
  #18 0x00007fffe8338b76 in update_connection (self=self@entry=0x9a7b00, source=source@entry=0x0, full_path=0x9d5a60 "/etc/sysconfig/network-scripts/ifcfg-t2+", connection=connection@entry=0x0, protect_existing_connection=protect_existing_connection@entry=0, protected_connections=protected_connections@entry=Python Exception <class 'gdb.error'> There is no member named keys.:
  0x9f68c0, error=0x0)
      at src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c:218
  #19 0x00007fffe8339d9d in read_connections (plugin=plugin@entry=0x9a7b00) at src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c:545
  #20 0x00007fffe833a7e8 in get_connections (config=<optimized out>) at src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-plugin.c:581
  #21 0x0000000000656ca2 in nm_settings_plugin_get_connections (config=config@entry=0x9a7b00) at src/settings/nm-settings-plugin.c:106
  #22 0x00000000005c8a6a in load_connections (self=self@entry=0x7fffd4004670) at src/settings/nm-settings.c:239
  #23 0x00000000005ca360 in nm_settings_start (self=0x7fffd4004670, error=error@entry=0x7fffffffe1f8) at src/settings/nm-settings.c:1800
  #24 0x0000000000455507 in nm_manager_start (self=0x99d090, error=error@entry=0x7fffffffe1f8) at src/nm-manager.c:5262
  #25 0x0000000000420b5c in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:417

Fixes: 31f2a46
thom311 added a commit that referenced this pull request May 14, 2020
Suppress a leak report from openssl:

 Direct leak of 192 byte(s) in 1 object(s) allocated from:
     #0 0x7f6fe9c6b677 in __interceptor_malloc (/lib64/libasan.so.6+0xb0677)
     #1 0x7f6fe4d4046d in CRYPTO_zalloc crypto/mem.c:230
     #2 0x7f6fe4d0a91f in ENGINE_new crypto/engine/eng_lib.c:34
     #3 0x7f6fe4d0c40d in ENGINE_rdrand crypto/engine/eng_rdrand.c:70
     #4 0x7f6fe4d0c40d in engine_load_rdrand_int crypto/engine/eng_rdrand.c:85
     #5 0x7f6fe4d370ec in ossl_init_engine_rdrand crypto/init.c:353
     #6 0x7f6fe4d370ec in ossl_init_engine_rdrand_ossl_ crypto/init.c:347
     #7 0x7f6fe995aace in __pthread_once_slow (/lib64/libpthread.so.0+0x11ace)
     #8 0x7f6fe4da68fc in CRYPTO_THREAD_run_once crypto/threads_pthread.c:118
     #9 0x7f6fe4d378ec in OPENSSL_init_crypto crypto/init.c:723
     #10 0x7f6fe4d378ec in OPENSSL_init_crypto crypto/init.c:620
     #11 0x7f6fe5292280  (/usr/lib64/pkcs11/libsofthsm2.so+0x78280)
     #12 0x7f6fe5292364  (/usr/lib64/pkcs11/libsofthsm2.so+0x78364)
     #13 0x7f6fe526f151 in SoftHSM::C_Initialize(void*) /usr/src/debug/softhsm-2.5.0-4.fc32.3.x86_64/src/lib/SoftHSM.cpp:485
     #14 0x7f6fe523cc97 in C_Initialize (/usr/lib64/pkcs11/libsofthsm2.so+0x22c97)
     #15 0x7f6fe4ecb233 in initialize_module_inlock_reentrant ../p11-kit/modules.c:738
     #16 0x7f6fe4ecb382 in managed_C_Initialize ../p11-kit/modules.c:1584
     #17 0x7f6fe4ecdbdf in p11_kit_modules_initialize ../p11-kit/modules.c:2157
     #18 0x7f6fe4ecdbdf in p11_kit_modules_initialize ../p11-kit/modules.c:2145
     #19 0x7f6fe4ed1a96 in proxy_create ../p11-kit/proxy.c:330
     #20 0x7f6fe4ed1a96 in proxy_C_Initialize ../p11-kit/proxy.c:398
     #21 0x7f6fe9a343b1 in secmod_ModuleInit /usr/src/debug/nss-3.51.0-1.fc32.x86_64/nss/lib/pk11wrap/pk11load.c:244
     #22 0x7f6fe9a34adb in secmod_LoadPKCS11Module /usr/src/debug/nss-3.51.0-1.fc32.x86_64/nss/lib/pk11wrap/pk11load.c:501
     #23 0x7f6fe9a419ec in SECMOD_LoadModule /usr/src/debug/nss-3.51.0-1.fc32.x86_64/nss/lib/pk11wrap/pk11pars.c:1840
     #24 0x7f6fe9a41b27 in SECMOD_LoadModule /usr/src/debug/nss-3.51.0-1.fc32.x86_64/nss/lib/pk11wrap/pk11pars.c:1876
     #25 0x7f6fe9a0dd00 in nss_Init /usr/src/debug/nss-3.51.0-1.fc32.x86_64/nss/lib/nss/nssinit.c:712
     #26 0x7f6fe9a0e3ab in NSS_NoDB_Init /usr/src/debug/nss-3.51.0-1.fc32.x86_64/nss/lib/nss/nssinit.c:950
     #27 0x55c942e2f1b2 in _nm_crypto_init libnm-core/nm-crypto-nss.c:61
     #28 0x55c942d6f2da in nm_crypto_load_and_verify_certificate libnm-core/nm-crypto.c:721
     #29 0x55c942c99681 in _cert_impl_set libnm-core/nm-setting-8021x.c:497
     #30 0x55c942c9d83b in nm_setting_802_1x_set_ca_cert libnm-core/nm-setting-8021x.c:1033
     #31 0x55c942c63513 in _test_8021x_cert_from_files libnm-core/tests/test-keyfile.c:382
     #32 0x55c942c6425a in test_8021x_cert libnm-core/tests/test-keyfile.c:436
     #33 0x7f6fe965429d in test_case_run ../glib/gtestutils.c:2633
     #34 0x7f6fe965429d in g_test_run_suite_internal ../glib/gtestutils.c:2721
thom311 added a commit that referenced this pull request May 14, 2020
Suppress a leak report from openssl:

 Direct leak of 192 byte(s) in 1 object(s) allocated from:
     #0 0x7f6fe9c6b677 in __interceptor_malloc (/lib64/libasan.so.6+0xb0677)
     #1 0x7f6fe4d4046d in CRYPTO_zalloc crypto/mem.c:230
     #2 0x7f6fe4d0a91f in ENGINE_new crypto/engine/eng_lib.c:34
     #3 0x7f6fe4d0c40d in ENGINE_rdrand crypto/engine/eng_rdrand.c:70
     #4 0x7f6fe4d0c40d in engine_load_rdrand_int crypto/engine/eng_rdrand.c:85
     #5 0x7f6fe4d370ec in ossl_init_engine_rdrand crypto/init.c:353
     #6 0x7f6fe4d370ec in ossl_init_engine_rdrand_ossl_ crypto/init.c:347
     #7 0x7f6fe995aace in __pthread_once_slow (/lib64/libpthread.so.0+0x11ace)
     #8 0x7f6fe4da68fc in CRYPTO_THREAD_run_once crypto/threads_pthread.c:118
     #9 0x7f6fe4d378ec in OPENSSL_init_crypto crypto/init.c:723
     #10 0x7f6fe4d378ec in OPENSSL_init_crypto crypto/init.c:620
     #11 0x7f6fe5292280  (/usr/lib64/pkcs11/libsofthsm2.so+0x78280)
     #12 0x7f6fe5292364  (/usr/lib64/pkcs11/libsofthsm2.so+0x78364)
     #13 0x7f6fe526f151 in SoftHSM::C_Initialize(void*) /usr/src/debug/softhsm-2.5.0-4.fc32.3.x86_64/src/lib/SoftHSM.cpp:485
     #14 0x7f6fe523cc97 in C_Initialize (/usr/lib64/pkcs11/libsofthsm2.so+0x22c97)
     #15 0x7f6fe4ecb233 in initialize_module_inlock_reentrant ../p11-kit/modules.c:738
     #16 0x7f6fe4ecb382 in managed_C_Initialize ../p11-kit/modules.c:1584
     #17 0x7f6fe4ecdbdf in p11_kit_modules_initialize ../p11-kit/modules.c:2157
     #18 0x7f6fe4ecdbdf in p11_kit_modules_initialize ../p11-kit/modules.c:2145
     #19 0x7f6fe4ed1a96 in proxy_create ../p11-kit/proxy.c:330
     #20 0x7f6fe4ed1a96 in proxy_C_Initialize ../p11-kit/proxy.c:398
     #21 0x7f6fe9a343b1 in secmod_ModuleInit /usr/src/debug/nss-3.51.0-1.fc32.x86_64/nss/lib/pk11wrap/pk11load.c:244
     #22 0x7f6fe9a34adb in secmod_LoadPKCS11Module /usr/src/debug/nss-3.51.0-1.fc32.x86_64/nss/lib/pk11wrap/pk11load.c:501
     #23 0x7f6fe9a419ec in SECMOD_LoadModule /usr/src/debug/nss-3.51.0-1.fc32.x86_64/nss/lib/pk11wrap/pk11pars.c:1840
     #24 0x7f6fe9a41b27 in SECMOD_LoadModule /usr/src/debug/nss-3.51.0-1.fc32.x86_64/nss/lib/pk11wrap/pk11pars.c:1876
     #25 0x7f6fe9a0dd00 in nss_Init /usr/src/debug/nss-3.51.0-1.fc32.x86_64/nss/lib/nss/nssinit.c:712
     #26 0x7f6fe9a0e3ab in NSS_NoDB_Init /usr/src/debug/nss-3.51.0-1.fc32.x86_64/nss/lib/nss/nssinit.c:950
     #27 0x55c942e2f1b2 in _nm_crypto_init libnm-core/nm-crypto-nss.c:61
     #28 0x55c942d6f2da in nm_crypto_load_and_verify_certificate libnm-core/nm-crypto.c:721
     #29 0x55c942c99681 in _cert_impl_set libnm-core/nm-setting-8021x.c:497
     #30 0x55c942c9d83b in nm_setting_802_1x_set_ca_cert libnm-core/nm-setting-8021x.c:1033
     #31 0x55c942c63513 in _test_8021x_cert_from_files libnm-core/tests/test-keyfile.c:382
     #32 0x55c942c6425a in test_8021x_cert libnm-core/tests/test-keyfile.c:436
     #33 0x7f6fe965429d in test_case_run ../glib/gtestutils.c:2633
     #34 0x7f6fe965429d in g_test_run_suite_internal ../glib/gtestutils.c:2721
lkundrak pushed a commit that referenced this pull request May 14, 2020
Suppress a leak report from openssl:

 Direct leak of 192 byte(s) in 1 object(s) allocated from:
     #0 0x7f6fe9c6b677 in __interceptor_malloc (/lib64/libasan.so.6+0xb0677)
     #1 0x7f6fe4d4046d in CRYPTO_zalloc crypto/mem.c:230
     #2 0x7f6fe4d0a91f in ENGINE_new crypto/engine/eng_lib.c:34
     #3 0x7f6fe4d0c40d in ENGINE_rdrand crypto/engine/eng_rdrand.c:70
     #4 0x7f6fe4d0c40d in engine_load_rdrand_int crypto/engine/eng_rdrand.c:85
     #5 0x7f6fe4d370ec in ossl_init_engine_rdrand crypto/init.c:353
     #6 0x7f6fe4d370ec in ossl_init_engine_rdrand_ossl_ crypto/init.c:347
     #7 0x7f6fe995aace in __pthread_once_slow (/lib64/libpthread.so.0+0x11ace)
     #8 0x7f6fe4da68fc in CRYPTO_THREAD_run_once crypto/threads_pthread.c:118
     #9 0x7f6fe4d378ec in OPENSSL_init_crypto crypto/init.c:723
     #10 0x7f6fe4d378ec in OPENSSL_init_crypto crypto/init.c:620
     #11 0x7f6fe5292280  (/usr/lib64/pkcs11/libsofthsm2.so+0x78280)
     #12 0x7f6fe5292364  (/usr/lib64/pkcs11/libsofthsm2.so+0x78364)
     #13 0x7f6fe526f151 in SoftHSM::C_Initialize(void*) /usr/src/debug/softhsm-2.5.0-4.fc32.3.x86_64/src/lib/SoftHSM.cpp:485
     #14 0x7f6fe523cc97 in C_Initialize (/usr/lib64/pkcs11/libsofthsm2.so+0x22c97)
     #15 0x7f6fe4ecb233 in initialize_module_inlock_reentrant ../p11-kit/modules.c:738
     #16 0x7f6fe4ecb382 in managed_C_Initialize ../p11-kit/modules.c:1584
     #17 0x7f6fe4ecdbdf in p11_kit_modules_initialize ../p11-kit/modules.c:2157
     #18 0x7f6fe4ecdbdf in p11_kit_modules_initialize ../p11-kit/modules.c:2145
     #19 0x7f6fe4ed1a96 in proxy_create ../p11-kit/proxy.c:330
     #20 0x7f6fe4ed1a96 in proxy_C_Initialize ../p11-kit/proxy.c:398
     #21 0x7f6fe9a343b1 in secmod_ModuleInit /usr/src/debug/nss-3.51.0-1.fc32.x86_64/nss/lib/pk11wrap/pk11load.c:244
     #22 0x7f6fe9a34adb in secmod_LoadPKCS11Module /usr/src/debug/nss-3.51.0-1.fc32.x86_64/nss/lib/pk11wrap/pk11load.c:501
     #23 0x7f6fe9a419ec in SECMOD_LoadModule /usr/src/debug/nss-3.51.0-1.fc32.x86_64/nss/lib/pk11wrap/pk11pars.c:1840
     #24 0x7f6fe9a41b27 in SECMOD_LoadModule /usr/src/debug/nss-3.51.0-1.fc32.x86_64/nss/lib/pk11wrap/pk11pars.c:1876
     #25 0x7f6fe9a0dd00 in nss_Init /usr/src/debug/nss-3.51.0-1.fc32.x86_64/nss/lib/nss/nssinit.c:712
     #26 0x7f6fe9a0e3ab in NSS_NoDB_Init /usr/src/debug/nss-3.51.0-1.fc32.x86_64/nss/lib/nss/nssinit.c:950
     #27 0x55c942e2f1b2 in _nm_crypto_init libnm-core/nm-crypto-nss.c:61
     #28 0x55c942d6f2da in nm_crypto_load_and_verify_certificate libnm-core/nm-crypto.c:721
     #29 0x55c942c99681 in _cert_impl_set libnm-core/nm-setting-8021x.c:497
     #30 0x55c942c9d83b in nm_setting_802_1x_set_ca_cert libnm-core/nm-setting-8021x.c:1033
     #31 0x55c942c63513 in _test_8021x_cert_from_files libnm-core/tests/test-keyfile.c:382
     #32 0x55c942c6425a in test_8021x_cert libnm-core/tests/test-keyfile.c:436
     #33 0x7f6fe965429d in test_case_run ../glib/gtestutils.c:2633
     #34 0x7f6fe965429d in g_test_run_suite_internal ../glib/gtestutils.c:2721

(cherry picked from commit 8113bc2)
thom311 added a commit that referenced this pull request Aug 3, 2020
In this case, GetAll failed with "Timeout was reached". We still
create a dummy BSS info, because we kept track of the object to
start with. That way, we don't simply want to ignore the failure,
because NMDeviceWifi might track this NMWifiAP already, and we may
need an update (even if we failed to fetch the requested information).

However, that later leads to a crash, because NMDeviceWifi expect the BSSID
present then.

Avoid that, by don't processing such APs.

    #0  g_logv (log_domain=0x7f2ac10a60a9 "NetworkManager", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=<optimized out>) at ../glib/gmessages.c:1377
    #1  0x00007f2acf152233 in g_log
        (log_domain=log_domain@entry=0x7f2ac10a60a9 "NetworkManager", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7f2acf1a46ff "%s: assertion '%s' failed")
        at ../glib/gmessages.c:1415
    #2  0x00007f2acf152a2d in g_return_if_fail_warning
        (log_domain=log_domain@entry=0x7f2ac10a60a9 "NetworkManager", pretty_function=pretty_function@entry=0x7f2ac10a9e70 <__func__.50> "try_fill_ssid_for_hidden_ap", expression=expression@entry=0x7f2ac10a86d0 "bssid") at ../glib/gmessages.c:2771
    #3  0x00007f2ac108a402 in try_fill_ssid_for_hidden_ap (ap=0x5569978b61c0 [NMWifiAP], self=0x55699786ea00 [NMDeviceWifi]) at src/devices/wifi/nm-device-wifi.c:1883
    #4  supplicant_iface_bss_changed_cb (iface=0x556997777260 [NMSupplicantInterface], bss_info=0x7f2ab4028f00, is_present=1, self=0x55699786ea00 [NMDeviceWifi])
        at src/devices/wifi/nm-device-wifi.c:1946
    #5  0x00007f2ace246af0 in ffi_call_unix64 () at ../src/x86/unix64.S:76
    #6  0x00007f2ace2462ab in ffi_call (cif=cif@entry=0x7ffd9c107c90, fn=fn@entry=0x7f2ac1089e80 <supplicant_iface_bss_changed_cb>, rvalue=<optimized out>, avalue=avalue@entry=0x7ffd9c107ba0)
        at ../src/x86/ffi64.c:525
    #7  0x00007f2acf23e87a in g_cclosure_marshal_generic_va
        (closure=<optimized out>, return_value=<optimized out>, instance=<optimized out>, args_list=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=<optimized out>) at ../gobject/gclosure.c:1614
    #8  0x00007f2acf23dae6 in _g_closure_invoke_va
        (closure=closure@entry=0x5569978a0cc0, return_value=return_value@entry=0x0, instance=instance@entry=0x556997777260, args=args@entry=0x7ffd9c107f00, n_params=2, param_types=0x55699775b990) at ../gobject/gclosure.c:873
    #9  0x00007f2acf2566e9 in g_signal_emit_valist (instance=0x556997777260, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7ffd9c107f00) at ../gobject/gsignal.c:3407
    #10 0x00007f2acf256c63 in g_signal_emit (instance=instance@entry=0x556997777260, signal_id=<optimized out>, detail=detail@entry=0) at ../gobject/gsignal.c:3554
    #11 0x00005569972ece61 in _bss_info_changed_emit (self=self@entry=0x556997777260 [NMSupplicantInterface], bss_info=bss_info@entry=0x7f2ab4028f00, is_present=is_present@entry=1)
        at src/supplicant/nm-supplicant-interface.c:555
    #12 0x00005569972ed3a0 in _bss_info_properties_changed (self=0x556997777260 [NMSupplicantInterface], bss_info=0x7f2ab4028f00, properties=<optimized out>, initial=<optimized out>)
        at src/supplicant/nm-supplicant-interface.c:758
    #13 0x00005569972f756b in _bss_info_get_all_cb (result=0x0, error=<optimized out>, user_data=0x7f2ab4028f00) at src/supplicant/nm-supplicant-interface.c:784
    #14 0x0000556997217bc1 in _nm_dbus_connection_call_default_cb (source=0x5569977480c0 [GDBusConnection], res=<optimized out>, user_data=user_data@entry=0x556997855d50)
        at shared/nm-glib-aux/nm-dbus-aux.c:74
    #15 0x00007f2acf339e4a in g_task_return_now (task=task@entry=0x7f2ab4003f00 [GTask]) at ../gio/gtask.c:1214
    #16 0x00007f2acf33aa3d in g_task_return (task=0x7f2ab4003f00 [GTask], type=<optimized out>) at ../gio/gtask.c:1283
    #17 0x00007f2acf33b4fe in g_task_return (type=G_TASK_RETURN_ERROR, task=<optimized out>) at ../gio/gtask.c:1861
    #18 g_task_return_error (task=<optimized out>, error=<optimized out>) at ../gio/gtask.c:1867
    #19 0x0000556997893f40 in  ()
    #20 0x3a85d39adfae7f00 in  ()
    #21 0x00007f2ab4003cc0 in  ()
    #22 0x00007f2acf396460 in g_dbus_connection_call_done () at ../gio/gdbusconnection.c:2059
    #23 0x00007f2ab4003f00 in  ()
    #24 0x0000000000000086 in  ()
    #25 0x0000000000000018 in  ()
    #26 0x00007f2acf339e4a in g_task_return_now (task=0x7f2ab4003f00 [GTask], task@entry=0x7f2ab4003cc0 [GTask]) at ../gio/gtask.c:1214
    #27 0x00007f2acf33aa3d in g_task_return (task=0x7f2ab4003cc0 [GTask], type=<optimized out>) at ../gio/gtask.c:1283
    #28 0x00007f2acf33b4fe in g_task_return (type=G_TASK_RETURN_ERROR, task=<optimized out>) at ../gio/gtask.c:1861
    #29 g_task_return_error (task=<optimized out>, error=<optimized out>) at ../gio/gtask.c:1867
    #30 0x0000003000000028 in  ()
    #31 0x00007ffd9c108290 in  ()

Fixes: b83f079 ('supplicant: large rework of wpa_supplicant handling')
thom311 added a commit that referenced this pull request Aug 4, 2020
In this case, GetAll failed with "Timeout was reached". We still
create a dummy BSS info, because we kept track of the object to
start with. That way, we don't simply want to ignore the failure,
because NMDeviceWifi might track this NMWifiAP already, and we may
need an update (even if we failed to fetch the requested information).

However, that later leads to a crash, because NMDeviceWifi expect the BSSID
present then.

Avoid that, by don't processing such APs.

    #0  g_logv (log_domain=0x7f2ac10a60a9 "NetworkManager", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=<optimized out>) at ../glib/gmessages.c:1377
    #1  0x00007f2acf152233 in g_log
        (log_domain=log_domain@entry=0x7f2ac10a60a9 "NetworkManager", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7f2acf1a46ff "%s: assertion '%s' failed")
        at ../glib/gmessages.c:1415
    #2  0x00007f2acf152a2d in g_return_if_fail_warning
        (log_domain=log_domain@entry=0x7f2ac10a60a9 "NetworkManager", pretty_function=pretty_function@entry=0x7f2ac10a9e70 <__func__.50> "try_fill_ssid_for_hidden_ap", expression=expression@entry=0x7f2ac10a86d0 "bssid") at ../glib/gmessages.c:2771
    #3  0x00007f2ac108a402 in try_fill_ssid_for_hidden_ap (ap=0x5569978b61c0 [NMWifiAP], self=0x55699786ea00 [NMDeviceWifi]) at src/devices/wifi/nm-device-wifi.c:1883
    #4  supplicant_iface_bss_changed_cb (iface=0x556997777260 [NMSupplicantInterface], bss_info=0x7f2ab4028f00, is_present=1, self=0x55699786ea00 [NMDeviceWifi])
        at src/devices/wifi/nm-device-wifi.c:1946
    #5  0x00007f2ace246af0 in ffi_call_unix64 () at ../src/x86/unix64.S:76
    #6  0x00007f2ace2462ab in ffi_call (cif=cif@entry=0x7ffd9c107c90, fn=fn@entry=0x7f2ac1089e80 <supplicant_iface_bss_changed_cb>, rvalue=<optimized out>, avalue=avalue@entry=0x7ffd9c107ba0)
        at ../src/x86/ffi64.c:525
    #7  0x00007f2acf23e87a in g_cclosure_marshal_generic_va
        (closure=<optimized out>, return_value=<optimized out>, instance=<optimized out>, args_list=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=<optimized out>) at ../gobject/gclosure.c:1614
    #8  0x00007f2acf23dae6 in _g_closure_invoke_va
        (closure=closure@entry=0x5569978a0cc0, return_value=return_value@entry=0x0, instance=instance@entry=0x556997777260, args=args@entry=0x7ffd9c107f00, n_params=2, param_types=0x55699775b990) at ../gobject/gclosure.c:873
    #9  0x00007f2acf2566e9 in g_signal_emit_valist (instance=0x556997777260, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7ffd9c107f00) at ../gobject/gsignal.c:3407
    #10 0x00007f2acf256c63 in g_signal_emit (instance=instance@entry=0x556997777260, signal_id=<optimized out>, detail=detail@entry=0) at ../gobject/gsignal.c:3554
    #11 0x00005569972ece61 in _bss_info_changed_emit (self=self@entry=0x556997777260 [NMSupplicantInterface], bss_info=bss_info@entry=0x7f2ab4028f00, is_present=is_present@entry=1)
        at src/supplicant/nm-supplicant-interface.c:555
    #12 0x00005569972ed3a0 in _bss_info_properties_changed (self=0x556997777260 [NMSupplicantInterface], bss_info=0x7f2ab4028f00, properties=<optimized out>, initial=<optimized out>)
        at src/supplicant/nm-supplicant-interface.c:758
    #13 0x00005569972f756b in _bss_info_get_all_cb (result=0x0, error=<optimized out>, user_data=0x7f2ab4028f00) at src/supplicant/nm-supplicant-interface.c:784
    #14 0x0000556997217bc1 in _nm_dbus_connection_call_default_cb (source=0x5569977480c0 [GDBusConnection], res=<optimized out>, user_data=user_data@entry=0x556997855d50)
        at shared/nm-glib-aux/nm-dbus-aux.c:74
    #15 0x00007f2acf339e4a in g_task_return_now (task=task@entry=0x7f2ab4003f00 [GTask]) at ../gio/gtask.c:1214
    #16 0x00007f2acf33aa3d in g_task_return (task=0x7f2ab4003f00 [GTask], type=<optimized out>) at ../gio/gtask.c:1283
    #17 0x00007f2acf33b4fe in g_task_return (type=G_TASK_RETURN_ERROR, task=<optimized out>) at ../gio/gtask.c:1861
    #18 g_task_return_error (task=<optimized out>, error=<optimized out>) at ../gio/gtask.c:1867
    #19 0x0000556997893f40 in  ()
    #20 0x3a85d39adfae7f00 in  ()
    #21 0x00007f2ab4003cc0 in  ()
    #22 0x00007f2acf396460 in g_dbus_connection_call_done () at ../gio/gdbusconnection.c:2059
    #23 0x00007f2ab4003f00 in  ()
    #24 0x0000000000000086 in  ()
    #25 0x0000000000000018 in  ()
    #26 0x00007f2acf339e4a in g_task_return_now (task=0x7f2ab4003f00 [GTask], task@entry=0x7f2ab4003cc0 [GTask]) at ../gio/gtask.c:1214
    #27 0x00007f2acf33aa3d in g_task_return (task=0x7f2ab4003cc0 [GTask], type=<optimized out>) at ../gio/gtask.c:1283
    #28 0x00007f2acf33b4fe in g_task_return (type=G_TASK_RETURN_ERROR, task=<optimized out>) at ../gio/gtask.c:1861
    #29 g_task_return_error (task=<optimized out>, error=<optimized out>) at ../gio/gtask.c:1867
    #30 0x0000003000000028 in  ()
    #31 0x00007ffd9c108290 in  ()

Fixes: b83f079 ('supplicant: large rework of wpa_supplicant handling')
(cherry picked from commit 4d878d7)
thom311 added a commit that referenced this pull request Aug 4, 2020
In this case, GetAll failed with "Timeout was reached". We still
create a dummy BSS info, because we kept track of the object to
start with. That way, we don't simply want to ignore the failure,
because NMDeviceWifi might track this NMWifiAP already, and we may
need an update (even if we failed to fetch the requested information).

However, that later leads to a crash, because NMDeviceWifi expect the BSSID
present then.

Avoid that, by don't processing such APs.

    #0  g_logv (log_domain=0x7f2ac10a60a9 "NetworkManager", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=<optimized out>) at ../glib/gmessages.c:1377
    #1  0x00007f2acf152233 in g_log
        (log_domain=log_domain@entry=0x7f2ac10a60a9 "NetworkManager", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7f2acf1a46ff "%s: assertion '%s' failed")
        at ../glib/gmessages.c:1415
    #2  0x00007f2acf152a2d in g_return_if_fail_warning
        (log_domain=log_domain@entry=0x7f2ac10a60a9 "NetworkManager", pretty_function=pretty_function@entry=0x7f2ac10a9e70 <__func__.50> "try_fill_ssid_for_hidden_ap", expression=expression@entry=0x7f2ac10a86d0 "bssid") at ../glib/gmessages.c:2771
    #3  0x00007f2ac108a402 in try_fill_ssid_for_hidden_ap (ap=0x5569978b61c0 [NMWifiAP], self=0x55699786ea00 [NMDeviceWifi]) at src/devices/wifi/nm-device-wifi.c:1883
    #4  supplicant_iface_bss_changed_cb (iface=0x556997777260 [NMSupplicantInterface], bss_info=0x7f2ab4028f00, is_present=1, self=0x55699786ea00 [NMDeviceWifi])
        at src/devices/wifi/nm-device-wifi.c:1946
    #5  0x00007f2ace246af0 in ffi_call_unix64 () at ../src/x86/unix64.S:76
    #6  0x00007f2ace2462ab in ffi_call (cif=cif@entry=0x7ffd9c107c90, fn=fn@entry=0x7f2ac1089e80 <supplicant_iface_bss_changed_cb>, rvalue=<optimized out>, avalue=avalue@entry=0x7ffd9c107ba0)
        at ../src/x86/ffi64.c:525
    #7  0x00007f2acf23e87a in g_cclosure_marshal_generic_va
        (closure=<optimized out>, return_value=<optimized out>, instance=<optimized out>, args_list=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=<optimized out>) at ../gobject/gclosure.c:1614
    #8  0x00007f2acf23dae6 in _g_closure_invoke_va
        (closure=closure@entry=0x5569978a0cc0, return_value=return_value@entry=0x0, instance=instance@entry=0x556997777260, args=args@entry=0x7ffd9c107f00, n_params=2, param_types=0x55699775b990) at ../gobject/gclosure.c:873
    #9  0x00007f2acf2566e9 in g_signal_emit_valist (instance=0x556997777260, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7ffd9c107f00) at ../gobject/gsignal.c:3407
    #10 0x00007f2acf256c63 in g_signal_emit (instance=instance@entry=0x556997777260, signal_id=<optimized out>, detail=detail@entry=0) at ../gobject/gsignal.c:3554
    #11 0x00005569972ece61 in _bss_info_changed_emit (self=self@entry=0x556997777260 [NMSupplicantInterface], bss_info=bss_info@entry=0x7f2ab4028f00, is_present=is_present@entry=1)
        at src/supplicant/nm-supplicant-interface.c:555
    #12 0x00005569972ed3a0 in _bss_info_properties_changed (self=0x556997777260 [NMSupplicantInterface], bss_info=0x7f2ab4028f00, properties=<optimized out>, initial=<optimized out>)
        at src/supplicant/nm-supplicant-interface.c:758
    #13 0x00005569972f756b in _bss_info_get_all_cb (result=0x0, error=<optimized out>, user_data=0x7f2ab4028f00) at src/supplicant/nm-supplicant-interface.c:784
    #14 0x0000556997217bc1 in _nm_dbus_connection_call_default_cb (source=0x5569977480c0 [GDBusConnection], res=<optimized out>, user_data=user_data@entry=0x556997855d50)
        at shared/nm-glib-aux/nm-dbus-aux.c:74
    #15 0x00007f2acf339e4a in g_task_return_now (task=task@entry=0x7f2ab4003f00 [GTask]) at ../gio/gtask.c:1214
    #16 0x00007f2acf33aa3d in g_task_return (task=0x7f2ab4003f00 [GTask], type=<optimized out>) at ../gio/gtask.c:1283
    #17 0x00007f2acf33b4fe in g_task_return (type=G_TASK_RETURN_ERROR, task=<optimized out>) at ../gio/gtask.c:1861
    #18 g_task_return_error (task=<optimized out>, error=<optimized out>) at ../gio/gtask.c:1867
    #19 0x0000556997893f40 in  ()
    #20 0x3a85d39adfae7f00 in  ()
    #21 0x00007f2ab4003cc0 in  ()
    #22 0x00007f2acf396460 in g_dbus_connection_call_done () at ../gio/gdbusconnection.c:2059
    #23 0x00007f2ab4003f00 in  ()
    #24 0x0000000000000086 in  ()
    #25 0x0000000000000018 in  ()
    #26 0x00007f2acf339e4a in g_task_return_now (task=0x7f2ab4003f00 [GTask], task@entry=0x7f2ab4003cc0 [GTask]) at ../gio/gtask.c:1214
    #27 0x00007f2acf33aa3d in g_task_return (task=0x7f2ab4003cc0 [GTask], type=<optimized out>) at ../gio/gtask.c:1283
    #28 0x00007f2acf33b4fe in g_task_return (type=G_TASK_RETURN_ERROR, task=<optimized out>) at ../gio/gtask.c:1861
    #29 g_task_return_error (task=<optimized out>, error=<optimized out>) at ../gio/gtask.c:1867
    #30 0x0000003000000028 in  ()
    #31 0x00007ffd9c108290 in  ()

Fixes: b83f079 ('supplicant: large rework of wpa_supplicant handling')
(cherry picked from commit 4d878d7)
(cherry picked from commit 029d07b)
lkundrak added a commit that referenced this pull request Feb 2, 2021
We might be already handling a state change:

Aug 17 05:26:34 dacan.local NetworkManager[618]: (devices/nm-device.c:10982):
_set_state_full: runtime check failed: (priv->in_state_changed == FALSE)

  (gdb) bt
  #0  0x00007fc218dad643 in g_logv (log_domain=0x7fc21c0db3c3 "NetworkManager", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>, args=args@entry=0x7ffe6f0b30d0) at gmessages.c:1086
  #1  0x00007fc218dad7bf in g_log (log_domain=log_domain@entry=0x7fc21c0db3c3 "NetworkManager", log_level=log_level@entry=G_LOG_LEVEL_WARNING, format=format@entry=0x7fc218e1b70f "%s") at gmessages.c:1119
  #2  0x00007fc218dadb16 in g_warn_message (domain=domain@entry=0x7fc21c0db3c3 "NetworkManager", file=file@entry=0x7fc21c0d6597 "devices/nm-device.c", line=line@entry=10982, func=func@entry=0x7fc21c0dabf0 <__FUNCTION__.42233> "_set_state_full", warnexpr=warnexpr@entry=0x7fc21c0d95a0 "priv->in_state_changed == FALSE") at gmessages.c:1152
  #3  0x00007fc21bf79bd6 in _set_state_full (self=0x7fc21ccd88b0 [NMDeviceEthernet], state=NM_DEVICE_STATE_FAILED, reason=NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED, quitting=0) at devices/nm-device.c:10982
  #7  0x00007fc2190bdd9f in <emit signal notify:master on instance 0x7fc21ccd88b0 [NMDeviceEthernet]> (instance=instance@entry=0x7fc21ccd88b0, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3439
      #4  0x00007fc2190a3908 in g_closure_invoke (closure=0x7fc21cd009e0, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7ffe6f0b34b0, invocation_hint=invocation_hint@entry=0x7ffe6f0b3450) at gclosure.c:801
      #5  0x00007fc2190b5a1d in signal_emit_unlocked_R (node=node@entry=0x7fc21cb66500, detail=detail@entry=588, instance=instance@entry=0x7fc21ccd88b0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffe6f0b34b0)
      at gsignal.c:3627
      #6  0x00007fc2190bdab1 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffe6f0b3640) at gsignal.c:3383
  #8  0x00007fc2190a7fd4 in g_object_dispatch_properties_changed (object=0x7fc21ccd88b0 [NMDeviceEthernet], n_pspecs=<optimized out>, pspecs=<optimized out>) at gobject.c:1061
  #9  0x00007fc2190aa619 in g_object_notify_by_pspec (pspec=<optimized out>, object=0x7fc21ccd88b0 [NMDeviceEthernet]) at gobject.c:1155
  #10 0x00007fc2190aa619 in g_object_notify_by_pspec (object=object@entry=0x7fc21ccd88b0 [NMDeviceEthernet], pspec=<optimized out>) at gobject.c:1264
  #11 0x00007fc21bf7de3f in nm_device_master_enslave_slave (prop=PROP_MASTER, obj=0x7fc21ccd88b0 [NMDeviceEthernet]) at devices/nm-device.c:103
  #12 0x00007fc21bf7de3f in nm_device_master_enslave_slave (success=1, self=0x7fc21ccd88b0 [NMDeviceEthernet]) at devices/nm-device.c:2757
  #13 0x00007fc21bf7de3f in nm_device_master_enslave_slave (self=0x7fc21cd42810 [NMDeviceBond], slave=0x7fc21ccd88b0 [NMDeviceEthernet], connection=<optimized out>) at devices/nm-device.c:1300
  #14 0x00007fc2167c8dcc in ffi_call_unix64 () at ../src/x86/unix64.S:76
  #15 0x00007fc2167c86f5 in ffi_call (cif=cif@entry=0x7ffe6f0b3a10, fn=<optimized out>, rvalue=0x7ffe6f0b3980, avalue=avalue@entry=0x7ffe6f0b3900) at ../src/x86/ffi64.c:522
  #20 0x00007fc2190be2e8 in <emit signal 0x7fc21c0ea3d5 "state-changed" on instance 0x7fc21ccd88b0 [NMDeviceEthernet]> (instance=instance@entry=0x7fc21ccd88b0, detailed_signal=detailed_signal@entry=0x7fc21c0ea3d5 "state-changed") at gsignal.c:3479
      #16 0x00007fc2190a4148 in g_cclosure_marshal_generic (closure=0x7fc21cc84de0, return_gvalue=0x0, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>, marshal_data=0x0) at gclosure.c:1487
      #17 0x00007fc2190a3908 in g_closure_invoke (closure=0x7fc21cc84de0, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7ffe6f0b3c10, invocation_hint=invocation_hint@entry=0x7ffe6f0b3bb0) at gclosure.c:801
      #18 0x00007fc2190b5a1d in signal_emit_unlocked_R (node=node@entry=0x7fc21cbeef20, detail=detail@entry=0, instance=instance@entry=0x7fc21ccd88b0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffe6f0b3c10) at gsignal.c:3627
      #19 0x00007fc2190bdab1 in g_signal_emit_valist (instance=instance@entry=0x7fc21ccd88b0, signal_id=signal_id@entry=112, detail=detail@entry=0, var_args=var_args@entry=0x7ffe6f0b3e48) at gsignal.c:3383
  #21 0x00007fc21bf79e3d in _set_state_full (self=self@entry=0x7fc21ccd88b0 [NMDeviceEthernet], state=state@entry=NM_DEVICE_STATE_IP_CONFIG, reason=reason@entry=NM_DEVICE_STATE_REASON_NONE, quitting=quitting@entry=0) at devices/nm-device.c:11123
  #22 0x00007fc21bf7a707 in nm_device_state_changed (self=self@entry=0x7fc21ccd88b0 [NMDeviceEthernet], state=state@entry=NM_DEVICE_STATE_IP_CONFIG, reason=reason@entry=NM_DEVICE_STATE_REASON_NONE) at devices/nm-device.c:11308
  #23 0x00007fc21bf7e92f in activate_stage3_ip_config_start (self=0x7fc21ccd88b0 [NMDeviceEthernet]) at devices/nm-device.c:6759
  #24 0x00007fc21bf68dac in activation_source_handle_cb (self=0x7fc21ccd88b0 [NMDeviceEthernet], family=family@entry=2) at devices/nm-device.c:3627
  #25 0x00007fc21bf68e6e in activation_source_handle_cb4 (user_data=<optimized out>) at devices/nm-device.c:3564
  #26 0x00007fc218da6d7a in g_main_context_dispatch (context=0x7fc21cb6e000) at gmain.c:3152
  #27 0x00007fc218da6d7a in g_main_context_dispatch (context=context@entry=0x7fc21cb6e000) at gmain.c:3767
  #28 0x00007fc218da70b8 in g_main_context_iterate (context=0x7fc21cb6e000, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3838
  #29 0x00007fc218da738a in g_main_loop_run (loop=0x7fc21cb6c8c0) at gmain.c:4032
  #30 0x00007fc21bf4a23e in main (argc=1, argv=0x7ffe6f0b43e8) at main.c:411
  (gdb)

https://bugzilla.redhat.com/show_bug.cgi?id=1367702
(cherry picked from commit d070d7f)
thom311 added a commit that referenced this pull request Feb 22, 2022
…oved_track()

We can get a platform signal for any number of reasons. In particular,
we can get a signal that the object exists in platform, while the object
is tracked as zombie.

"Zombies" are objects that we once actively configured, but now no
longer and thus need to remove them. We remember that we need to delete
the object in kernel.

The assertion was wrong. We don't need to handle the case "in_platform"
and linked in "os_zombie_lst" specially.

Backtrace:

    #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
    #1  0x00007f6a208f1db5 in __GI_abort () at abort.c:79
    #2  0x00007f6a212ed123 in g_assertion_message (domain=<optimized out>, file=<optimized out>, line=<optimized out>,
        func=0x560e23ada2c0 <__func__.39909> "_obj_states_externally_removed_track", message=<optimized out>) at gtestutils.c:2533
    #3  0x00007f6a2134620e in g_assertion_message_expr (domain=domain@entry=0x560e23b781a0 "nm", file=file@entry=0x560e23acec60 "src/core/nm-l3cfg.c", line=line@entry=920,
        func=func@entry=0x560e23ada2c0 <__func__.39909> "_obj_states_externally_removed_track", expr=expr@entry=0x560e23ad1980 "c_list_is_empty(&obj_state->os_zombie_lst)") at gtestutils.c:2556
    #4  0x0000560e23853f38 in _obj_states_externally_removed_track (self=self@entry=0x560e25f168e0, obj=<optimized out>, obj@entry=0x560e25e466a0, in_platform=in_platform@entry=1)
        at src/core/nm-l3cfg.c:920
    #5  0x0000560e2385b8ea in _nm_l3cfg_notify_platform_change (self=0x560e25f168e0, change_type=change_type@entry=NM_PLATFORM_SIGNAL_CHANGED, obj=0x560e25e466a0) at src/core/nm-l3cfg.c:1364
    #6  0x0000560e23861251 in _platform_signal_cb (platform=<optimized out>, obj_type_i=<optimized out>, ifindex=<optimized out>, platform_object=0x560e25e466b8, change_type_i=2,
        p_self=<optimized out>) at ./src/libnm-platform/nmp-object.h:443
    #7  0x00007f6a1c4a914e in ffi_call_unix64 () at ../src/x86/unix64.S:76
    #8  0x00007f6a1c4a8aff in ffi_call (cif=cif@entry=0x7fffac40e570, fn=fn@entry=0x560e23861100 <_platform_signal_cb>, rvalue=<optimized out>, avalue=avalue@entry=0x7fffac40e480)
        at ../src/x86/ffi64.c:525
    #9  0x00007f6a217fee85 in g_cclosure_marshal_generic (closure=<optimized out>, return_gvalue=<optimized out>, n_param_values=<optimized out>, param_values=<optimized out>,
        invocation_hint=<optimized out>, marshal_data=<optimized out>) at gclosure.c:1490
    #10 0x00007f6a217fe3bd in g_closure_invoke (closure=0x560e25df53c0, return_value=0x0, n_param_values=5, param_values=0x7fffac40e7a0, invocation_hint=0x7fffac40e720) at gclosure.c:804
    #11 0x00007f6a21811945 in signal_emit_unlocked_R (node=node@entry=0x7f6a00008870, detail=detail@entry=0, instance=instance@entry=0x560e25ddd080, emission_return=emission_return@entry=0x0,
        instance_and_params=instance_and_params@entry=0x7fffac40e7a0) at gsignal.c:3636
    #12 0x00007f6a2181aa56 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffac40e9c0) at gsignal.c:3392
    #13 0x00007f6a2181b093 in g_signal_emit (instance=instance@entry=0x560e25ddd080, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3448
    #14 0x0000560e2392deea in nm_platform_cache_update_emit_signal (self=0x560e25ddd080, cache_op=NMP_CACHE_OPS_UPDATED, obj_old=<optimized out>, obj_new=<optimized out>)
        at src/libnm-platform/nm-platform.c:8824
    #15 0x0000560e238fd520 in event_handler_recvmsgs () at src/libnm-platform/nm-linux-platform.c:7183
    #16 0x0000560e238fdcbf in event_handler_read_netlink () at src/libnm-platform/nm-linux-platform.c:9403
    #17 0x0000560e238ffab3 in delayed_action_handle_one () at src/libnm-platform/nm-linux-platform.c:6238
    #18 0x0000560e238ffcae in delayed_action_handle_all () at src/libnm-platform/nm-linux-platform.c:6256
    #19 0x0000560e23901acc in do_delete_object () at src/libnm-platform/nm-linux-platform.c:7392
    #20 0x0000560e2390227c in ip4_address_delete () at src/libnm-platform/nm-linux-platform.c:8782
    #21 0x0000560e23922709 in nm_platform_ip4_address_delete (self=self@entry=0x560e25ddd080, ifindex=ifindex@entry=150, address=16843009, plen=<optimized out>, peer_address=16843009)
        at src/libnm-platform/nm-platform.c:3574
    #22 0x0000560e239275ab in nm_platform_ip_address_sync (self=0x560e25ddd080, addr_family=addr_family@entry=2, ifindex=150, known_addresses=<optimized out>, known_addresses@entry=0x0,
        addresses_prune=0x560e25e81aa0) at src/libnm-platform/nm-platform.c:3984
    #23 0x0000560e23855e17 in _l3_commit_one (self=0x560e25f168e0, addr_family=2, commit_type=<optimized out>, l3cd_old=<optimized out>, changed_combined_l3cd=<optimized out>)
        at src/core/nm-l3cfg.c:4256
    #24 0x0000560e2385fc5c in _l3_commit (self=0x560e25f168e0, commit_type=NM_L3_CFG_COMMIT_TYPE_REAPPLY, is_idle=<optimized out>) at src/core/nm-l3cfg.c:4353
    #25 0x0000560e239c6a6d in nm_device_cleanup (self=0x560e25e985e0, reason=<optimized out>, cleanup_type=CLEANUP_TYPE_DECONFIGURE) at src/core/devices/nm-device.c:15082
    #26 0x0000560e239c7522 in _set_state_full (self=0x560e25e985e0, state=<optimized out>, reason=<optimized out>, quitting=0) at src/core/devices/nm-device.c:15467
    #27 0x0000560e239cd482 in queued_state_set (user_data=user_data@entry=0x560e25e985e0) at src/core/devices/nm-device.c:15706
    #28 0x00007f6a2131b27b in g_idle_dispatch (source=0x560e25ebab60, callback=0x560e239cd3d0 <queued_state_set>, user_data=0x560e25e985e0) at gmain.c:5579
    #29 0x00007f6a2131e95d in g_main_dispatch (context=0x560e25d97bc0) at gmain.c:3193
    #30 g_main_context_dispatch (context=context@entry=0x560e25d97bc0) at gmain.c:3873
    #31 0x00007f6a2131ed18 in g_main_context_iterate (context=0x560e25d97bc0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3946
    #32 0x00007f6a2131f042 in g_main_loop_run (loop=0x560e25d730f0) at gmain.c:4142
    #33 0x0000560e237c06ec in main (argc=<optimized out>, argv=<optimized out>) at src/core/main.c:509

Fixes: 929eae2 ('l3cfg: implement NM_L3CFG_CONFIG_FLAGS_ASSUME_CONFIG_ONCE and rework object state')
lkundrak pushed a commit that referenced this pull request Feb 22, 2022
…oved_track()

We can get a platform signal for any number of reasons. In particular,
we can get a signal that the object exists in platform, while the object
is tracked as zombie.

"Zombies" are objects that we once actively configured, but now no
longer and thus need to remove them. We remember that we need to delete
the object in kernel.

The assertion was wrong. We don't need to handle the case "in_platform"
and linked in "os_zombie_lst" specially.

Backtrace:

    #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
    #1  0x00007f6a208f1db5 in __GI_abort () at abort.c:79
    #2  0x00007f6a212ed123 in g_assertion_message (domain=<optimized out>, file=<optimized out>, line=<optimized out>,
        func=0x560e23ada2c0 <__func__.39909> "_obj_states_externally_removed_track", message=<optimized out>) at gtestutils.c:2533
    #3  0x00007f6a2134620e in g_assertion_message_expr (domain=domain@entry=0x560e23b781a0 "nm", file=file@entry=0x560e23acec60 "src/core/nm-l3cfg.c", line=line@entry=920,
        func=func@entry=0x560e23ada2c0 <__func__.39909> "_obj_states_externally_removed_track", expr=expr@entry=0x560e23ad1980 "c_list_is_empty(&obj_state->os_zombie_lst)") at gtestutils.c:2556
    #4  0x0000560e23853f38 in _obj_states_externally_removed_track (self=self@entry=0x560e25f168e0, obj=<optimized out>, obj@entry=0x560e25e466a0, in_platform=in_platform@entry=1)
        at src/core/nm-l3cfg.c:920
    #5  0x0000560e2385b8ea in _nm_l3cfg_notify_platform_change (self=0x560e25f168e0, change_type=change_type@entry=NM_PLATFORM_SIGNAL_CHANGED, obj=0x560e25e466a0) at src/core/nm-l3cfg.c:1364
    #6  0x0000560e23861251 in _platform_signal_cb (platform=<optimized out>, obj_type_i=<optimized out>, ifindex=<optimized out>, platform_object=0x560e25e466b8, change_type_i=2,
        p_self=<optimized out>) at ./src/libnm-platform/nmp-object.h:443
    #7  0x00007f6a1c4a914e in ffi_call_unix64 () at ../src/x86/unix64.S:76
    #8  0x00007f6a1c4a8aff in ffi_call (cif=cif@entry=0x7fffac40e570, fn=fn@entry=0x560e23861100 <_platform_signal_cb>, rvalue=<optimized out>, avalue=avalue@entry=0x7fffac40e480)
        at ../src/x86/ffi64.c:525
    #9  0x00007f6a217fee85 in g_cclosure_marshal_generic (closure=<optimized out>, return_gvalue=<optimized out>, n_param_values=<optimized out>, param_values=<optimized out>,
        invocation_hint=<optimized out>, marshal_data=<optimized out>) at gclosure.c:1490
    #10 0x00007f6a217fe3bd in g_closure_invoke (closure=0x560e25df53c0, return_value=0x0, n_param_values=5, param_values=0x7fffac40e7a0, invocation_hint=0x7fffac40e720) at gclosure.c:804
    #11 0x00007f6a21811945 in signal_emit_unlocked_R (node=node@entry=0x7f6a00008870, detail=detail@entry=0, instance=instance@entry=0x560e25ddd080, emission_return=emission_return@entry=0x0,
        instance_and_params=instance_and_params@entry=0x7fffac40e7a0) at gsignal.c:3636
    #12 0x00007f6a2181aa56 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffac40e9c0) at gsignal.c:3392
    #13 0x00007f6a2181b093 in g_signal_emit (instance=instance@entry=0x560e25ddd080, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3448
    #14 0x0000560e2392deea in nm_platform_cache_update_emit_signal (self=0x560e25ddd080, cache_op=NMP_CACHE_OPS_UPDATED, obj_old=<optimized out>, obj_new=<optimized out>)
        at src/libnm-platform/nm-platform.c:8824
    #15 0x0000560e238fd520 in event_handler_recvmsgs () at src/libnm-platform/nm-linux-platform.c:7183
    #16 0x0000560e238fdcbf in event_handler_read_netlink () at src/libnm-platform/nm-linux-platform.c:9403
    #17 0x0000560e238ffab3 in delayed_action_handle_one () at src/libnm-platform/nm-linux-platform.c:6238
    #18 0x0000560e238ffcae in delayed_action_handle_all () at src/libnm-platform/nm-linux-platform.c:6256
    #19 0x0000560e23901acc in do_delete_object () at src/libnm-platform/nm-linux-platform.c:7392
    #20 0x0000560e2390227c in ip4_address_delete () at src/libnm-platform/nm-linux-platform.c:8782
    #21 0x0000560e23922709 in nm_platform_ip4_address_delete (self=self@entry=0x560e25ddd080, ifindex=ifindex@entry=150, address=16843009, plen=<optimized out>, peer_address=16843009)
        at src/libnm-platform/nm-platform.c:3574
    #22 0x0000560e239275ab in nm_platform_ip_address_sync (self=0x560e25ddd080, addr_family=addr_family@entry=2, ifindex=150, known_addresses=<optimized out>, known_addresses@entry=0x0,
        addresses_prune=0x560e25e81aa0) at src/libnm-platform/nm-platform.c:3984
    #23 0x0000560e23855e17 in _l3_commit_one (self=0x560e25f168e0, addr_family=2, commit_type=<optimized out>, l3cd_old=<optimized out>, changed_combined_l3cd=<optimized out>)
        at src/core/nm-l3cfg.c:4256
    #24 0x0000560e2385fc5c in _l3_commit (self=0x560e25f168e0, commit_type=NM_L3_CFG_COMMIT_TYPE_REAPPLY, is_idle=<optimized out>) at src/core/nm-l3cfg.c:4353
    #25 0x0000560e239c6a6d in nm_device_cleanup (self=0x560e25e985e0, reason=<optimized out>, cleanup_type=CLEANUP_TYPE_DECONFIGURE) at src/core/devices/nm-device.c:15082
    #26 0x0000560e239c7522 in _set_state_full (self=0x560e25e985e0, state=<optimized out>, reason=<optimized out>, quitting=0) at src/core/devices/nm-device.c:15467
    #27 0x0000560e239cd482 in queued_state_set (user_data=user_data@entry=0x560e25e985e0) at src/core/devices/nm-device.c:15706
    #28 0x00007f6a2131b27b in g_idle_dispatch (source=0x560e25ebab60, callback=0x560e239cd3d0 <queued_state_set>, user_data=0x560e25e985e0) at gmain.c:5579
    #29 0x00007f6a2131e95d in g_main_dispatch (context=0x560e25d97bc0) at gmain.c:3193
    #30 g_main_context_dispatch (context=context@entry=0x560e25d97bc0) at gmain.c:3873
    #31 0x00007f6a2131ed18 in g_main_context_iterate (context=0x560e25d97bc0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3946
    #32 0x00007f6a2131f042 in g_main_loop_run (loop=0x560e25d730f0) at gmain.c:4142
    #33 0x0000560e237c06ec in main (argc=<optimized out>, argv=<optimized out>) at src/core/main.c:509

Fixes: 929eae2 ('l3cfg: implement NM_L3CFG_CONFIG_FLAGS_ASSUME_CONFIG_ONCE and rework object state')
thom311 added a commit that referenced this pull request Feb 22, 2022
…oved_track()

We can get a platform signal for any number of reasons. In particular,
we can get a signal that the object exists in platform, while the object
is tracked as zombie.

"Zombies" are objects that we once actively configured, but now no
longer and thus need to remove them. We remember that we need to delete
the object in kernel.

The assertion was wrong. We don't need to handle the case "in_platform"
and linked in "os_zombie_lst" specially.

Backtrace:

    #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
    #1  0x00007f6a208f1db5 in __GI_abort () at abort.c:79
    #2  0x00007f6a212ed123 in g_assertion_message (domain=<optimized out>, file=<optimized out>, line=<optimized out>,
        func=0x560e23ada2c0 <__func__.39909> "_obj_states_externally_removed_track", message=<optimized out>) at gtestutils.c:2533
    #3  0x00007f6a2134620e in g_assertion_message_expr (domain=domain@entry=0x560e23b781a0 "nm", file=file@entry=0x560e23acec60 "src/core/nm-l3cfg.c", line=line@entry=920,
        func=func@entry=0x560e23ada2c0 <__func__.39909> "_obj_states_externally_removed_track", expr=expr@entry=0x560e23ad1980 "c_list_is_empty(&obj_state->os_zombie_lst)") at gtestutils.c:2556
    #4  0x0000560e23853f38 in _obj_states_externally_removed_track (self=self@entry=0x560e25f168e0, obj=<optimized out>, obj@entry=0x560e25e466a0, in_platform=in_platform@entry=1)
        at src/core/nm-l3cfg.c:920
    #5  0x0000560e2385b8ea in _nm_l3cfg_notify_platform_change (self=0x560e25f168e0, change_type=change_type@entry=NM_PLATFORM_SIGNAL_CHANGED, obj=0x560e25e466a0) at src/core/nm-l3cfg.c:1364
    #6  0x0000560e23861251 in _platform_signal_cb (platform=<optimized out>, obj_type_i=<optimized out>, ifindex=<optimized out>, platform_object=0x560e25e466b8, change_type_i=2,
        p_self=<optimized out>) at ./src/libnm-platform/nmp-object.h:443
    #7  0x00007f6a1c4a914e in ffi_call_unix64 () at ../src/x86/unix64.S:76
    #8  0x00007f6a1c4a8aff in ffi_call (cif=cif@entry=0x7fffac40e570, fn=fn@entry=0x560e23861100 <_platform_signal_cb>, rvalue=<optimized out>, avalue=avalue@entry=0x7fffac40e480)
        at ../src/x86/ffi64.c:525
    #9  0x00007f6a217fee85 in g_cclosure_marshal_generic (closure=<optimized out>, return_gvalue=<optimized out>, n_param_values=<optimized out>, param_values=<optimized out>,
        invocation_hint=<optimized out>, marshal_data=<optimized out>) at gclosure.c:1490
    #10 0x00007f6a217fe3bd in g_closure_invoke (closure=0x560e25df53c0, return_value=0x0, n_param_values=5, param_values=0x7fffac40e7a0, invocation_hint=0x7fffac40e720) at gclosure.c:804
    #11 0x00007f6a21811945 in signal_emit_unlocked_R (node=node@entry=0x7f6a00008870, detail=detail@entry=0, instance=instance@entry=0x560e25ddd080, emission_return=emission_return@entry=0x0,
        instance_and_params=instance_and_params@entry=0x7fffac40e7a0) at gsignal.c:3636
    #12 0x00007f6a2181aa56 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffac40e9c0) at gsignal.c:3392
    #13 0x00007f6a2181b093 in g_signal_emit (instance=instance@entry=0x560e25ddd080, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3448
    #14 0x0000560e2392deea in nm_platform_cache_update_emit_signal (self=0x560e25ddd080, cache_op=NMP_CACHE_OPS_UPDATED, obj_old=<optimized out>, obj_new=<optimized out>)
        at src/libnm-platform/nm-platform.c:8824
    #15 0x0000560e238fd520 in event_handler_recvmsgs () at src/libnm-platform/nm-linux-platform.c:7183
    #16 0x0000560e238fdcbf in event_handler_read_netlink () at src/libnm-platform/nm-linux-platform.c:9403
    #17 0x0000560e238ffab3 in delayed_action_handle_one () at src/libnm-platform/nm-linux-platform.c:6238
    #18 0x0000560e238ffcae in delayed_action_handle_all () at src/libnm-platform/nm-linux-platform.c:6256
    #19 0x0000560e23901acc in do_delete_object () at src/libnm-platform/nm-linux-platform.c:7392
    #20 0x0000560e2390227c in ip4_address_delete () at src/libnm-platform/nm-linux-platform.c:8782
    #21 0x0000560e23922709 in nm_platform_ip4_address_delete (self=self@entry=0x560e25ddd080, ifindex=ifindex@entry=150, address=16843009, plen=<optimized out>, peer_address=16843009)
        at src/libnm-platform/nm-platform.c:3574
    #22 0x0000560e239275ab in nm_platform_ip_address_sync (self=0x560e25ddd080, addr_family=addr_family@entry=2, ifindex=150, known_addresses=<optimized out>, known_addresses@entry=0x0,
        addresses_prune=0x560e25e81aa0) at src/libnm-platform/nm-platform.c:3984
    #23 0x0000560e23855e17 in _l3_commit_one (self=0x560e25f168e0, addr_family=2, commit_type=<optimized out>, l3cd_old=<optimized out>, changed_combined_l3cd=<optimized out>)
        at src/core/nm-l3cfg.c:4256
    #24 0x0000560e2385fc5c in _l3_commit (self=0x560e25f168e0, commit_type=NM_L3_CFG_COMMIT_TYPE_REAPPLY, is_idle=<optimized out>) at src/core/nm-l3cfg.c:4353
    #25 0x0000560e239c6a6d in nm_device_cleanup (self=0x560e25e985e0, reason=<optimized out>, cleanup_type=CLEANUP_TYPE_DECONFIGURE) at src/core/devices/nm-device.c:15082
    #26 0x0000560e239c7522 in _set_state_full (self=0x560e25e985e0, state=<optimized out>, reason=<optimized out>, quitting=0) at src/core/devices/nm-device.c:15467
    #27 0x0000560e239cd482 in queued_state_set (user_data=user_data@entry=0x560e25e985e0) at src/core/devices/nm-device.c:15706
    #28 0x00007f6a2131b27b in g_idle_dispatch (source=0x560e25ebab60, callback=0x560e239cd3d0 <queued_state_set>, user_data=0x560e25e985e0) at gmain.c:5579
    #29 0x00007f6a2131e95d in g_main_dispatch (context=0x560e25d97bc0) at gmain.c:3193
    #30 g_main_context_dispatch (context=context@entry=0x560e25d97bc0) at gmain.c:3873
    #31 0x00007f6a2131ed18 in g_main_context_iterate (context=0x560e25d97bc0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3946
    #32 0x00007f6a2131f042 in g_main_loop_run (loop=0x560e25d730f0) at gmain.c:4142
    #33 0x0000560e237c06ec in main (argc=<optimized out>, argv=<optimized out>) at src/core/main.c:509

Fixes: 929eae2 ('l3cfg: implement NM_L3CFG_CONFIG_FLAGS_ASSUME_CONFIG_ONCE and rework object state')
thom311 added a commit that referenced this pull request Feb 23, 2022
…oved_track()

We can get a platform signal for any number of reasons. In particular,
we can get a signal that the object exists in platform, while the object
is tracked as zombie.

"Zombies" are objects that we once actively configured, but now no
longer and thus need to remove them. We remember that we need to delete
the object in kernel.

The assertion was wrong. We don't need to handle the case "in_platform"
and linked in "os_zombie_lst" specially.

Backtrace:

    #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
    #1  0x00007f6a208f1db5 in __GI_abort () at abort.c:79
    #2  0x00007f6a212ed123 in g_assertion_message (domain=<optimized out>, file=<optimized out>, line=<optimized out>,
        func=0x560e23ada2c0 <__func__.39909> "_obj_states_externally_removed_track", message=<optimized out>) at gtestutils.c:2533
    #3  0x00007f6a2134620e in g_assertion_message_expr (domain=domain@entry=0x560e23b781a0 "nm", file=file@entry=0x560e23acec60 "src/core/nm-l3cfg.c", line=line@entry=920,
        func=func@entry=0x560e23ada2c0 <__func__.39909> "_obj_states_externally_removed_track", expr=expr@entry=0x560e23ad1980 "c_list_is_empty(&obj_state->os_zombie_lst)") at gtestutils.c:2556
    #4  0x0000560e23853f38 in _obj_states_externally_removed_track (self=self@entry=0x560e25f168e0, obj=<optimized out>, obj@entry=0x560e25e466a0, in_platform=in_platform@entry=1)
        at src/core/nm-l3cfg.c:920
    #5  0x0000560e2385b8ea in _nm_l3cfg_notify_platform_change (self=0x560e25f168e0, change_type=change_type@entry=NM_PLATFORM_SIGNAL_CHANGED, obj=0x560e25e466a0) at src/core/nm-l3cfg.c:1364
    #6  0x0000560e23861251 in _platform_signal_cb (platform=<optimized out>, obj_type_i=<optimized out>, ifindex=<optimized out>, platform_object=0x560e25e466b8, change_type_i=2,
        p_self=<optimized out>) at ./src/libnm-platform/nmp-object.h:443
    #7  0x00007f6a1c4a914e in ffi_call_unix64 () at ../src/x86/unix64.S:76
    #8  0x00007f6a1c4a8aff in ffi_call (cif=cif@entry=0x7fffac40e570, fn=fn@entry=0x560e23861100 <_platform_signal_cb>, rvalue=<optimized out>, avalue=avalue@entry=0x7fffac40e480)
        at ../src/x86/ffi64.c:525
    #9  0x00007f6a217fee85 in g_cclosure_marshal_generic (closure=<optimized out>, return_gvalue=<optimized out>, n_param_values=<optimized out>, param_values=<optimized out>,
        invocation_hint=<optimized out>, marshal_data=<optimized out>) at gclosure.c:1490
    #10 0x00007f6a217fe3bd in g_closure_invoke (closure=0x560e25df53c0, return_value=0x0, n_param_values=5, param_values=0x7fffac40e7a0, invocation_hint=0x7fffac40e720) at gclosure.c:804
    #11 0x00007f6a21811945 in signal_emit_unlocked_R (node=node@entry=0x7f6a00008870, detail=detail@entry=0, instance=instance@entry=0x560e25ddd080, emission_return=emission_return@entry=0x0,
        instance_and_params=instance_and_params@entry=0x7fffac40e7a0) at gsignal.c:3636
    #12 0x00007f6a2181aa56 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffac40e9c0) at gsignal.c:3392
    #13 0x00007f6a2181b093 in g_signal_emit (instance=instance@entry=0x560e25ddd080, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3448
    #14 0x0000560e2392deea in nm_platform_cache_update_emit_signal (self=0x560e25ddd080, cache_op=NMP_CACHE_OPS_UPDATED, obj_old=<optimized out>, obj_new=<optimized out>)
        at src/libnm-platform/nm-platform.c:8824
    #15 0x0000560e238fd520 in event_handler_recvmsgs () at src/libnm-platform/nm-linux-platform.c:7183
    #16 0x0000560e238fdcbf in event_handler_read_netlink () at src/libnm-platform/nm-linux-platform.c:9403
    #17 0x0000560e238ffab3 in delayed_action_handle_one () at src/libnm-platform/nm-linux-platform.c:6238
    #18 0x0000560e238ffcae in delayed_action_handle_all () at src/libnm-platform/nm-linux-platform.c:6256
    #19 0x0000560e23901acc in do_delete_object () at src/libnm-platform/nm-linux-platform.c:7392
    #20 0x0000560e2390227c in ip4_address_delete () at src/libnm-platform/nm-linux-platform.c:8782
    #21 0x0000560e23922709 in nm_platform_ip4_address_delete (self=self@entry=0x560e25ddd080, ifindex=ifindex@entry=150, address=16843009, plen=<optimized out>, peer_address=16843009)
        at src/libnm-platform/nm-platform.c:3574
    #22 0x0000560e239275ab in nm_platform_ip_address_sync (self=0x560e25ddd080, addr_family=addr_family@entry=2, ifindex=150, known_addresses=<optimized out>, known_addresses@entry=0x0,
        addresses_prune=0x560e25e81aa0) at src/libnm-platform/nm-platform.c:3984
    #23 0x0000560e23855e17 in _l3_commit_one (self=0x560e25f168e0, addr_family=2, commit_type=<optimized out>, l3cd_old=<optimized out>, changed_combined_l3cd=<optimized out>)
        at src/core/nm-l3cfg.c:4256
    #24 0x0000560e2385fc5c in _l3_commit (self=0x560e25f168e0, commit_type=NM_L3_CFG_COMMIT_TYPE_REAPPLY, is_idle=<optimized out>) at src/core/nm-l3cfg.c:4353
    #25 0x0000560e239c6a6d in nm_device_cleanup (self=0x560e25e985e0, reason=<optimized out>, cleanup_type=CLEANUP_TYPE_DECONFIGURE) at src/core/devices/nm-device.c:15082
    #26 0x0000560e239c7522 in _set_state_full (self=0x560e25e985e0, state=<optimized out>, reason=<optimized out>, quitting=0) at src/core/devices/nm-device.c:15467
    #27 0x0000560e239cd482 in queued_state_set (user_data=user_data@entry=0x560e25e985e0) at src/core/devices/nm-device.c:15706
    #28 0x00007f6a2131b27b in g_idle_dispatch (source=0x560e25ebab60, callback=0x560e239cd3d0 <queued_state_set>, user_data=0x560e25e985e0) at gmain.c:5579
    #29 0x00007f6a2131e95d in g_main_dispatch (context=0x560e25d97bc0) at gmain.c:3193
    #30 g_main_context_dispatch (context=context@entry=0x560e25d97bc0) at gmain.c:3873
    #31 0x00007f6a2131ed18 in g_main_context_iterate (context=0x560e25d97bc0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3946
    #32 0x00007f6a2131f042 in g_main_loop_run (loop=0x560e25d730f0) at gmain.c:4142
    #33 0x0000560e237c06ec in main (argc=<optimized out>, argv=<optimized out>) at src/core/main.c:509

Fixes: 929eae2 ('l3cfg: implement NM_L3CFG_CONFIG_FLAGS_ASSUME_CONFIG_ONCE and rework object state')
thom311 added a commit that referenced this pull request Feb 23, 2022
…oved_track()

We can get a platform signal for any number of reasons. In particular,
we can get a signal that the object exists in platform, while the object
is tracked as zombie.

"Zombies" are objects that we once actively configured, but now no
longer and thus need to remove them. We remember that we need to delete
the object in kernel.

The assertion was wrong. We don't need to handle the case "in_platform"
and linked in "os_zombie_lst" specially.

Backtrace:

    #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
    #1  0x00007f6a208f1db5 in __GI_abort () at abort.c:79
    #2  0x00007f6a212ed123 in g_assertion_message (domain=<optimized out>, file=<optimized out>, line=<optimized out>,
        func=0x560e23ada2c0 <__func__.39909> "_obj_states_externally_removed_track", message=<optimized out>) at gtestutils.c:2533
    #3  0x00007f6a2134620e in g_assertion_message_expr (domain=domain@entry=0x560e23b781a0 "nm", file=file@entry=0x560e23acec60 "src/core/nm-l3cfg.c", line=line@entry=920,
        func=func@entry=0x560e23ada2c0 <__func__.39909> "_obj_states_externally_removed_track", expr=expr@entry=0x560e23ad1980 "c_list_is_empty(&obj_state->os_zombie_lst)") at gtestutils.c:2556
    #4  0x0000560e23853f38 in _obj_states_externally_removed_track (self=self@entry=0x560e25f168e0, obj=<optimized out>, obj@entry=0x560e25e466a0, in_platform=in_platform@entry=1)
        at src/core/nm-l3cfg.c:920
    #5  0x0000560e2385b8ea in _nm_l3cfg_notify_platform_change (self=0x560e25f168e0, change_type=change_type@entry=NM_PLATFORM_SIGNAL_CHANGED, obj=0x560e25e466a0) at src/core/nm-l3cfg.c:1364
    #6  0x0000560e23861251 in _platform_signal_cb (platform=<optimized out>, obj_type_i=<optimized out>, ifindex=<optimized out>, platform_object=0x560e25e466b8, change_type_i=2,
        p_self=<optimized out>) at ./src/libnm-platform/nmp-object.h:443
    #7  0x00007f6a1c4a914e in ffi_call_unix64 () at ../src/x86/unix64.S:76
    #8  0x00007f6a1c4a8aff in ffi_call (cif=cif@entry=0x7fffac40e570, fn=fn@entry=0x560e23861100 <_platform_signal_cb>, rvalue=<optimized out>, avalue=avalue@entry=0x7fffac40e480)
        at ../src/x86/ffi64.c:525
    #9  0x00007f6a217fee85 in g_cclosure_marshal_generic (closure=<optimized out>, return_gvalue=<optimized out>, n_param_values=<optimized out>, param_values=<optimized out>,
        invocation_hint=<optimized out>, marshal_data=<optimized out>) at gclosure.c:1490
    #10 0x00007f6a217fe3bd in g_closure_invoke (closure=0x560e25df53c0, return_value=0x0, n_param_values=5, param_values=0x7fffac40e7a0, invocation_hint=0x7fffac40e720) at gclosure.c:804
    #11 0x00007f6a21811945 in signal_emit_unlocked_R (node=node@entry=0x7f6a00008870, detail=detail@entry=0, instance=instance@entry=0x560e25ddd080, emission_return=emission_return@entry=0x0,
        instance_and_params=instance_and_params@entry=0x7fffac40e7a0) at gsignal.c:3636
    #12 0x00007f6a2181aa56 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffac40e9c0) at gsignal.c:3392
    #13 0x00007f6a2181b093 in g_signal_emit (instance=instance@entry=0x560e25ddd080, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3448
    #14 0x0000560e2392deea in nm_platform_cache_update_emit_signal (self=0x560e25ddd080, cache_op=NMP_CACHE_OPS_UPDATED, obj_old=<optimized out>, obj_new=<optimized out>)
        at src/libnm-platform/nm-platform.c:8824
    #15 0x0000560e238fd520 in event_handler_recvmsgs () at src/libnm-platform/nm-linux-platform.c:7183
    #16 0x0000560e238fdcbf in event_handler_read_netlink () at src/libnm-platform/nm-linux-platform.c:9403
    #17 0x0000560e238ffab3 in delayed_action_handle_one () at src/libnm-platform/nm-linux-platform.c:6238
    #18 0x0000560e238ffcae in delayed_action_handle_all () at src/libnm-platform/nm-linux-platform.c:6256
    #19 0x0000560e23901acc in do_delete_object () at src/libnm-platform/nm-linux-platform.c:7392
    #20 0x0000560e2390227c in ip4_address_delete () at src/libnm-platform/nm-linux-platform.c:8782
    #21 0x0000560e23922709 in nm_platform_ip4_address_delete (self=self@entry=0x560e25ddd080, ifindex=ifindex@entry=150, address=16843009, plen=<optimized out>, peer_address=16843009)
        at src/libnm-platform/nm-platform.c:3574
    #22 0x0000560e239275ab in nm_platform_ip_address_sync (self=0x560e25ddd080, addr_family=addr_family@entry=2, ifindex=150, known_addresses=<optimized out>, known_addresses@entry=0x0,
        addresses_prune=0x560e25e81aa0) at src/libnm-platform/nm-platform.c:3984
    #23 0x0000560e23855e17 in _l3_commit_one (self=0x560e25f168e0, addr_family=2, commit_type=<optimized out>, l3cd_old=<optimized out>, changed_combined_l3cd=<optimized out>)
        at src/core/nm-l3cfg.c:4256
    #24 0x0000560e2385fc5c in _l3_commit (self=0x560e25f168e0, commit_type=NM_L3_CFG_COMMIT_TYPE_REAPPLY, is_idle=<optimized out>) at src/core/nm-l3cfg.c:4353
    #25 0x0000560e239c6a6d in nm_device_cleanup (self=0x560e25e985e0, reason=<optimized out>, cleanup_type=CLEANUP_TYPE_DECONFIGURE) at src/core/devices/nm-device.c:15082
    #26 0x0000560e239c7522 in _set_state_full (self=0x560e25e985e0, state=<optimized out>, reason=<optimized out>, quitting=0) at src/core/devices/nm-device.c:15467
    #27 0x0000560e239cd482 in queued_state_set (user_data=user_data@entry=0x560e25e985e0) at src/core/devices/nm-device.c:15706
    #28 0x00007f6a2131b27b in g_idle_dispatch (source=0x560e25ebab60, callback=0x560e239cd3d0 <queued_state_set>, user_data=0x560e25e985e0) at gmain.c:5579
    #29 0x00007f6a2131e95d in g_main_dispatch (context=0x560e25d97bc0) at gmain.c:3193
    #30 g_main_context_dispatch (context=context@entry=0x560e25d97bc0) at gmain.c:3873
    #31 0x00007f6a2131ed18 in g_main_context_iterate (context=0x560e25d97bc0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3946
    #32 0x00007f6a2131f042 in g_main_loop_run (loop=0x560e25d730f0) at gmain.c:4142
    #33 0x0000560e237c06ec in main (argc=<optimized out>, argv=<optimized out>) at src/core/main.c:509

Fixes: 929eae2 ('l3cfg: implement NM_L3CFG_CONFIG_FLAGS_ASSUME_CONFIG_ONCE and rework object state')
thom311 added a commit that referenced this pull request Feb 23, 2022
…oved_track()

We can get a platform signal for any number of reasons. In particular,
we can get a signal that the object exists in platform, while the object
is tracked as zombie.

"Zombies" are objects that we once actively configured, but now no
longer and thus need to remove them. We remember that we need to delete
the object in kernel.

The assertion was wrong. We don't need to handle the case "in_platform"
and linked in "os_zombie_lst" specially.

Backtrace:

    #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
    #1  0x00007f6a208f1db5 in __GI_abort () at abort.c:79
    #2  0x00007f6a212ed123 in g_assertion_message (domain=<optimized out>, file=<optimized out>, line=<optimized out>,
        func=0x560e23ada2c0 <__func__.39909> "_obj_states_externally_removed_track", message=<optimized out>) at gtestutils.c:2533
    #3  0x00007f6a2134620e in g_assertion_message_expr (domain=domain@entry=0x560e23b781a0 "nm", file=file@entry=0x560e23acec60 "src/core/nm-l3cfg.c", line=line@entry=920,
        func=func@entry=0x560e23ada2c0 <__func__.39909> "_obj_states_externally_removed_track", expr=expr@entry=0x560e23ad1980 "c_list_is_empty(&obj_state->os_zombie_lst)") at gtestutils.c:2556
    #4  0x0000560e23853f38 in _obj_states_externally_removed_track (self=self@entry=0x560e25f168e0, obj=<optimized out>, obj@entry=0x560e25e466a0, in_platform=in_platform@entry=1)
        at src/core/nm-l3cfg.c:920
    #5  0x0000560e2385b8ea in _nm_l3cfg_notify_platform_change (self=0x560e25f168e0, change_type=change_type@entry=NM_PLATFORM_SIGNAL_CHANGED, obj=0x560e25e466a0) at src/core/nm-l3cfg.c:1364
    #6  0x0000560e23861251 in _platform_signal_cb (platform=<optimized out>, obj_type_i=<optimized out>, ifindex=<optimized out>, platform_object=0x560e25e466b8, change_type_i=2,
        p_self=<optimized out>) at ./src/libnm-platform/nmp-object.h:443
    #7  0x00007f6a1c4a914e in ffi_call_unix64 () at ../src/x86/unix64.S:76
    #8  0x00007f6a1c4a8aff in ffi_call (cif=cif@entry=0x7fffac40e570, fn=fn@entry=0x560e23861100 <_platform_signal_cb>, rvalue=<optimized out>, avalue=avalue@entry=0x7fffac40e480)
        at ../src/x86/ffi64.c:525
    #9  0x00007f6a217fee85 in g_cclosure_marshal_generic (closure=<optimized out>, return_gvalue=<optimized out>, n_param_values=<optimized out>, param_values=<optimized out>,
        invocation_hint=<optimized out>, marshal_data=<optimized out>) at gclosure.c:1490
    #10 0x00007f6a217fe3bd in g_closure_invoke (closure=0x560e25df53c0, return_value=0x0, n_param_values=5, param_values=0x7fffac40e7a0, invocation_hint=0x7fffac40e720) at gclosure.c:804
    #11 0x00007f6a21811945 in signal_emit_unlocked_R (node=node@entry=0x7f6a00008870, detail=detail@entry=0, instance=instance@entry=0x560e25ddd080, emission_return=emission_return@entry=0x0,
        instance_and_params=instance_and_params@entry=0x7fffac40e7a0) at gsignal.c:3636
    #12 0x00007f6a2181aa56 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffac40e9c0) at gsignal.c:3392
    #13 0x00007f6a2181b093 in g_signal_emit (instance=instance@entry=0x560e25ddd080, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3448
    #14 0x0000560e2392deea in nm_platform_cache_update_emit_signal (self=0x560e25ddd080, cache_op=NMP_CACHE_OPS_UPDATED, obj_old=<optimized out>, obj_new=<optimized out>)
        at src/libnm-platform/nm-platform.c:8824
    #15 0x0000560e238fd520 in event_handler_recvmsgs () at src/libnm-platform/nm-linux-platform.c:7183
    #16 0x0000560e238fdcbf in event_handler_read_netlink () at src/libnm-platform/nm-linux-platform.c:9403
    #17 0x0000560e238ffab3 in delayed_action_handle_one () at src/libnm-platform/nm-linux-platform.c:6238
    #18 0x0000560e238ffcae in delayed_action_handle_all () at src/libnm-platform/nm-linux-platform.c:6256
    #19 0x0000560e23901acc in do_delete_object () at src/libnm-platform/nm-linux-platform.c:7392
    #20 0x0000560e2390227c in ip4_address_delete () at src/libnm-platform/nm-linux-platform.c:8782
    #21 0x0000560e23922709 in nm_platform_ip4_address_delete (self=self@entry=0x560e25ddd080, ifindex=ifindex@entry=150, address=16843009, plen=<optimized out>, peer_address=16843009)
        at src/libnm-platform/nm-platform.c:3574
    #22 0x0000560e239275ab in nm_platform_ip_address_sync (self=0x560e25ddd080, addr_family=addr_family@entry=2, ifindex=150, known_addresses=<optimized out>, known_addresses@entry=0x0,
        addresses_prune=0x560e25e81aa0) at src/libnm-platform/nm-platform.c:3984
    #23 0x0000560e23855e17 in _l3_commit_one (self=0x560e25f168e0, addr_family=2, commit_type=<optimized out>, l3cd_old=<optimized out>, changed_combined_l3cd=<optimized out>)
        at src/core/nm-l3cfg.c:4256
    #24 0x0000560e2385fc5c in _l3_commit (self=0x560e25f168e0, commit_type=NM_L3_CFG_COMMIT_TYPE_REAPPLY, is_idle=<optimized out>) at src/core/nm-l3cfg.c:4353
    #25 0x0000560e239c6a6d in nm_device_cleanup (self=0x560e25e985e0, reason=<optimized out>, cleanup_type=CLEANUP_TYPE_DECONFIGURE) at src/core/devices/nm-device.c:15082
    #26 0x0000560e239c7522 in _set_state_full (self=0x560e25e985e0, state=<optimized out>, reason=<optimized out>, quitting=0) at src/core/devices/nm-device.c:15467
    #27 0x0000560e239cd482 in queued_state_set (user_data=user_data@entry=0x560e25e985e0) at src/core/devices/nm-device.c:15706
    #28 0x00007f6a2131b27b in g_idle_dispatch (source=0x560e25ebab60, callback=0x560e239cd3d0 <queued_state_set>, user_data=0x560e25e985e0) at gmain.c:5579
    #29 0x00007f6a2131e95d in g_main_dispatch (context=0x560e25d97bc0) at gmain.c:3193
    #30 g_main_context_dispatch (context=context@entry=0x560e25d97bc0) at gmain.c:3873
    #31 0x00007f6a2131ed18 in g_main_context_iterate (context=0x560e25d97bc0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3946
    #32 0x00007f6a2131f042 in g_main_loop_run (loop=0x560e25d730f0) at gmain.c:4142
    #33 0x0000560e237c06ec in main (argc=<optimized out>, argv=<optimized out>) at src/core/main.c:509

Fixes: 929eae2 ('l3cfg: implement NM_L3CFG_CONFIG_FLAGS_ASSUME_CONFIG_ONCE and rework object state')
thom311 added a commit that referenced this pull request Feb 23, 2022
…oved_track()

We can get a platform signal for any number of reasons. In particular,
we can get a signal that the object is present in platform, while the object
is tracked as zombie.

"Zombies" are objects that were actively configured by NetworkManager, but
now no longer and thus will need to be removed. We remember them as objects
that we need to delete.

The assertion was wrong. We don't need to handle the case "in_platform"
and linked in "os_zombie_lst" specially. If we get a signal that the
object exists while being a zombie, that is fine and not something to
handle specially.

Backtrace:

    #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
    #1  0x00007f6a208f1db5 in __GI_abort () at abort.c:79
    #2  0x00007f6a212ed123 in g_assertion_message (domain=<optimized out>, file=<optimized out>, line=<optimized out>,
        func=0x560e23ada2c0 <__func__.39909> "_obj_states_externally_removed_track", message=<optimized out>) at gtestutils.c:2533
    #3  0x00007f6a2134620e in g_assertion_message_expr (domain=domain@entry=0x560e23b781a0 "nm", file=file@entry=0x560e23acec60 "src/core/nm-l3cfg.c", line=line@entry=920,
        func=func@entry=0x560e23ada2c0 <__func__.39909> "_obj_states_externally_removed_track", expr=expr@entry=0x560e23ad1980 "c_list_is_empty(&obj_state->os_zombie_lst)") at gtestutils.c:2556
    #4  0x0000560e23853f38 in _obj_states_externally_removed_track (self=self@entry=0x560e25f168e0, obj=<optimized out>, obj@entry=0x560e25e466a0, in_platform=in_platform@entry=1)
        at src/core/nm-l3cfg.c:920
    #5  0x0000560e2385b8ea in _nm_l3cfg_notify_platform_change (self=0x560e25f168e0, change_type=change_type@entry=NM_PLATFORM_SIGNAL_CHANGED, obj=0x560e25e466a0) at src/core/nm-l3cfg.c:1364
    #6  0x0000560e23861251 in _platform_signal_cb (platform=<optimized out>, obj_type_i=<optimized out>, ifindex=<optimized out>, platform_object=0x560e25e466b8, change_type_i=2,
        p_self=<optimized out>) at ./src/libnm-platform/nmp-object.h:443
    #7  0x00007f6a1c4a914e in ffi_call_unix64 () at ../src/x86/unix64.S:76
    #8  0x00007f6a1c4a8aff in ffi_call (cif=cif@entry=0x7fffac40e570, fn=fn@entry=0x560e23861100 <_platform_signal_cb>, rvalue=<optimized out>, avalue=avalue@entry=0x7fffac40e480)
        at ../src/x86/ffi64.c:525
    #9  0x00007f6a217fee85 in g_cclosure_marshal_generic (closure=<optimized out>, return_gvalue=<optimized out>, n_param_values=<optimized out>, param_values=<optimized out>,
        invocation_hint=<optimized out>, marshal_data=<optimized out>) at gclosure.c:1490
    #10 0x00007f6a217fe3bd in g_closure_invoke (closure=0x560e25df53c0, return_value=0x0, n_param_values=5, param_values=0x7fffac40e7a0, invocation_hint=0x7fffac40e720) at gclosure.c:804
    #11 0x00007f6a21811945 in signal_emit_unlocked_R (node=node@entry=0x7f6a00008870, detail=detail@entry=0, instance=instance@entry=0x560e25ddd080, emission_return=emission_return@entry=0x0,
        instance_and_params=instance_and_params@entry=0x7fffac40e7a0) at gsignal.c:3636
    #12 0x00007f6a2181aa56 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffac40e9c0) at gsignal.c:3392
    #13 0x00007f6a2181b093 in g_signal_emit (instance=instance@entry=0x560e25ddd080, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3448
    #14 0x0000560e2392deea in nm_platform_cache_update_emit_signal (self=0x560e25ddd080, cache_op=NMP_CACHE_OPS_UPDATED, obj_old=<optimized out>, obj_new=<optimized out>)
        at src/libnm-platform/nm-platform.c:8824
    #15 0x0000560e238fd520 in event_handler_recvmsgs () at src/libnm-platform/nm-linux-platform.c:7183
    #16 0x0000560e238fdcbf in event_handler_read_netlink () at src/libnm-platform/nm-linux-platform.c:9403
    #17 0x0000560e238ffab3 in delayed_action_handle_one () at src/libnm-platform/nm-linux-platform.c:6238
    #18 0x0000560e238ffcae in delayed_action_handle_all () at src/libnm-platform/nm-linux-platform.c:6256
    #19 0x0000560e23901acc in do_delete_object () at src/libnm-platform/nm-linux-platform.c:7392
    #20 0x0000560e2390227c in ip4_address_delete () at src/libnm-platform/nm-linux-platform.c:8782
    #21 0x0000560e23922709 in nm_platform_ip4_address_delete (self=self@entry=0x560e25ddd080, ifindex=ifindex@entry=150, address=16843009, plen=<optimized out>, peer_address=16843009)
        at src/libnm-platform/nm-platform.c:3574
    #22 0x0000560e239275ab in nm_platform_ip_address_sync (self=0x560e25ddd080, addr_family=addr_family@entry=2, ifindex=150, known_addresses=<optimized out>, known_addresses@entry=0x0,
        addresses_prune=0x560e25e81aa0) at src/libnm-platform/nm-platform.c:3984
    #23 0x0000560e23855e17 in _l3_commit_one (self=0x560e25f168e0, addr_family=2, commit_type=<optimized out>, l3cd_old=<optimized out>, changed_combined_l3cd=<optimized out>)
        at src/core/nm-l3cfg.c:4256
    #24 0x0000560e2385fc5c in _l3_commit (self=0x560e25f168e0, commit_type=NM_L3_CFG_COMMIT_TYPE_REAPPLY, is_idle=<optimized out>) at src/core/nm-l3cfg.c:4353
    #25 0x0000560e239c6a6d in nm_device_cleanup (self=0x560e25e985e0, reason=<optimized out>, cleanup_type=CLEANUP_TYPE_DECONFIGURE) at src/core/devices/nm-device.c:15082
    #26 0x0000560e239c7522 in _set_state_full (self=0x560e25e985e0, state=<optimized out>, reason=<optimized out>, quitting=0) at src/core/devices/nm-device.c:15467
    #27 0x0000560e239cd482 in queued_state_set (user_data=user_data@entry=0x560e25e985e0) at src/core/devices/nm-device.c:15706
    #28 0x00007f6a2131b27b in g_idle_dispatch (source=0x560e25ebab60, callback=0x560e239cd3d0 <queued_state_set>, user_data=0x560e25e985e0) at gmain.c:5579
    #29 0x00007f6a2131e95d in g_main_dispatch (context=0x560e25d97bc0) at gmain.c:3193
    #30 g_main_context_dispatch (context=context@entry=0x560e25d97bc0) at gmain.c:3873
    #31 0x00007f6a2131ed18 in g_main_context_iterate (context=0x560e25d97bc0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3946
    #32 0x00007f6a2131f042 in g_main_loop_run (loop=0x560e25d730f0) at gmain.c:4142
    #33 0x0000560e237c06ec in main (argc=<optimized out>, argv=<optimized out>) at src/core/main.c:509

Fixes: 929eae2 ('l3cfg: implement NM_L3CFG_CONFIG_FLAGS_ASSUME_CONFIG_ONCE and rework object state')
thom311 added a commit that referenced this pull request Feb 24, 2022
…oved_track()

We can get a platform signal for any number of reasons. In particular,
we can get a signal that the object is present in platform, while the object
is tracked as zombie.

"Zombies" are objects that were actively configured by NetworkManager, but
now no longer and thus will need to be removed. We remember them as objects
that we need to delete.

The assertion was wrong. We don't need to handle the case "in_platform"
and linked in "os_zombie_lst" specially. If we get a signal that the
object exists while being a zombie, that is fine and not something to
handle specially.

Backtrace:

    #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
    #1  0x00007f6a208f1db5 in __GI_abort () at abort.c:79
    #2  0x00007f6a212ed123 in g_assertion_message (domain=<optimized out>, file=<optimized out>, line=<optimized out>,
        func=0x560e23ada2c0 <__func__.39909> "_obj_states_externally_removed_track", message=<optimized out>) at gtestutils.c:2533
    #3  0x00007f6a2134620e in g_assertion_message_expr (domain=domain@entry=0x560e23b781a0 "nm", file=file@entry=0x560e23acec60 "src/core/nm-l3cfg.c", line=line@entry=920,
        func=func@entry=0x560e23ada2c0 <__func__.39909> "_obj_states_externally_removed_track", expr=expr@entry=0x560e23ad1980 "c_list_is_empty(&obj_state->os_zombie_lst)") at gtestutils.c:2556
    #4  0x0000560e23853f38 in _obj_states_externally_removed_track (self=self@entry=0x560e25f168e0, obj=<optimized out>, obj@entry=0x560e25e466a0, in_platform=in_platform@entry=1)
        at src/core/nm-l3cfg.c:920
    #5  0x0000560e2385b8ea in _nm_l3cfg_notify_platform_change (self=0x560e25f168e0, change_type=change_type@entry=NM_PLATFORM_SIGNAL_CHANGED, obj=0x560e25e466a0) at src/core/nm-l3cfg.c:1364
    #6  0x0000560e23861251 in _platform_signal_cb (platform=<optimized out>, obj_type_i=<optimized out>, ifindex=<optimized out>, platform_object=0x560e25e466b8, change_type_i=2,
        p_self=<optimized out>) at ./src/libnm-platform/nmp-object.h:443
    #7  0x00007f6a1c4a914e in ffi_call_unix64 () at ../src/x86/unix64.S:76
    #8  0x00007f6a1c4a8aff in ffi_call (cif=cif@entry=0x7fffac40e570, fn=fn@entry=0x560e23861100 <_platform_signal_cb>, rvalue=<optimized out>, avalue=avalue@entry=0x7fffac40e480)
        at ../src/x86/ffi64.c:525
    #9  0x00007f6a217fee85 in g_cclosure_marshal_generic (closure=<optimized out>, return_gvalue=<optimized out>, n_param_values=<optimized out>, param_values=<optimized out>,
        invocation_hint=<optimized out>, marshal_data=<optimized out>) at gclosure.c:1490
    #10 0x00007f6a217fe3bd in g_closure_invoke (closure=0x560e25df53c0, return_value=0x0, n_param_values=5, param_values=0x7fffac40e7a0, invocation_hint=0x7fffac40e720) at gclosure.c:804
    #11 0x00007f6a21811945 in signal_emit_unlocked_R (node=node@entry=0x7f6a00008870, detail=detail@entry=0, instance=instance@entry=0x560e25ddd080, emission_return=emission_return@entry=0x0,
        instance_and_params=instance_and_params@entry=0x7fffac40e7a0) at gsignal.c:3636
    #12 0x00007f6a2181aa56 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffac40e9c0) at gsignal.c:3392
    #13 0x00007f6a2181b093 in g_signal_emit (instance=instance@entry=0x560e25ddd080, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3448
    #14 0x0000560e2392deea in nm_platform_cache_update_emit_signal (self=0x560e25ddd080, cache_op=NMP_CACHE_OPS_UPDATED, obj_old=<optimized out>, obj_new=<optimized out>)
        at src/libnm-platform/nm-platform.c:8824
    #15 0x0000560e238fd520 in event_handler_recvmsgs () at src/libnm-platform/nm-linux-platform.c:7183
    #16 0x0000560e238fdcbf in event_handler_read_netlink () at src/libnm-platform/nm-linux-platform.c:9403
    #17 0x0000560e238ffab3 in delayed_action_handle_one () at src/libnm-platform/nm-linux-platform.c:6238
    #18 0x0000560e238ffcae in delayed_action_handle_all () at src/libnm-platform/nm-linux-platform.c:6256
    #19 0x0000560e23901acc in do_delete_object () at src/libnm-platform/nm-linux-platform.c:7392
    #20 0x0000560e2390227c in ip4_address_delete () at src/libnm-platform/nm-linux-platform.c:8782
    #21 0x0000560e23922709 in nm_platform_ip4_address_delete (self=self@entry=0x560e25ddd080, ifindex=ifindex@entry=150, address=16843009, plen=<optimized out>, peer_address=16843009)
        at src/libnm-platform/nm-platform.c:3574
    #22 0x0000560e239275ab in nm_platform_ip_address_sync (self=0x560e25ddd080, addr_family=addr_family@entry=2, ifindex=150, known_addresses=<optimized out>, known_addresses@entry=0x0,
        addresses_prune=0x560e25e81aa0) at src/libnm-platform/nm-platform.c:3984
    #23 0x0000560e23855e17 in _l3_commit_one (self=0x560e25f168e0, addr_family=2, commit_type=<optimized out>, l3cd_old=<optimized out>, changed_combined_l3cd=<optimized out>)
        at src/core/nm-l3cfg.c:4256
    #24 0x0000560e2385fc5c in _l3_commit (self=0x560e25f168e0, commit_type=NM_L3_CFG_COMMIT_TYPE_REAPPLY, is_idle=<optimized out>) at src/core/nm-l3cfg.c:4353
    #25 0x0000560e239c6a6d in nm_device_cleanup (self=0x560e25e985e0, reason=<optimized out>, cleanup_type=CLEANUP_TYPE_DECONFIGURE) at src/core/devices/nm-device.c:15082
    #26 0x0000560e239c7522 in _set_state_full (self=0x560e25e985e0, state=<optimized out>, reason=<optimized out>, quitting=0) at src/core/devices/nm-device.c:15467
    #27 0x0000560e239cd482 in queued_state_set (user_data=user_data@entry=0x560e25e985e0) at src/core/devices/nm-device.c:15706
    #28 0x00007f6a2131b27b in g_idle_dispatch (source=0x560e25ebab60, callback=0x560e239cd3d0 <queued_state_set>, user_data=0x560e25e985e0) at gmain.c:5579
    #29 0x00007f6a2131e95d in g_main_dispatch (context=0x560e25d97bc0) at gmain.c:3193
    #30 g_main_context_dispatch (context=context@entry=0x560e25d97bc0) at gmain.c:3873
    #31 0x00007f6a2131ed18 in g_main_context_iterate (context=0x560e25d97bc0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3946
    #32 0x00007f6a2131f042 in g_main_loop_run (loop=0x560e25d730f0) at gmain.c:4142
    #33 0x0000560e237c06ec in main (argc=<optimized out>, argv=<optimized out>) at src/core/main.c:509

Fixes: 929eae2 ('l3cfg: implement NM_L3CFG_CONFIG_FLAGS_ASSUME_CONFIG_ONCE and rework object state')
(cherry picked from commit 849a4ee)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants