Mon, Sep 07, 2015 at 06:01:34PM CEST, pwieczorkiewicz(a)suse.de wrote:
In case of e.g. arp_ping (or nsna_ping) link watch used
when adding a port dynamically (i.e. through PortAdd DBus
method for instance) teamd crashes on lw_psr_port_removed()
ops call, when there was no previous corresponding
lw_ap_port_added() call.
That happens when teamd_link_watch_arp_ping object
port_priv's .init call did not happen due to some preceding
error, whereas .fini is called immediately following the error
flow of port_obj_create().
Calls:
port_priv_change_handler_func()
port_obj_create()
teamd_event_port_added()
port_priv_init_all() <- some initial .init fails here, before
port_prov's init. lw_ap_port_added()
remains uncalled and psr_ppriv->ops
unset (NULL).
port_obj_destroy()
port_priv_fini_all() <- segfault, due to uninitialized ops.
First step fix would be to check for initialization of
psr_ppriv->ops, indicating that corresponding .init call
has happened before.
This does not look correct to me. I think this should be rather handled
in generic port code, some "init flag" perhaps?