Project

General

Profile

Bug #3983

osmo_fsm_inst_change_parent() forgets to talloc reparent

Added by neels about 1 month ago. Updated about 1 month ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
05/07/2019
Due date:
% Done:

0%

Spec Reference:

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.

History

#1 Updated by laforge about 1 month 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.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)