Bug #3983
openosmo_fsm_inst_change_parent() forgets to talloc reparent
0%
Description
osmo_fsm_inst_alloc_child() specifically allocates the child FSM instance as a talloc child of the parent FSM instance.
However, osmo_fsm_inst_change_parent() fails to move the child FSM instance to belong to the new parent FI's talloc context.
A distinct talloc_steal() is necessary to fix the situation, for example in osmo-msc:
osmo_fsm_inst_change_parent(cl->fi, new_parent_fi, parent_event_term); talloc_steal(new_parent_fi, cl->fi);
When fixing this, we need to consider previous users of libosmocore and compatibility,
so we probably need an osmo_fsm_inst_change_parent2() which also reparents, and deprecate but keep unchanged the current osmo_fsm_inst_change_parent() function.
Updated by laforge almost 5 years ago
On Tue, May 07, 2019 at 10:51:09PM +0000, neels [REDMINE] wrote:
When fixing this, we need to consider previous users of libosmocore and compatibility,
I think we just have to worry if any of our own existing users is
relying on that exact broken behavior. It is a fix, obviously, and we
shouldn't let compatibility deter us from
fixing bugs.